History log of /drivers/video/omap2/dss/manager.c
Revision Date Author Comments
21e56f79abad987555351c73569fc8358636b0fa 21-Feb-2012 Lajos Molnar <lajos@ti.com> OMAPDSS: MANAGER/APPLY: Add runtime_pm protection around wait_for_go/vsync functions

If DSS suspends within the functions dss_mgr_wait_for_go(),
dss_mgr_wait_for_go_ovl() or dss_mgr_wait_for_vsync(). It may lose it's clock
and lead to a register access failure.

Request runtime_pm around these functions.

[archit@ti.com: Moved runtime_pm calls to wait_for_go/vsync functions rather
then calling them from omap_dispc_wait_for_irq_interruptible_timeout()]

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
54540d41aaad0ed3245d3e99db014ab03a219c5a 13-Dec-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move simple_check functions

The functions dss_ovl_simple_check() and dss_mgr_simple_check() are not
really part of the apply mechanism, and can be moved to overlay.c and
manager.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6ac48d1e3ac788ad1d54895acd83be26cefb4fe9 08-Dec-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move check functions

The functions dss_ovl_check, dss_mgr_check_zorder, dss_mgr_check in
apply.c are not really part of the apply mechanism, and can be moved to
overlay.c and manager.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
388c4c6cbb335e69fe23c8d18bd4b0e8dd66901b 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move mgr->info to apply.c

struct omap_overlay_manager contains info and info_dirty fields, both of
which should be internal to apply.c.

This patch moves those fields into mgr_priv data, and names them
user_info and user_info_dirty.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5738b633136a41923b4ba75e6b1a160d08539c99 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: remove ovl/mgr check-code temporarily

DSS currently tries to check that the given overlay and overlay manager
settings are acceptable, but the code does not work quite properly.
Things may change between the check and the actual use of the settings.

Furthermore, the following patches will rewrite how settings are
configured and managed, and trying to keep the (broken) settings
checking working during the rewrite would be very difficult.

This patch removes the checking code, and a working version of checking
will be added back after the settings rewrite has been done.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
eb70d739adf2266e744a784a1272f1c92a257b81 14-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move mgr funcs to apply.c

apply.c will handle the management of dispc in the future patches. This
patch moves overlay manager related functions to apply.c so that they
will have access to the private data and functions of apply.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
07e327c9c18b382656bf455051759be8182627ae 05-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: store overlays in a list for each manager

Current way of handling overlay-manager links is a bit strange: each
manager has a static array, containing pointers to all the overlays
(even those used by other managers). The overlays contain a pointer to
the manager being used.

This patch makes the system a bit saner: each manager has a linked list
of overlays, and only the overlays linked to that manager are in the
list.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5617ad097959cb39b96d08af0a9b3d51215deaba 05-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: store managers in an array

Overlay managers are stored in a linked list. There's no need for this
list, as an array would do just as fine.

This patch changes the code to use an array for overlay managers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
7797c6da64852b06b585b7eca8d3f657bfc9fa47 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: hide manager's enable/disable()

omap_overlay_manager struct contains enable() and disable() functions.
However, these are only meant to be used from inside omapdss, and thus
it's bad to expose the functions.

This patch adds dss_mgr_enable() and dss_mgr_disable() functions to
apply.c, which handle enabling and disabling the output.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
58f2554807a7dc627f1583d1d4363b85758cf685 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: create apply.c

Create a new file, apply.c, and move code about handling the
apply-mechanism and configuration of the managers and overlays from
manager.c to apply.c.

Not all related code is moved in this patch, but only the core
apply/configure functions. The later patches move rest of the code from
overlay.c and manager.c, adding necessary locking at the same time.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
d2bbb9bbd1503e8b5235fe316e7ee0c7f41daf7e 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: apply affects only one overlay manager

omap_dss_mgr_apply currently applies settings to all overlays and
overlay managers. The reason for this was to support cases where
configuration changes affecting multiple managers are made. However, the
current code doesn't support changing such configurations, so the
functionality is not needed.

