dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

81 Commits

Author SHA1 Message Date
Laurent Pinchart dc48665fae fbdev: sh_mobile_lcdc: Don't acknowlege interrupts unintentionally
The LDINTR register caries both interrupt enable and interrupt status
bits. When setting or clearing interrupt enable bits, write all status
bits to 1 to avoid acknowledging interrupts by mistake.

When acknowledging interrupts, write 1 to all non-triggered interrupt
bits to avoid losing interrupts.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 08:22:38 +02:00
Laurent Pinchart ce1c0b0873 fbdev: sh_mobile_lcdc: Replace hardcoded register values with macros
Instead of hardcoding register values through the driver, define macros
for individual register bits using the register name and the bit name,
and use the macros.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 08:22:37 +02:00
Laurent Pinchart f1ad90da5c fbdev: sh_mobile_lcdc: Turn dot clock on before resuming from runtime PM
Resuming from runtime PM restores all LCDC registers. If the dot clock
is off at that time display panning information will be corrupted.

Turn the dot clock on before resuming from runtime PM. Similarly,
turn the clock off after suspending the LCDC.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2011-08-19 08:22:28 +02:00
Damian Hobson-Garcia ec19b9e0fa fbdev: sh_mobile_meram: Enable/disable MERAM along with LCDC
The MERAM reference counts should be tied to the two LCDC devices (LCD/HDMI)
so that when they are enable/disabled, the MERAM is as well.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
2011-08-19 08:11:12 +02:00
Arun Sharma 60063497a9 atomic: use <linux/atomic.h>
This allows us to move duplicated code in <asm/atomic.h>
(atomic_inc_not_zero() for now) to <linux/atomic.h>

Signed-off-by: Arun Sharma <asharma@fb.com>
Reviewed-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Miller <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26 16:49:47 -07:00
Paul Mundt 554cc10286 fbdev: sh_mobile_lcdcfb: Fix up fallout from MERAM changes.
The LCDC driver does no longer compile:

  CC      drivers/video/sh_mobile_meram.o
  CC      drivers/video/sh_mobile_lcdcfb.o
