Commit Graph

33 Commits

Author SHA1 Message Date
Linus Torvalds f0d55cc1a6 fbdev changes for 3.13
Nothing particularly stands out in this pull request. The biggest part of the
 changes are cleanups.
 
 Maybe one fix to mention is the "fb: reorder the lock sequence to fix potential
 dead lock" which hopefully fixes the fb locking issues reported by multiple
 persons.
 
 There are also a few commits that have changes to arch/arm/mach-at91 and
 arch/avr32, which have been acked by the maintainers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJSg2oCAAoJEPo9qoy8lh71vXsP/2AjkzOlcKBPutMG/W30QMHT
 tkKfr/RL8C3oXcimkE6ch3ksbFj2t5corxa/DLTdESdTpeFAgxj72pcdhN3X4+Xs
 7IokExM2W5s6p4pP66PTr2A5XhEyAHtEMp+2JbHPRzwZitblzBLZvuPUJljwJDpj
 Z9+sD00xv/MZrXDCsEN8k2xdJ3rFn6JgX267y1qajlsocZoseTF2ed94IN/YnIM7
 B2hra1B4E21FPYLzRDOJRmZa0YGomLTymezPnPg33hLBhnJU/aG4HLDHKUZWhduz
 /6UwACH63ja7I2z/8AZHQ1ACdbGheRtHbjwV9LLYlbaAvPmUqNTZ4b6UeQOb/EZ0
 3SPCYbwD6+RMhSx/j/XhySvw82RY0i1aTlTDyjgOggfrfdi4x1Wk54bUWp5l9O3D
 SX1vSpNLGSh4GKXRzJjf3jouG/LcOzlpDlVZXzgsPzkyirluUv6QdMTopJwFwIGx
 rFgtsbkvhEsFvaNhhVIqQXKfwZ69r42U5JC+fDM5u7VX0mqyJ1usUNGvNSeifcDg
 EwUAI6RGnOXCO6crj2BZYpRTdc61tnY9b4CGLHDCeQkEXokEsEJ7Mz+8YfSwFo7X
 wqh+dAPQaixeHtUFZ8GhHXeAsjoQRSBXygf3NSNmCeP3WsmuozbauuujSrrTHITp
 LOXFPhU9uxHu4mDd6wrq
 =59+j
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev changes from Tomi Valkeinen:
 "Nothing particularly stands out in this pull request.  The biggest
  part of the changes are cleanups.

  Maybe one fix to mention is the "fb: reorder the lock sequence to fix
  potential dead lock" which hopefully fixes the fb locking issues
  reported by multiple persons.

  There are also a few commits that have changes to arch/arm/mach-at91
  and arch/avr32, which have been acked by the maintainers"

* tag 'fbdev-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (143 commits)
  fb: reorder the lock sequence to fix potential dead lock
  fbdev: shmobile-lcdcfb: Convert to clk_prepare/unprepare
  fbdev: shmobile-hdmi: Convert to clk_prepare/unprepare
  omapdss: Add new panel driver for Topolly td028ttec1 LCD.
  video: exynos_mipi_dsi: Unlock the mutex before returning
  video: da8xx-fb: remove unwanted define
  video: Remove unnecessary semicolons
  simplefb: use write-combined remapping
  simplefb: fix unmapping fb during destruction
  OMAPDSS: connector-dvi: fix releasing i2c_adapter
  OMAPDSS: DSI: fix perf measuring ifdefs
  framebuffer: Use fb_<level>
  framebuffer: Add fb_<level> convenience logging macros
  efifb: prevent null-deref when iterating dmi_list
  fbdev: fix error return code in metronomefb_probe()
  video: xilinxfb: Fix for "Use standard variable name convention"
  OMAPDSS: Fix de_level in videomode_to_omap_video_timings()
  video: xilinxfb: Simplify error path
  video: xilinxfb: Use devm_kzalloc instead of kzalloc
  video: xilinxfb: Use standard variable name convention
  ...
2013-11-14 14:44:20 +09:00
Joe Perches 31b6780c15 framebuffer: Use fb_<level>
Neaten and shorten the code using the new fb_<level> macros.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-10-29 12:53:07 +02:00
Wei Yongjun 8c42cf7549 neofb: fix error return code in neofb_probe()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-09-26 11:45:16 +03:00
Jingoo Han 0ab49846c8 video: neofb: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-09-19 13:30:09 +03:00
Greg Kroah-Hartman 48c68c4f1b Drivers: video: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:01 -08:00
David Howells 9ffc93f203 Remove all #inclusions of asm/system.h
Remove all #inclusions of asm/system.h preparatory to splitting and killing
it.  Performed with the following command:

perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *`

Signed-off-by: David Howells <dhowells@redhat.com>
2012-03-28 18:30:03 +01:00
Rusty Russell 90ab5ee941 module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-13 09:32:20 +10:30
Laurent Pinchart 4935ebf43c neofb: use display information in info not in var for panning
We must not use any information in the passed var besides xoffset,
yoffset and vmode as otherwise applications might abuse it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 10:33:02 +02:00
Hannes Eder 27ec937c4f neofb: fix sparse warnings
Fix this sparse warnings:

  drivers/video/neofb.c:1456:4: warning: returning void-valued expression
  drivers/video/neofb.c:1464:3: warning: returning void-valued expression

Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Cc: Krzysztof Helt <krzysztof.h1@poczta.fm>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:27 -08:00
Krzysztof Helt 3a568051f3 neofb: remove open_lock mutex
Remove mutex from the fb_open/fb_release functions as these operations are
mutexed at fb layer.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:42 -07:00
Krzysztof Helt 0716a8eab3 neofb: kill some redundant code
Move common code outside if/else or switch/case clauses.

Drop checks done twice inside the neofb_check_var().

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:42 -07:00
Krzysztof Helt d15d56f9f1 neofb: reduce panning function
Reduce panning function by deleting checks done by higher layer and
folding remaining function into the called one.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-16 11:21:41 -07:00
Krzysztof Helt c6b044d6ba neofb: drop the xtimings structure
Remove the xtimings structure which only stored some values to be used
later (mostly once).  Calculate and use these values in places they are
needed.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:41 -07:00
Krzysztof Helt 1ca6b62f8c neofb: drop redundant code
Drop structure which is only set but never read.  Drop variables which are
only set and never read.  Convert one long switch into two shorter ones.

Add cpu_relax() in busy waiting loop.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:41 -07:00
Krzysztof Helt 7fc80b7bd6 neofb: simplify clock calculation
There is nothing to gain by converting value in kHz to fixed point MHz.
Just calculate everything in kHz.

A reorder of the loop allows reducing number of iterations (check if
frequency is not too high already).

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:41 -07:00
Andrew Morton 0e9045494a neofb: avoid overwriting fb_info fields
Fix bug identified by Marcio Buss in
http://bugzilla.kernel.org/show_bug.cgi?id=9565 - neofb can overwrite a field
in the fb_info struct.

This fix will result in truncated device identification strings - perhaps
fb_innfo.fix.id can be made larger?

Cc: Marcio Buss <marciobuss@gmail.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Christian Trefzer <ctrefzer@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:16 -08:00
Krzysztof Helt 84902b7af6 fbdev: change asm/uaccess.h to linux/uaccess.h
This patch replaces <asm/uaccess.h> with <linux/uaccess.h> after the
checkpatch.pl hint.  The include of <asm/uaccess.h> is removed if the driver
does not use it.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16 09:43:17 -07:00
Antonino A. Daplas a2b7d2e97e neofb: Fix pseudo_palette array overrun in neofb_setcolreg
The pseudo_palette has room for 16 entries only, but in truecolor mode, it
attempts to write 256.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Tero Roponen <teanropo@jyu.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-31 07:48:27 -07:00
Antonino A. Daplas 41988d6e60 neofb: fill transp->msb_right with the correct value
Fill transp->msb_right with the correct value.  fbcon ignores this, but user
apps may not.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-08 11:15:26 -07:00
Jiri Slaby c4f28e54d6 [PATCH] Video: fb, add true ref_count atomicity
Some of fb drivers uses atomic_t in bad manner, since there are still some
race-prone gaps.  Use mutexes to protect open/close code sections with
ref_count testing and finally use simple uint.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Denis Oliver Kropp <dok@directfb.org>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:42 -08:00
Adrian Bunk f9506a53b4 [PATCH] proper prototype for tosh_smm()
Add a proper prototype for tosh_smm() to include/linux/toshiba.h

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-12 09:48:42 -08:00
Mariusz Kozlowski 4971bb70c0 [PATCH] video: neofb stray bracket fix
This code is '#if 0'ed.  Anyway if anyone wants to dump neo registers
better to have it fixed.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-08 08:29:08 -08:00
Jon Smirl a8f340e394 [PATCH] vt: Remove VT-specific declarations and definitions from tty.h
MAX_NR_CONSOLES, fg_console, want_console and last_console are more of a
function of the VT layer than the TTY one.  Moving these to vt.h and vt_kern.h
allows all of the framebuffer and VT console drivers to remove their
dependency on tty.h.

[akpm@osdl.org: fix alpha build]
Signed-off-by: Jon Smirl <jonsmir@gmail.com>
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-10 13:24:16 -07:00
Jörn Engel 6ab3d5624e Remove obsolete #include <linux/config.h>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-06-30 19:25:36 +02:00
Christian Trefzer 4efefd1d8e [PATCH] neofb: fix unblank logic interfering with lid toggled backlight
This is a fix for the most annoying problem that remained with neofb:

After "setterm -powersave powerdown" the console blanker will disable the
backlight after the given timeout expires.  If this happens after the lid
has been shut, we read "LCD off" from the register and store that in the
driver.  Once the lid is opened, the backlight turns on, but any key press
that would awaken the blanked console will switch the backlight off again.

The workaround so far was to use the "display config toggle" Fn key combo -
once if no external display is attached, otherwise as often as required to
restore the desired display setup.

The following patch fixes the issue at least for the LCD-only case, with no
external monitor attached.  Other display setup permutations are pending
further testing, but so far I can guarantee at least no negative change in
behaviour, if any at all.

Signed-off-by: Christian Trefzer <ctrefzer@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-26 09:58:31 -07:00
Tobias Klauser d1ae418eef [PATCH] drivers/video: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of ARRAY_SIZE.  Some coding style and trailing whitespaces are
also fixed.

Compile-tested where possible (some are other arch or BROKEN)

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-27 08:44:58 -08:00
Antonino A. Daplas 6af7ffc414 [PATCH] neofb: Fix uninitialized value
Remove insignificant and unitialized variable "waitcycles" from neo2200_sync.

Coverity Bug 895

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-11 09:19:35 -08:00
Christian Trefzer 9f672004ab [PATCH] neofb: avoid resetting display config on unblank (v2)
There were two mistakes in the register-read-on-(un)blank approach.

- First, without proper register (un)locking the value read back will always
  be zero, and this is what I missed entirely until just now.  Due to this,
  the logic could not be verified at all and I tried some bogus checks which
  are completely stupid.

- Second, the LCD status bit will always be set to zero when the backlight
  has been turned off.  Reading the value back during unblank will disable the
  LCD unconditionally, regardless of the state it is supposed to be in, since
  we set it to zero beforehand.

So this is what we do now:

- create a new variable in struct neofb_par, and use that to determine
  whether to read back registers (initialized to true)

- before actually blanking the screen, read back the register to sense any
  possible change made through Fn key combo

- use proper neoUnlock() / neoLock() to actually read something

- every call to neofb_blank() determines if we read back next time: blanking
  disables readback, unblanking (FB_BLANK_UNBLANK) enables it

This should give us a nice and clean state machine.  Has been thoroughly
tested on a Dell Latitude CPiA / NM220 Chip docked to a C/Dock2 with attached
CRT in all possible combinations of LCD/CRT on/off.  I changed the config via
Fn key, let the console blank, unblanked by keypress - works flawlessly.

Signed-off-by: Christian Trefzer <ctrefzer@gmx.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-15 15:32:21 -08:00
Christian Trefzer 10ee39fe3f [PATCH] neofb: avoid resetting display config on unblank
Fix issues with the NeoMagic framebuffer driver.

It nicely complements my previous fix already in linus' tree.  The only
thing missing now is that the external CRT will not be activated at neofb
init when external-only is selected, either by register read or
module/kernel parameter.

Testing was done on a Dell Latitude CPi-A/NM2200 chip.

Previous behaviour:
- before booting linux, set the preferred display config X via FN+F8

- boot linux, neofb stores the register values in a private
  variable

- change the display config to Y via keystroke

- leave the machine in peace until display is blanked

- touching any key will result in display config X being restored

- booting up, the BIOS will acknowledge config Y, though...

Current behaviour:
At the time of unblanking, config Y is honoured because we now read back
register contents instead of just overwriting them with outdated values.

Signed-off by: Christian Trefzer <ctrefzer@gmx.de>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-14 16:09:35 -08:00
Christian Trefzer 4836f5749e [PATCH] neofb: take existing display configuration as default
On a Dell Latitude CPi-A I noticed a strangeness wrt.  the handling of an
external monitor by the neomagic framebuffer driver, namely when the laptop is
docked in a C/Dock II with the lid shut.

A cold boot would result in the BIOS configuring the video chip to use the
"external monitor only" mode, yet neofb would default to "internal LCD only".
An attempt for a quick fix by using the Fn-F8 keystroke to toggle the display
combination modes resulted in a reproductible hard lock, powering down being
the only solution.

The attached patch makes neofb probe the register for the current display
mode, using that value as a default if nothing was specified as kernel/module
parameter.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-14 18:27:14 -08:00
Antonino A. Daplas 9f19bc56c3 [PATCH] fbdev: neofb: Driver cleanups
- remove unneeded casts
- move memory for pseudo_palette inside struct neofb_par

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-01-10 08:01:45 -08:00
Antonino A. Daplas c465e05a03 [PATCH] fbcon/fbdev: Move softcursor out of fbdev to fbcon
According to Jon Smirl, filling in the field fb_cursor with soft_cursor for
drivers that do not support hardware cursors is redundant.  The soft_cursor
function is usable by all drivers because it is just a wrapper around
fb_imageblit.  And because soft_cursor is an fbcon-specific hook, the file is
moved to the console directory.

Thus, drivers that do not support hardware cursors can leave the fb_cursor
field blank.  For drivers that do, they can fill up this field with their own
version.

The end result is a smaller code size.  And if the framebuffer console is not
loaded, module/kernel size is also reduced because the soft_cursor module will
also not be loaded.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-11-07 07:53:50 -08:00
Linus Torvalds 1da177e4c3 Linux-2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!
2005-04-16 15:20:36 -07:00