Change the apply to affect only the manager given as an argument, and
the overlays attached to that manager.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
209285012c792d3a0f758c7ace30af0ee4bc08a3 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: split omap_dss_mgr_apply() to smaller funcs

Split omap_dss_mgr_apply() into smaller functions for clarity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
32eaa5841021c8d812a4f62898a6e8617d648846 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: add ovl/mgr_manual_update() helpers

Add helper functions ovl_manual_update() and mgr_manual_update() which
return whether the overlay or manager is used with a manual update
display.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
c64dca40c5cf1cc61355411dcfb90949e57afdf0 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: setup manager with dispc_mgr_setup()

Change manager configuration to be similar to overlay configuration by
creating dispc_mgr_setup() which takes omap_overlay_manager_info as
parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2cc5d1af5ad0a130fa5812f99bca18e0cdadbd36 03-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: separate overlay channel from ovl_setup

Overlay channel is configured with ovl_setup, with all the other overlay
attriutes. This patch separates overlay channel setup so that we can
later configure the channel only when needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
f38545da53d98055d8b2f58fe156c86626f3427e 03-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: separate FIFO threshold setup from ovl_setup

Overlay FIFO thresholds are configured with ovl_setup, with all the
other overlay attributes. This patch separates FIFO threshold setup so
that we can later configure FIFO thresholds only when needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
3ba2a1c01546a4980e7b7742445560ae4afd1fc1 03-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: handle ilace/replication when configuring overlay

Move the configuration of interlace and replication from
omap_dss_mgr_apply() to configure_overlay(). This removes the need to
store the values into the cache data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
1cb0017813e82c740ef7b60bdaa0aa74eaab6a76 18-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: pass ovl manager to dss_start_update

dss_start_update() takes currently the dss device as a parameter. Change
the parameter to ovl manager, as that is what the dss_start_update()
actually needs. Change the name of the function to
dss_mgr_start_update() to reflect the change.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8760db5406fb7b92f900d6c98eea198695476467 03-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: remove partial update from the overlay manager

Partial update for manual update displays has never worked quite well:
* The HW has limitations on the update area, and the x and width need to
be even.
* Showing a part of a scaled overlay causes artifacts.
* Makes the management of dispc very complex

Considering the above points and the fact that partial update is not
used anywhere, this and the following patches remove the partial update
support. This will greatly simplify the following re-write of the apply
mechanism to get proper locking and additional features like fifo-merge.

This patch removes the partial update from the manager.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
714ad3ac505bba711f961bb8013644c9d8fb486a 27-Oct-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: Remove old fifomerge hacks

Once in a time omapdss had basic support for fifomerge. Fifomerge was
removed as the implementation didn't work properly, and a proper
implementation is a complex problem.

However, some unused fifo-merge related code was left behind. This patch
removes those.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11354dd58da1134ec9c96b65104e5cf2d50e1eb9 26-Sep-2011 Archit Taneja <archit@ti.com> OMAPDSS/OMAP_VOUT: Fix incorrect OMAP3-alpha compatibility setting

On OMAP3, in order to enable alpha blending for LCD and TV managers, we needed
to set LCDALPHABLENDERENABLE/TVALPHABLENDERENABLE bits in DISPC_CONFIG. On
OMAP4, alpha blending is always enabled by default, if the above bits are set,
we switch to an OMAP3 compatibility mode where the zorder values in the pipeline
attribute registers are ignored and a fixed priority is configured.

Rename the manager_info member "alpha_enabled" to "partial_alpha_enabled" for
more clarity. Introduce two dss_features FEAT_ALPHA_FIXED_ZORDER and
FEAT_ALPHA_FREE_ZORDER which represent OMAP3-alpha compatibility mode and OMAP4
alpha mode respectively. Introduce an overlay cap for ZORDER. The DSS2 user is
expected to check for the ZORDER cap, if an overlay doesn't have this cap, the
user is expected to set the parameter partial_alpha_enabled. If the overlay has
ZORDER cap, the DSS2 user can assume that alpha blending is already enabled.