drivers/video/sh_mobile_lcdcfb.c: In function 'sh_mobile_lcdc_start':
drivers/video/sh_mobile_lcdcfb.c:640:4: error: 'ret' undeclared (first use in this function)
drivers/video/sh_mobile_lcdcfb.c:640:4: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [drivers/video/sh_mobile_lcdcfb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

Reported-by: Magnus Damm <magnus.damm@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-06-02 16:53:43 +09:00
Paul Mundt 087faf77a5 Merge branch 'common/fbdev-meram' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 2011-05-25 15:01:25 +09:00
Damian eae9b85b5f sh_mobile_meram: Safely disable MERAM operation when not initialized
If the MERAM platform data is defined, but the MERAM has not been
properly initaliazed we need to safely fall back to non-MERAM operation.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-25 11:43:11 +09:00
Paul Mundt d15660a1e6 Merge branches 'common/fbdev' and 'common/fbdev-meram' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 2011-05-24 15:49:57 +09:00
Guennadi Liakhovetski ebe5e12d00 fbdev: sh_mobile_lcdc: remove runtime PM calls from the notifier
The notifier function calls sh_mobile_lcdc_stop() and
sh_mobile_lcdc_start(), which already take care about the runtime PM
state. Remove redundant calls.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-24 15:42:11 +09:00
Guennadi Liakhovetski 69843ba7f2 fbdev: sh_mobile_lcdc: reduce scope of a variable
The "ret" variable in sh_mobile_lcdc_start() is only used at one
location, move its definition to the inner-most scope.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-24 15:42:04 +09:00
Damian 3fedd2ac76 sh_mobile_meram: Add support for NV24 framebuffers
Since the NV24 framebuffer has a CbCr plane that is twice as wide
as the Y plane, it needs to be handled as a special case.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-23 16:06:26 +09:00
Damian 7caa4342ca sh_mobile_meram: MERAM framework for LCDC
Based on the patch by Takanari Hayama <taki@igel.co.jp>

Adds support framework necessary to use Media RAM (MERAM)
caching functionality with the LCDC.  The MERAM is accessed
through up to 4 Interconnect Buffers (ICBs).

ICB numbers and MERAM address ranges to use are specified in
by filling in the .meram_cfg member of the LCDC platform data

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-05-23 16:06:24 +09:00
Paul Mundt 1fcf0069f4 Merge branch 'common/fbdev' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6 2011-03-29 16:06:21 +09:00
Alexandre Courbot 247f993861 fbdev: sh_mobile_lcdcfb: fix module lock acquisition
Whenever the LCDC is to be started or stopped, a board callback is
checked for existence and invoked. Prior to the invokation, the
callback's module lock is also acquired, to be released once the
callback returns. However, the order of testing makes it possible for
the lock to be acquired and not released in case the callback does not
exist. This patch reorders the tests to prevent this particular case.

Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-29 16:04:45 +09:00
Alexandre Courbot 8857b9aa7e fbdev: sh_mobile_lcdcfb: add blanking support
Add a blanking callback to the LCDC driver in order to support both
FBIOBLANK and TIOCLINUX blanking ioctls. LCDC clocks are also released
if the requested blanking level is superior to FB_BLANK_NORMAL, to allow
runtime PM to disable the clocks if possible.

Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-29 16:04:39 +09:00
Dan Carpenter beee1f20a1 fbdev: sh_mobile_lcdc: checking NULL instead of IS_ERR()
backlight_device_register() returns an ERR_PTR.  It doesn't return NULL.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-22 16:08:48 +09:00
Damian Hobson-Garcia 53b5031430 fbdev: sh_mobile_lcdc: Add YUV framebuffer support
Supports YCbCr420sp, YCbCr422sp, and YCbCr44sp, formats
(bpp = 12, 16, and 24) respectively.

When double-buffering both Y planes appear before the C planes (Y-Y-C-C),
as opposed to  Y-C-Y-C.

Set .nonstd in struct sh_mobile_lcdc_chan_cfg to enable YUV mode, and use
.bpp to distiguish between the 3 modes.
The value of .nonstd is copied to bits 16-31 of LDDFR in the LCDC and
should be set accordingly.
.nonstd must be set to 0 for RGB mode.

Due to the encoding of YUV data, the framebuffer will clear to green
instead of black.

In YUV 420 mode, panning is only possible in 2 line increments.
Additionally in YUV 420 mode the vertical resolution of the framebuffer
must be an even number.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-16 17:27:10 +09:00
Alexandre Courbot 3b0fd9d755 fbdev: sh_mobile_lcdcfb: add backlight support
Support for backlight devices controlled through board-specific
routines. Backlights can be defined per-channel and follow fbdev
directives to switch off as the LCD blanks or is turned on/off.

Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-03-10 20:20:57 +09:00
Torben Hohn ac751efa6a console: rename acquire/release_console_sem() to console_lock/unlock()
The -rt patches change the console_semaphore to console_mutex.  As a
result, a quite large chunk of the patches changes all
acquire/release_console_sem() to acquire/release_console_mutex()

This commit makes things use more neutral function names which dont make
implications about the underlying lock.

The only real change is the return value of console_trylock which is
inverted from try_acquire_console_sem()

This patch also paves the way to switching console_sem from a semaphore to
a mutex.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert]
Signed-off-by: Torben Hohn <torbenh@gmx.de>
Cc: Thomas Gleixner <tglx@tglx.de>
Cc: Greg KH <gregkh@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-01-26 10:50:06 +10:00
Paul Mundt 1928e87bcf Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
	drivers/video/sh_mobile_lcdcfb.c

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-06 18:27:34 +09:00
Magnus Damm 417d48274e fbdev: sh_mobile_lcdcfb: Enable 32 bpp and 24 bpp support
This patch extends the LCDC driver with 24 bpp
and 32 bpp support.

These modes have been kept disabled earlier due
to dependencies between the potential two LCDC
channels that are exported as two separate
framebuffer devices. The dependency boils down
to a byte swap register that is shared between
multiple channels.

With this patch applied all single channel LCDC
hardware can chose freely from 16, 24 and 32 bpp.
Dual channel LCDC must stick to the same setup
for both channels.

Without this patch only 16 bpp is fully supported.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-01-06 15:43:18 +09:00
Guennadi Liakhovetski cb59bfc590 fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080p
LCDC hardware can support 1920x1080 formats, adjust the driver to cover them.
Besides, instead of guessing some "reasonable" validity checks, only verify
values in .fb_check_var(), that we are sure, we cannot support.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-12-27 23:06:29 +09:00
Guennadi Liakhovetski e0b9fb2626 fbdev: sh-mobile: restore display size configuration
An earlier patch replaced open-coded video-mode configuration from
platform data by a call to fb_videomode_to_var(), thereby setting
ofdisplay sizes have been accidentally lost. Restore them.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-12-22 16:28:26 +09:00
Paul Mundt 7ccbefe07e Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 2010-12-22 12:56:10 +09:00
Arnd Hannemann cc267ec5df fbdev: sh_mobile_lcdcfb: fix bug in reconfig()
The function sh_mobile_fb_reconfig() contained a bug,
which caused the line_length to be set wrongly, if a mode
with a different X-resolution than the default one was chosen.
This caused 1080p24 mode to not work on AP4EVB.
Additionally the notifier chain was also called with the wrong
mode.

