1
0
Fork 0
Commit Graph

20 Commits (974d250be2c70c7bf899275b23b241685d4ed7f8)

Author SHA1 Message Date
Laurent Pinchart 974d250be2 fbdev: sh_mobile_meram: Use genalloc to manage MERAM allocation
Instead of requiring the users to hardcode MERAM allocation in platform
data, allocate blocks at runtime using genalloc.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:10 +01:00
Laurent Pinchart 7554340c7a fbdev: sh_mobile_meram: Divide the code into sections
And rename a couple of constants to make prefixes more uniform.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:10 +01:00
Laurent Pinchart 762f7cc94b fbdev: sh_mobile_meram: Don't inline everything
Let the compiler decide which complex functions to inline, and constify
constant static arrays.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:10 +01:00
Laurent Pinchart 2a618e0333 fbdev: sh_mobile_meram: Add struct sh_mobile_meram_icb
The new structure stores ICB parameters for ICBs.

Instead of modifying the struct sh_mobile_meram_cfg instances passed by
callers, store the ICB parameters internally and make the public API
take const pointers to sh_mobile_meram_cfg.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:09 +01:00
Laurent Pinchart eb4f2304ba fbdev: sh_mobile_meram: Make current_reg field store the current reg set
Make sure current_reg == 0/1 always mean register set A/B through all
the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:09 +01:00
Laurent Pinchart 05432837ae fbdev: sh_mobile_meram: Make variables unsigned where applicable
Many variables, such as loop counters, sizes and offsets, should be
unsigned integers. Make them so.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:08 +01:00
Laurent Pinchart d272f428fa fbdev: sh_mobile_meram: Add _cfg suffix to struct sh_mobile_meram_icb
The structure describe ICB configuration, no ICB objects themselves.
Rename it to sh_mobile_meram_icb_cfg in preparation for the addition of
an ICB structure.

All the structure fields are unsigned integers, make them so.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:08 +01:00
Laurent Pinchart e1d1144eb9 fbdev: sh_mobile_meram: Request memory regions for memory resources
Make sure the registers and MERAM spaces are reserved before using them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2012-03-12 22:41:07 +01:00
Axel Lin 4277f2c466 video: convert drivers/video/* to use module_platform_driver()
This patch converts the drivers in drivers/video/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Ben Dooks <ben@simtec.co.uk>
Cc: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wan ZongShun <mcuos.com@gmail.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Acked-by: Alexey Charkov <alchark@gmail.com>
Acked-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-12-03 22:08:42 +00:00
Laurent Pinchart da6cf5125f sh_mobile_meram: Reset ICBs at unregistration time
When ICBs are unregistered and later reused they need to be reset to
avoid data corruption. Set the WBF, WF and RF bits to make sure ICBs get
reset properly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
2011-09-05 16:37:13 +00:00
Laurent Pinchart 8a20974f03 fbdev: sh_mobile_meram: Remove unneeded sh_mobile_meram.h
The drivers/video/sh_mobile_meram.h header contains unused definitions
and declarations. Move the only used macro to sh_mobile_meram.c, and
remove the header.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 08:22:45 +02:00
Laurent Pinchart d86d29df57 fbdev: sh_mobile_meram: Fix MExxCTL register save on runtime PM suspend
To reset the ICB on resume the MExxCTL register needs to be OR'ed with
MExxCTL_WBF | MExxCTL_WF | MExxCTL_RF, no set to that value. Fix this.

This fixes corruption at the bottom of the display when resuming from
runtime PM.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 08:22:44 +02:00
Laurent Pinchart 7963e21e50 fbdev: sh_mobile_meram: Validate ICB configuration outside mutex
Validate as much of the requested ICB configuration as possible outside
of the mutex-protected region when registering ICBs.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2011-08-19 08:22:43 +02:00
Laurent Pinchart f0a260fef6 fbdev: sh_mobile_meram: 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:42 +02:00
Damian Hobson-Garcia 0b3bb77c3a fbdev: sh_mobile_meram: Backup/restore device registers on shutdown/resume
Save and reconfigure the MERAM registers when the MERAM is powered down
and restored

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
2011-08-19 08:11:18 +02:00
Damian Hobson-Garcia 0aa492be88 fbdev: sh_mobile_meram: Move private data from .h to .c
There is no reason for sh_mobile_meram_priv to be in the .h file
since it should be private to sh_mobile_meram.c

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
2011-08-19 08:11:16 +02:00
Damian Hobson-Garcia 176737782e fbdev: sh_mobile_meram: Enable runtime PM
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
2011-08-19 08:11:11 +02:00
Damian Hobson-Garcia 06c8a6a3e4 fbdev: sh_mobile_meram: Correct pointer check for YCbCr chroma plane
The check was intended to test if we have a valid pointer to write into,
but it mistakenly checks the pointer contents instead.

Since a valid pointer is mandatory for the chroma data if a YCbCr format
is used, the pointer check has been removed.

Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2011-06-24 16:40:28 +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