Don't support OMAP3 compatibility mode for now. Trying to read/write to
alpha_blending_enabled sysfs attribute issues a warning for OMAP4 and does not
set the LCDALPHABLENDERENABLE/TVALPHABLENDERENABLE bits.

Change alpha_enabled to partial_alpha_enabled in the omap_vout driver. Use
overlay cap "OMAP_DSS_OVL_CAP_GLOBAL_ALPHA" to check if overlay supports alpha
blending or not. Replace this with checks for VIDEO1 pipeline.

Cc: linux-media@vger.kernel.org
Cc: Lajos Molnar <molnar@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Acked-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
c3d92529c3c2d7b511903d98efc1537081e62eca 14-Sep-2011 Archit Taneja <archit@ti.com> OMAPDSS: DISPC: Pass overlay params as arguments to dispc_ovl_setup()

dispc_ovl_enable_replication() and dispc_ovl_set_fifo_threshold() are currently
called in configure_overlay(). These are the only functions which cause DISPC
register writes of overlay parameters outside of dispc_ovl_setup().

Move these to dispc_ovl_setup() and pass replication, fifo_low and fifo_high
thresholds as arguments to dispc_ovl_setup() in order to be aligned with other
overlay parameters. No functional changes are made.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
a4273b7cca6fe7ee3807229ba256adb6cfaba0c3 14-Sep-2011 Archit Taneja <archit@ti.com> OMAPDSS: DISPC: Reduce the number of arguments in dispc_ovl_setup()

dispc_ovl_setup() currently takes a large number of overlay arguments, most of
these are members of the overlay_info struct. Replace these arguments by
passing a overlay_info pointer instead.

In configure_overlay(), we create an overlay_info struct called new_oi, this is
a copy of the overlay cache's overlay_info member. Update the new_oi parameters
which could have been possibly changed in configure_overlay(). Pass its pointer
pointer to dispc_ovl_setup().

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
26d9dd0dbe09e8a6d1f8c8ed90cd29b049bfa6ee 16-Aug-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: DISPC: rename manager related funcs

Rename dispc's manager related functions as follows:

- Remove prepending underscores, which were originally used to inform
that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_mgr_*
- Remove "channel" from the name, e.g. dispc_enable_channel ->
dispc_mgr_enable

The idea is to group manager related functions so that it can be deduced
from the function name that it writes to manager spesific registers.

All dispc_mgr_* functions have enum omap_channel as the first parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
f0e5caab9771173a6c7a47add4b2e5174c7f11bb 16-Aug-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: DISPC: rename overlay related funcs

Rename dispc's overlay related functions as follows:

- Remove prepending underscores, which were originally used to inform
that the clocks needs to be enabled. This meaning is no longer valid.
- Prepend the functions with dispc_ovl_*
- Remove "plane" from the name, e.g. dispc_set_plane_ba0 ->
dispc_ovl_set_ba0

The idea is to group overlay related functions so that it can be deduced
from the function name that it writes to overlay spesific registers.

All dispc_ovl_* functions have enum omap_plane as the first parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
e3a26aecc0ea5ce1c2bd567439d66a0699ea7774 15-Aug-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: string parsing cleanups

Use strtobool and kstrto* functions when parsing sysfs inputs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
4a9e78abb76a2f1ddccab7098bdf73a2f095aaa6 15-Aug-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Remove support for non-DISPC overlays

Remove support for non-DISPC overlays and overlay managers.

The support to possibly have non-DISPC overlays and managers was made to
make it possible to use CPU and/or sDMA to update RFBI or DSI command
mode displays. It is ok to remove the support, because:

- No one has used the feature.
- Display update without DISPC is very slow, so it is debatable if the
update would even be usable.
- Removal cleans up code.
- If such a feature is needed later, it is better implemented outside
omapdss driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Archit Taneja <archit@ti.com>
8fa8031c542986746ed4dfbd1eb52358bc86000b 15-Aug-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Handle manager change in apply

Currently when changing the manager of an overlay, set_manager() directly
calls dispc to set the overlay's destination.

Change this to be more in line with other overlay configurations, and
this will also remove the need to have dispc clocks enabled when calling
set_manager().