This patch fixes this, by using the X-resolution of the new
mode instead of the old one to calculate line length and
hands over the correct mode to the notifier chain.

Signed-off-by: Arnd Hannemann <arnd@arndnet.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-16 10:11:28 +09:00
Paul Mundt 830539d143 fbdev: sh_mobile_lcdcfb: fix up compiler warnings.
CC      drivers/video/sh_mobile_lcdcfb.o
drivers/video/sh_mobile_lcdcfb.c: In function 'sh_mobile_check_var':
drivers/video/sh_mobile_lcdcfb.c:922: warning: format '%u' expects type 'unsigned int', but argument 11 has type 'long unsigned int'

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10 17:51:44 +09:00
Guennadi Liakhovetski d2ecbab596 fbdev: sh_mobile_lcdc: increase maximum framebuffer size to support 1080p
LCDC hardware can support 1920x1080 formats, adjust the driver to cover them.
Besides, instead of guessing some "reasonable" validity checks, only verify
values in .fb_check_var(), that we are sure, we cannot support.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10 17:24:09 +09:00
Guennadi Liakhovetski 5fd284e6cd fbdev: sh_mobile_lcdc: use correct number of modes, when using the default
Fix zero mode number, when using the default 720p mode.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10 16:53:21 +09:00
Guennadi Liakhovetski 5ae0cf82df fbdev: sh_mobile_lcdc: use the standard CEA-861 720p timing
sh_mobile_lcdcfb.c has a hard-coded 720p video mode, used as default, if none
is explicitly specified by the platform. Adjust its timing to match the CEA
standard. Also add an explicit refresh rate value, which is needed, when used
with HDMI, to be able to recognise the default 720p mode as a pre-programmed
VIC #4.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-11-10 16:53:17 +09:00
Russell King b3773301c4 Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/genesis-2.6 into devel-stable
Conflicts:
	drivers/video/sh_mobile_hdmi.c
2010-10-28 20:14:38 +01:00
Guennadi Liakhovetski 6031f34738 fbdev: sh_mobile_lcdc: relax .check_var() HSYNC test
Some valid and supported video modes have .hsync_len > 120.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15 19:00:56 +09:00
Guennadi Liakhovetski c44f9f76d2 fbdev: sh_mobile_lcdc: make platform videomode table optional
Add a default 720p mode to the sh_mobile_lcdc driver to be used, when no
videomode is specified in the platform data. This can be used, e.g., with HDMI.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-15 19:00:56 +09:00
Magnus Damm 1ffbb037d8 sh: free-without-alloc fix for sh_mobile_lcdcfb
Without this fix the LCDC driver will try to free
framebuffer memory even though the allocation failed.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-10-13 19:16:44 +09:00
Guennadi Liakhovetski dd210503b7 fbdev: sh_mobile_lcdc: reconfigure the framebuffer, when free
Currently the sh_mobile_lcdc driver only reconfigures the hardware interface,
when a new monitor is plugged in. This patch adds support for dynamic
framebuffer reconfiguration, when no user is holding the framebuffer device
node open.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-16 16:36:17 +09:00
Guennadi Liakhovetski afe417c035 fbdev: sh_mobile_hdmi: support hot-plugging of different HDMI / DVI displays
With this patch hot-plugging of an HDMI or a DVI monitor can select a different
video mode and reconfigure the LCDC and HDMI controllers accordingly. Due to a
lack of a standard API to inform framebuffer users of a changed video mode, the
framebuffer configuration is preserved regardless of a specific mode, selected
for the monitor. As described in a previous patch, this leads to smaller
framebuffers being displayed on larger monitors or a part of a larger
framebuffer being displayed on a smaller resolution monitor.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:23:39 +09:00
Guennadi Liakhovetski 1c120deb60 fbdev: sh_mobile_lcdcfb: separate display variable data from framebuffer data
This is a preparation for a patch, that shall allow displaying of a smaller
framebuffer on a bigger display and of a part of a bigger framebuffer on a
smaller display.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:23:26 +09:00
Guennadi Liakhovetski 6de9edd5bd fbdev: sh_mobile_hdmi: implement locking
The SH-Mobile HDMI driver runs in several contexts: ISR, delayed work-queue,
task context, when called from the sh_mobile_lcdc framebuffer driver. This
creates ample race possibilities. Even though most these races are purely
theoretical, it is better to close them. To trace fb_info validity we install a
notification callback in the HDMI driver, and the only way for it to get to
driver internal data is by using struct sh_mobile_lcdc_chan, therefore it had
to be extracted into a separate common header.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:23:21 +09:00
Guennadi Liakhovetski 71d3b0fcad fbdev: sh_mobile_lcdcfb: allocate memory, sufficient for the biggest mode
Now, that we add support for multiple modes to the sh_mobile_lcdcfb driver, it
has to allocate memory, sufficient for the biggest of them.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:52 +09:00
Guennadi Liakhovetski baf1637499 fbdev: sh_mobile_lcdcfb: fix notifier callback return codes
Notifier callbacks have to return either one of NOTIFY_* codes or a negative
errno, converted to a suitable value by the notifier_from_errno() inline, if
the notifier chain shall not be continued.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:46 +09:00
Guennadi Liakhovetski 44432407d9 fbdev: sh_mobile_lcdcfb: Support multiple video modes in platform data
This is a preparation for HDMI hotplug support. This patch just moves all
platform defined video modes for the sh_mobile_lcdcfb driver to separate
arrays and switches all users to use element 0 of that array, so, this patch
doesn't introduce any functional changes and as such should not cause any
regressions.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:38 +09:00
Guennadi Liakhovetski 01ac25b59f fbdev: sh_mobile_lcdcfb: minor simplifications and clean up
Remove an unused variable and simplify several pointer dereferences.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:32 +09:00
Guennadi Liakhovetski 5ef6b505d9 fbdev: sh_mobile_lcdcfb: fix more error paths
This patch fixes the following two erroneous error paths:

hw_usecnt is allocated with a value of 0, therefore in an early error case,
calling sh_mobile_lcdc_clk_off() will wrongly conclude, that hw_usecnt has
already been incremented. Then sh_mobile_lcdc_runtime_suspend() will be called,
which will access uninitialised data fields and crash the kernel.

sh_mobile_lcdc_stop() can be called before framebuffer has been allocated, then
ch->info is NULL and dereferencing it will Oops too.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:25 +09:00
Guennadi Liakhovetski 14177a5e56 fbdev: sh_mobile_lcdcfb: use fb_videomode_to_var() instead of open-coding
Use the standard fb_videomode_to_var() instead of filling fb_var_screeninfo
fields manually in, also remove a redundant memset(0).

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-09-14 17:22:11 +09:00
Guennadi Liakhovetski 6011bdeaa6 fbdev: sh-mobile: HDMI support for SH-Mobile SoCs
Some SH-Mobile SoCs have an HDMI controller and a PHY, attached to one of their
LCDC interfaces. This patch adds a preliminary static support for such
controllers, this means, that only the 720p mode is handled ATM. Support for
more modes and a dynamic switching between them will be added by a follow up
patch.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-08-04 16:12:15 +09:00
Guennadi Liakhovetski c243939817 sh: add a parameter to LCDC driver's .display_on() callback
HDMI support for the sh_mobile_lcdc framebuffer driver will require a 'struct
fb_info *' pointer for its .display_on() callback. While at it fix kfr2r09
framebuffer modular build.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-08-04 16:12:11 +09:00
Guennadi Liakhovetski dba6f385b8 fbdev: sh-mobile-lcdc: fix potential Oops in SH-Mobile LCDC framebuffer driver
sh_mobile_lcdc_setup_clocks() can perform IO, therefore it has to be called
after ioremap(). Also check return code of ioremap() and use resource_size()
instead of open-coding it.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-08-04 16:03:02 +09:00
Guennadi Liakhovetski e1f42ff4f0 fbdev: fix erroneous index in drivers/video/sh_mobile_lcdcfb.c
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-05-25 12:23:22 +09:00
Guennadi Liakhovetski 8bed90557d sh: fix a number of Oopses and leaks in SH framebuffer driver
Fix a number of Oopses, memory leaks and unbalanced calls on error paths in
sh_mobile_lcdcfb.c.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-05-06 13:24:56 +09:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00