A new field is added to overlay struct, "manager_changed". This is
similar to "display_changed" field in manager struct, and is used to
inform apply that the manager has changed and thus write to the
registers is needed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
0f770b4765846846cc531f6828fb8402f92e2649 03-Aug-2011 Daniel Morsing <daniel.morsing@gmail.com> OMAP: DSS2: Don't allow moving managers away from enabled displays

If a manager is moved while attached to an enabled display, the DSS
system will be left in an inconsistent state. This will eventually cause
a kernel oops when the enabled display is disabled.

Fix this by not allowing the user to move a manager away from an enabled
display.

Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
4fbafaf371be780ed2cd73a520dfeafa1ea73e24 27-May-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Use PM runtime & HWMOD support

Use PM runtime and HWMOD support to handle enabling and disabling of DSS
modules.

Each DSS module will have get and put functions which can be used to
enable and disable that module. The functions use pm_runtime and hwmod
opt-clocks to enable the hardware.

Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
5ed8cf5b8e053832a3d0552e0a9681a3ff0325ee 21-Jun-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Fix FIFO threshold and burst size for OMAP4

The DMA FIFO threshold registers and burst size registers have changed
for OMAP4. The current code only handles OMAP2/3 case, and so the
values are a bit off for OMAP4. A summary of the differences between
OMAP2/3 and OMAP4:

Burst size:
OMAP2/3: 4 x 32 bits / 8 x 32 bits / 16 x 32 bits
OMAP4: 2 x 128 bits / 4 x 128 bits / 8 x 128 bits

Threshold size:
OMAP2/3: in bytes (8 bit units)
OMAP4: in 128bit units

This patch fixes the issue by creating two new helper functions in
dss_features: dss_feat_get_buffer_size_unit() and
dss_feat_get_burst_size_unit(). These return (in bytes) the unit size
for threshold registers and unit size for burst size register,
respectively, and are used to calculate correct values.

For the threshold size the usage is straightforward. However, the burst
size register has different multipliers for OMAP2/3 and OMAP4. This
patch solves the problem by defining the multipliers for the burst size
as 2x, 4x and 8x, which fit fine for the OMAP4 burst size definition
(i.e. burst size unit for OMAP4 is 128bits), but requires a slight twist
on OMAP2/3 by defining the burst size unit as 64bit.

As the driver in practice always uses the maximum burst size, and no use
case currently exists where we would want to use a smaller burst size,
this patch changes the driver to hardcode the burst size when
initializing DISPC. This makes the threshold configuration code somewhat
simpler.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
3c07cae2cccc4e40ff66521701a3c8eeda8726e1 21-Jun-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Add Color Phase Rotation support

Add Color Phase Rotation (CPR) support and sysfs files to enable CPR and
to set the CPR coefficient matrix.

CPR is enabled via manager?/cpr_enable file, and the coefficient matrix
is set via manager?/cpr_coef file. The values in cpr_coef are in the
following order:

RR RG RB GR GG GB BR BG BB

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
4df9d104d5bbe356b26bcf221d61f92f1948850e 20-Jun-2011 Nishant Kamat <nskamat@ti.com> OMAP: DSS: Minor cleanup in ovl and mgr cache structs

The overlay_cache_data and manager_cache_data structs include
the elements of omap_overlay_info and omap_overlay_manager_info
structs respectively. Include the structs instead of the individual
elements to reduce code.

Signed-off-by: Nishant Kamat <nskamat@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
8cff88c5da2197aa601409d4a7ce8f83f8de8190 30-Apr-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: remove update_mode from omapdss

Remove the whole update_mode stuff from omapdss driver. If automatic
update for manual update displays is needed, it's better implemented in
higher layers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
0d66cbb53eca4ab3db85d9189d5a85c9fac49b84 19-May-2011 Amber Jain <amber@ti.com> OMAP: DSS2: Add support for NV12 format

Add the support for NV12 color format.
Configure base address for UV component of NV12 color format.
Change the way chroma scaling is handled for YUV formats on OMAP4 by enabling
chroma-resampling for video pipeline and hence using FIR2 register set for
scaling UV.
Changes to _dispc_set_scaling(), because of the reason above, are:
- call _dispc_set_scaling_common() to handle scaling for all color formats
except for OMAP4 where it only handles scaling for RGB or Y-component
- call _dispc_set_scaling_uv() for special handling required for UV
component on OMAP4.
- dispc_set_scaling_uv() also resets chroma-resampling bit for RGB color modes.

Contains chroma scaling (_dispc_set_scaling_uv) design and implemented by
Lajos Molnar <molnar@ti.com>

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
f20e42205ab172cfd449c10e5183e2e371a629d6 19-May-2011 Amber Jain <amber@ti.com> OMAP: DSS2: Add new color formats for OMAP4

Add new color formats supported by OMAP4: NV12, RGBA16, RGBX16,
ARGB16_1555, XRGB16_1555.
NV12 color format is defined here, its support in DSS will be added separately.

Signed-off-by: Amber Jain <amber@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
a0b38cc4d35e095f14ab0f486135f8a619ebfc14 11-May-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAP: DSS2: Move display.h to include/video/

arch/arm/plat-omap/include/plat/display.h is an include for the OMAP DSS
driver. A more logical place for it is in include/video.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
b119601d4e226e42a067ff33116774d79dd9afbc 08-Mar-2011 Mythri P K <mythripk@ti.com> OMAP4: DSS2: Add display type HDMI to DSS2

Adding display type HDMI in dss_features, overlay and the manager so that
HDMI type of display will be recognized.

Signed-off-by: Mythri P K <mythripk@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
6af9cd1431db952a7f9f8931497c9989a48b07df 31-Jan-2011 Archit Taneja <archit@ti.com> OMAP2PLUS: DSS2: Generalize naming of PRCM related clock enums in DSS driver

enum dss_clock structure is replaced with generic names that
could be used across OMAP2420, 2430, 3xxx, 44xx platforms.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
18faa1b68a54ff976dd03bfd9ace2c4ef4f7315c 02-Dec-2010 Sumit Semwal <sumit.semwal@ti.com> OMAP: DSS2: Introduce omap_channel as an omap_dss_device parameter, add new overlay manager.

A panel connects to one of the overlay managers of DSS through some interface block.
On OMAP4, specifying the type of the display is not sufficient to conclude which manager
the panel should be connected to.
Hence, a new member 'channel' is introduced in omap_dss_device structure to determine
which manager the panel uses. The dss_recheck_connections() called in dss_driver_probe()
uses this channel parameter to set the correct manager to the corresponding omap_dss_device.

The channel parameter is used only once to ensure the correct managers are set for each
panel. The parameter dssdev->manager->id will take care of ensuring that the panel and
then the interface driver configures the correct DISPC channel.

Also, add a new Overlay Manager in manager.c, make other changes needed for LCD2 channel.

Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Mukund Mittal <mmittal@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
fd28a39071cee34ec59021f620f6dfca5f89ac9b 04-Nov-2010 Rajkumar N <rajkumar.nagarajan@ti.com> OMAP3630: DSS2: Enable Pre-Multiplied Alpha Support

Enable dss to process color formats with pre-mulitplied alpha.
With this we can have alpha values defined for each pixel
and hence can have different blending values for each pixel.
sysfs entry has been created for this and pre-multiplied alpha
support is turned off by default.

Signed-off-by: Sudeep Basavaraj <sudeep.basavaraj@ti.com>
Signed-off-by: Rajkumar N <rajkumar.nagarajan@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
a0acb5574b01f1a82dc5d863b4d89d84397aeafa 15-Sep-2010 Archit Taneja <archit@ti.com> OMAP: DSS2: Use dss_features framework on DSS2 code

Calls init functions of dss_features during dss_probe, and the following
features are made omapxxxx independent:
- number of managers, overlays
- supported color modes for each overlay
- supported displays for each manager
- global aplha, and restriction of global alpha for video1 pipeline
- The register field ranges : FIRHINC, FIRVINC, FIFOHIGHTHRESHOLD
FIFOLOWTHRESHOLD and FIFOSIZE

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
f55fdcfe88c5a23115b6d93674ad1e082e841091 03-Jun-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: adjust YUV overlay width to be even

An overlay in YUV mode has to have an even input width, because data for
each pixel is divided between two adjacent pixels.

The algorithm handling manual update overlay adjusting may adjust the
overlay width to be odd.

This patch adds a check for that situation, and makes the width even.
The width is increased by one if it is possible (the unadjusted input
width is larger than the width), and decreased by one if increasing is
not possible.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
26a8c2507a224d39003665cd6e7678520c733c04 09-Jun-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: change manual update scaling setup

Currently the update area on manual update displays is automatically
enlargened to fully cover scaled overlays. This patch makes that
optional, allowing the panel driver to choose if it's used or not.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
8cab90fdb4c71f9a92c09c015aee42ff2149b317 09-Jun-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: Fix update area calculations with multiple scaled overlays

When there are multiple scaled overlays simply checking whether the update
area intersects any of them in order is not enough. If eg. VID1 starts out
completely outside the update area but VID2 causes the update area to
increase in such a way that VID1 now falls partially within the increased
update area VID1 should be rechecked and the update area possibly
increased even further to fully encompass VID1. So simply keep looping
over the overlays until such time that none of the overlays caused the
update area to change.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
a74b260502c0911d14bafb76a20f699b6caa2e91 04-Mar-2010 Ville Syrjälä <ville.syrjala@nokia.com> OMAP: DSS2: Make wait_for_go() succeed for disabled displays

When the display is not active make the wait_for_go() functions return
immediately.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
a3bb67a75c0fe5c48def0fd39d2fe9ec043241d4 25-Apr-2010 Carlos Lopez <carlos.cruz@sasken.com> OMAP2: DSS: Add missing line for update bg color

The driver set the background color canvas but never writes it in
DISPC_DEFAULT_COLOR_m register, which changes the background color
on the LCD or TV.

This patch adds a line to call to dispc_set_default_color() which is
the function in charge to write the DISPC_DEFAULT_COLOR_m register.

Signed-off-by: Carlos Lopez <carlos.cruz@sasken.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
f49a951f8a2dacbbb145b6199297fcc3e493b90f 26-Mar-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: Make partial update width even

There are some strange problems with DSI and updates with odd widths. One
particular problem is that HS TX timeout triggers easily with updates with
odd widths.

This patch makes the updates widths even, circumventing the problem. There
should be no ill side effects with increasing the update area slightly to
make the width even.

Signed-off-by: Ville Syrjälä <ville.syrjala@nokia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> 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>
52cf25d0ab7f78eeecc59ac652ed5090f69b619e 19-Jan-2010 Emese Revfy <re.emese@gmail.com> Driver core: Constify struct sysfs_ops in struct kobj_type

Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

* prevents modification of data that is shared
(referenced) by many other structure instances
at runtime

* detects/prevents accidental (but not intentional)
modification attempts on archs that enforce
read-only kernel data at runtime

* potentially better optimized code as the compiler
can assume that the const data cannot be changed

* the compiler/linker move const data into .rodata
and therefore exclude them from false sharing

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Acked-by: David Teigland <teigland@redhat.com>
Acked-by: Matt Domsch <Matt_Domsch@dell.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
446f7bff703f5f82560afde90fb22b7a1d366bbc 11-Jan-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: move set/get_update_mode()

Move set/get_update_mode() from omap_dss_device to omap_dss_driver.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
a2faee84f6d8e35150d60514c6638d223509fa13 08-Jan-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: move enable/disable_channel to overlay manager

Move enable/disable_channel() from omap_dss_device to overlay manager.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
3f71cbe736e7e9909559fcc4463f43e4b4b348a8 08-Jan-2010 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: move wait_vsync()

Move wait_vsync() from omap_dss_device to overlay manager.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
eed07e0ed5367aede8d32758524f2dc2d252a291 07-Aug-2009 Tomi Valkeinen <tomi.valkeinen@nokia.com> OMAP: DSS2: Add more core files

Add more core files to DSS2.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>