History log of /drivers/video/omap2/dss/apply.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f33f0eaff50112270a9e629569729ce5d5d620fa 15-May-2012 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: use DSI_FIFO_BUG workaround only for manual update displays

commit 3568f2a46f2a73bab18c914df06afd98a97e0e0e upstream.

There is a problem related to DSS FIFO thresholds and power management
on OMAP3. It seems that when the full PM hits in, we get underflows. The
core reason is unknown, but after experiments it looks like only
particular FIFO thresholds work correctly.

This bug is related to an earlier patch, which added special FIFO
threshold configuration for OMAP3, because DSI command mode output
didn't work with the normal threshold configuration.

However, as the above work-around worked fine for other output types
also, we currently always configure thresholds in this special way on
OMAP3. In theory there should be negligible difference with this special
way and the standard way. The first paragraph explains what happens in
practice.

This patch changes the driver to use the special threshold configuration
only when the output is a manual update display on OMAP3. This does
include RFBI displays also, and although it hasn't been tested (no
boards using RFBI) I suspect the similar behaviour is present there
also, as the DISPC side should work similarly for DSI command mode and
RFBI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Joe Woodward <jw@terrafix.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/drivers/video/omap2/dss/apply.c
df01d53068bdf31609aafd9a857901a1f16dfa52 07-Mar-2012 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: fix clearing shadow dirty flag with manual update

Currently the shadow-dirty flags for manual update displays is cleared
in the apply_irq_handler when an update has finished. This is not
correct, as the shadow registers are taken into use (i.e. after that
they are not dirty) when the update is started.

Move the mgr_clear_shadow_dirty() call from apply_irq_handler to
dss_mgr_start_update() to fix this.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
4614679c9d3b77e87b390b6afe8a8dfc980f4387 22-Feb-2012 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: print warning if wait_pending_extra_info_updates fails

wait_pending_extra_info_updates() currently does a hacky second check
for extra_info_update_ongoing() at the end of the function to show a
warning if extra_info update is still ongoing. The call to
extra_info_update_ongoing() should really be inside spinlock, but that's
a bit heavy just for verification.

Rather than that, check the return value of the
wait_for_completion_timeout() and print an error if it has timeouted or
returned an error.

Even better would be to return the error value and act on it in the
callers of wait_pending_extra_info_updates. However, it's not clear what
the callers should do in case of an error, as the error should only
happen if there's a bug in the driver or the HW. So we'll just print the
warning for now.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
83fa2f2e940dc21a204cff697d84d37214a91708 13-Jan-2012 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: DISPC: move fifo threhold calc to dispc.c

Move fifo threshold calculation into dispc.c, as the thresholds are
really dispc internal thing.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
1d71f42b35ed66d90a9a39bc515bb16cfe2d4a46 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add fifo-merge support

Add fifo-merge support. This is done mainly in four functions:
mgr_enable/disable and ovl_enable/disable. These are the functions where
overlays are taken into and out of active use.

The process to enable and disable fifo-merge is not simple. We need to
do it in steps, waiting in between for certain settings to be taken into
use, and continuing after that. The reason for this is that fifo-merge
is a common thing for all managers/overlays, and its use must be
synchronized.

As an example, when we disable an overlay, we first set the overlay as
disabled, then wait until the overlay is actually disabled in the HW,
and only after that we may re-configure the fifos, possibly taking
fifo-merge into use.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
fb0119742291b6f30cd97026ee137b2d3d1f4de8 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add fifo merge support funcs

Add mechanism to set/unset the DISPC fifo-merge:

Add new fields to dss_data, fifo_merge and fifo_merge_dirty. These are
similar to the other info/dirty flags in ovl_priv_data and ovl_mgr_data,
but fifo merge is a common attribute to all managers and thus outside
the ovl_mgr_data.

The fifo-merge field is used in the dss_write_regs_common, which handles
writing the register.

dss_apply_fifo_merge() can be used to set/unset the fifo merge field in
the dss_data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
1f3f53ae5179ba7f24b4a429bc41773f1f4857ca 17-Dec-2011 Rob Clark <rob@ti.com> OMAPDSS: APPLY: fix NULL pointer deref when mgr is not set

extra_info_update_ongoing() goes through all overlays, but doesn't check
if the overlay is connected to a manager. This leads to a crash whenever
an overlay has been detached.

Add a check to skip the non-connected overlays.

Reported-by: Rob Clark <rob@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
5af661ce1a8c7672364c2c911b76186589db0f0e 08-Dec-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: remove unused variables

dss_mgr_check_zorder() has two unused variables. Remove them.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
04576d415e01aa08752bf3884db9862cfbba9115 26-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: write fifo thresholds only if changed

Current code will always write fifo threshold values to the register,
even if they are the same as previously. Separate the setting of fifo
fields into a separate function, and only set new values if they are
different than the old ones.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
75ae118a0028810f93a746c25f4bb018fb044323 26-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add dss_setup_fifos

Currently fifo threshold configuration is done per overlay or per
manager. However, when a fifo size configuration is added, we need to
always configure the thresholds for all overlays.

This patch prepares for that by changing the fifo threshold
configuration to always handle all overlays.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
a6b24f83601530f69ee36ac48527336e3c79bea8 26-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: simplify dss_mgr_enable

dss_mgr_enable() has some extra assigns to mp->enabled, which can be
removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
82153eda076ee4df434bb1008f24e46590f76dfc 26-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add op->enabling

When we are enabling an overlay, there's a point in time when the
overlay is not actually enabled yet (nor do we want it to be enabled),
but we do want to check if the configuration for the overlay is valid,
and to calculate correct fifo thresholds for the soon-to-be-enabled
overlay.

Current code handled this in a hacky way, setting op->enabled to true
temporarily when calling functions that need to consider the state when
the overlay is enabled.

This patch makes this a bit cleaner, adding "enabling" field, which is
set when the overlay is not yet enabled but should be considered in the
checks and calculations.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
153b6e7357778267e6914f2370a059e79a751371 25-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: cleanup extra_info_update_ongoing

Trivial cleanup for extra_info_update_ongoing(), making the function a
bit cleaner.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
3ab15b2aa70369e0360f12e35e47bca1a269138b 25-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add dss_set_go_bits()

Currently dss_write_regs() implicitely sets the GO bits for all managers
with shadow dirty flags set. This is a bit misleading, as one does not
presume "write registers" function to also set the GO bit.

Thus this patch splits the setting of GO bits into a separate function,
dss_set_go_bits, which is used after writing the registers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
5b2141719aa8a14ebd242c60b4ce6a580276f7cd 25-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: clear shadow dirty flags only if GO had been set

In the apply irq handler the code currently clears the shadow dirty
flags whenever the manager in question is not busy (i.e. GO bit is
down). However, this is not quite right, as the GO bit may have never
been set.

While not done in the current code, the above would cause bug in
scenario where the registers are written, and thus shadow_dirty flag is
set, but the GO bit will be set only later. In this case the
shadow_dirty flags would be cleared, even if the HW is not using the new
configurations.

This patch fixes the issue by clearing the shadow flags only when the GO
bit is clear, and the GO bit had been set.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
9f808956d3cd07c8dc69e213931b19bad56344fb 25-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: fix need_isr

need_isr() should return true whenever there's work that needs to be
handled in the VSYNC/FRAMEDONE irq handler. However, need_isr() is
missing some cases where we need the irq handler.

This patch adds checks for shadow dirty flags, so that the irq handler
is started/kept running while shadow dirty flags are set.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
cc372d84e231ea9f574ef5de9a7ab39dee5a021d 25-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: fix extra_info_update_ongoing

extra_info_update_ongoing() skipped checks for overlays that were marked
as disabled. This doesn't work, as the enable status of an overlay is in
the extra_info group, and thus extra_info_update_ongoing() reports false
when we are disabling an overlay. This causes
wait_pending_extra_info_updates() to not wait for the ongoing overlay
disable.

This patch changes extra_info_update_ongoing() to check the state of
overlays marked as disabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
2a4ee7ee685f3bf996461ed0d148857ce85a00e2 21-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add return value to dss_mgr_enable()

Now that dss_mgr_enable() can fail due to checks, make it return the
error value.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
39518356ccd6e439abae24e1a24d84dcd12ff207 17-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add checking of ovls/mgrs settings

Add checks for overlay and manager settings. The checks are a bit
complex, as we need to observe the bigger picture instead of overlays
and managers independently. Things like the used display and the zorder
of other overlays affect the validity of the settings.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
f17d04fbbb201c05700359e94e2747c210f99852 17-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add dss_mgr_simple_check()

Add dss_mgr_simple_check() which is used to check the validity of
certain manager attributes. Only attributes that can be checked
independently, without knowing the display being used, is done here
(thus "simple").

We can use this function in dss_mgr_set_info().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
fcc764dca80ead39b7391ff2c67a6b78de16d7a9 17-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add dss_ovl_simple_check()

Add dss_ovl_simple_check() which is used to check the validity of
certain overlay attributes. Only attributes that can be checked
independently, without knowing the display being used, is done here
(thus "simple").

We can use this function in dss_ovl_set_info().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
e70f98acaa84ec9ad55e544d0dc8b2d0a36bbeca 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: remove runtime_get

apply.c no longer touches any registers if an output is not enabled.
This means that we don't need to do dispc_runtime_get() anymore, and the
calls can be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
f1577ce18004337ec2f6f48109ca14cac10a0a4f 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add wait_pending_extra_info_updates()

Add wait_pending_extra_info_updates() function which can be used to wait
until any extra_info changes have been taken into use by the hardware.
This can be only called when holding the apply mutex, so that other
threads cannot insert new extra_info changes.

This will be used to handle fifo-configurations.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
e4f7ad702ef271d2b0c03e9904b05f9bcbf0808b 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: skip enable/disable if already enabled/disabled

Add checks to dss_mgr_enable, dss_mgr_disable, dss_ovl_enable,
dss_ovl_disable that check if the state is already the same as given in
the parameters, and exit if so.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
841c09c7975c67fe7741564d98265de28a5764d0 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add dss_apply_ovl_enable()

Add a helper function dss_apply_ovl_enable(), which is similar to the
main apply() function: dss_apply_ovl_enable() applies the given overlay
enable-status to ovl_priv_data, and sets the dirty flag.

The difference between the helper function and the previous direct use
of the fields is that the helper function will not do anything if the
enable state is already the same as given in the parameter.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
ff4733dcf56480bebcd3801adde27213b893635d 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: remove device_changed field

omap_overlay_manager contains device_changed field, which no longer has
any use. So remove the field and the few places where it is touched.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
0b53f17971700f673492e2e91b5069893e5f2d0b 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rename dirty & shadow_dirty

Rename ovl_priv_data's and mgr_priv_data's dirty and shadow_dirty fields
to info_dirty and shadow_info_dirty to better reflect what they mean.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
6dc802e2901d33e02efad3c90bb2034fd20c79e7 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move fifo thresholds to extra_info set

Setting overlay's fifo thresholds is currently handled at the same time
as other overlay attributes. This is not right, as the normal attributes
should only affect one overlay and manager, but changing the fifo
thresholds are needed in cases like fifo-merge, where multiple managers
are affected.

This patch moves the channel field into the "extra_info" set, handled
together with channel and enabled-status.

This also lets us to calculate the fifos only when needed, specifically,
when an overlay or a manager is enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
5d5a97a6fbf98f82ae50c837eba3ebcfea0902f8 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move channel-field to extra_info set

Setting overlay's output channel is currently handled at the same time
as other overlay attributes. This is not right, as the normal attributes
should only affect one overlay and manager, but changing the channel
affects two managers.

This patch moves the channel field into the "extra_info" set, handled
together with enabled-status.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
c1a9febfafa2a9a9ac09b2de4c80aa96b41a03d1 16-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move ovl->info to apply.c

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

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

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
7609893c637b422eec88b57d204f02d8798cfc65 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: clean up isr_handler

Add a helper function mgr_clear_shadow_dirty(), which clears the
shadow_dirty flags for the given manager and for the overlays on that
manager.

This lets us simplify the code in the dss_apply_irq_handler().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
34861378a54e3fcac0eb87317ded2554b087494e 18-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add updating flag

Add "updating" flag to mgr_priv_data, which is used to track whether the
manager is currently actively working, i.e. updating the screen.

For auto-update displays updating is always true when the display is
enabled, but for manual update displays the flag is true only during
frame transfers.

The flag is used to manage registers properly, for example when updating
is false and a register for a manager is written, there's no need to set
shadow_dirty flag nor set the GO bit, as the settings will be taken into
use by the HW automatically when the output is enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
75c949653fdf77a17753ffb8462a3c458c476271 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rewrite register writing

The functions writing to the DISPC registers in apply.c are more complex
than needed. This patch cleans things up.

Two helper functions are added: need_isr(), which returns if an isr for
VSYNC is needed, and need_go(), which tells if there has been a write to
the shadow registers and we need to set the GO bit.

The functions that call the actual dispc write functions will set the
dirty and shadow_dirty flags themselves, instead of that being done on
the caller side. The writing functions also check if the dirty flag is
even set, and return immediately if not.

This allows us to clean up dss_write_regs().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
aaa874a985158383c4b394c687c716ef26288741 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rewrite overlay enable/disable

Overlays are currently enabled and disabled with a boolean in the struct
omap_overlay_info. The overlay info is set with ovl->set_overlay_info(),
and made into use with mgr->apply().

This doesn't work properly, as the enable/disable status may affect also
other overlays, for example when using fifo-merge. Thus the enabling and
disabling of the overlay needs to be done outside the normal overlay
configuration.

This patch achieves that by doing the following things:

1) Add function pointers to struct omap_overlay: enable(), disable() and
is_enabled(). These are used to do the obvious. The functions may block.

2) Move the "enabled" field from struct omap_overlay to ovl_priv_data.

3) Add a new route for settings to be applied to the HW, called
"extra_info". The status of the normal info and extra_info are tracked
separately.

The point here is to allow the normal info to be changed and
applied in non-blocking matter, whereas the extra_info can only be
changed when holding the mutex. This makes it possible to, for example,
set the overlay enable flag, apply it, and wait until the HW has taken
the flag into use.

This is not possible if the enable flag would be in the normal info, as
a new value for the flag could be set at any time from the users of
omapdss.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
43a972d96b6ea2b9e3d6b55b9724c9f61d802c68 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add busy field to mgr_priv_data

Add a new field to mgr_priv data, "busy", which is used to track the
status of GO bit with the manager. As manual update displays never use
the GO bit, the field is always false for managers used for manual
update displays.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
bf213523fe9708572a0b0a9149f7196a4f058564 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move mgr->enabled to mgr_priv_data

struct omap_overlay_manager contains "enabled"-field, used to track if
the manager is enabled or not. This field should be internal to apply.c.

This patch moves the field to mgr_priv_data, and applies the necessary
locking when accessing the field.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
9a147a65de1ac89e506ef90413f41ebd96e03fd3 09-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: DSI: call mgr_enable/disable for cmd mode displays

The current code uses dsi_video_mode_enable/disable functions to
enable/disable DISPC output for video mode displays. For command mode
displays we have no notion in the DISPC side of whether the panel is
enabled, except when a dss_mgr_start_update() call is made.

However, to properly maintain the DISPC state in apply.c, we need to
know if a manager used for a manual update display is currently in use.

This patch achieves that by changing dsi_video_mode_enable/disable to
dsi_enable/disable_video_output, which is called by both video and
command mode displays. For video mode displays it starts the actual
pixel stream, as it did before. For command mode displays it doesn't do
anything else than mark that the manager is currently in use.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
e0a2aa5b3d1a26969ba906447c816d44c018969d 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add missing uses of spinlock

The functions in apply.c, called mostly via function pointers in overlay
and overlay_manager structs, will be divided into two groups. The other
group will not sleep and can be called from interrupts, and the other
group may sleep.

The idea is that the non-sleeping functions may only change certain
settings in overlays and managers, and those settings may only affect
the particular overlay/manager. For example, set the base address of the
overlay.

The blocking functions, however, will handle more complex configuration
changes. For example, when an overlay is enabled and fifo-merge feature
is used, we need to do the enable in multiple steps, waiting in between,
and the change affects multiple overlays and managers.

apply.c already contains a spinlock, which has been used to protect
(badly) the dss_data. This patch adds locks/unlocks of the spinlock to
the missing places, and the lock should now properly protect dss_data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
5558db3fdd52e3928d5eaabe363e1576dc5fe473 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: add mutex

The functions in apply.c, called mostly via function pointers in overlay
and overlay_manager structs, will be divided into two groups. The first
group will not sleep and can be called from interrupts, and the second
group may sleep.

The idea is that the non-sleeping functions may only change certain
settings in overlays and managers, and those settings may only affect
the particular overlay/manager. For example, set the base address of the
overlay.

The blocking functions, however, will handle more complex configuration
changes. For example, when an overlay is enabled and fifo-merge feature
is used, we need to do the enable in multiple steps, waiting in between,
and the change affects multiple overlays and managers.

This patch adds the mutex which is used in the blocking functions to
have exclusive access to overlays and overlay managers.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
f77b30700e5c0a6b5220b3a964bf6c40d5e71416 14-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move ovl funcs to apply.c

apply.c will handle the management of dispc in the future patches. This
patch moves overlay 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>
/drivers/video/omap2/dss/apply.c
d09c7aa8989caf44e8754e8aa81ce80217a0e98a 14-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rename dss_cache to dss_data

dss_cache struct contains private data used to manage dispc. "cache" is
not a good word for it, so rename it to dss_data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
063fd701abba3b58c36b6043d5feacf0fdc76cbd 14-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: move spinlock outside the struct

dss_cache struct contains a spinlock used to protect the struct. A more
logical place for the spinlock is outside the struct that it is
protecting. So move it there.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
af3d64b2c674bc6246bb04654b484f34287fbbc3 14-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rename manager_cache_data

manager_cache_data is not a suitable name for the struct. It is more of
a private data for the manager.

Rename the struct to mgr_priv_data, and add a function,
get_mgr_priv(mgr), to get a pointer to the data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
c10c6f042b6a5940c522a334a716d57b40f7dec9 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: rename overlay_cache_data

overlay_cache_data is not a suitable name for the struct. It is more of
a private data for the overlay.

Rename the struct to ovl_priv_data, and add a function,
get_ovl_priv(ovl), to get a pointer to the data.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
f6a5e0871f22428a7c74c07ddd791197c5f5d38f 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: configure_* funcs take ovl/manager as args

Make configure_overlay() and configure_manager() take overlay/manager
pointer as an argument, instead of the ovl/mgr id. This will be useful
with the future patches.

Also rename the functions to be a bit more informative:
dss_ovl_write_regs, dss_mgr_write_regs, dss_write_regs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
bc1a95181f7069920c13fcef0159ffa7d61160f1 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: use dispc_mgr_get_vsync_irq()

Use dispc_mgr_get_vsync_irq() to get the interrupt numbers for vsync,
instead of hardcoding the values depending on the display type.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
dbce0160af31d2ea323656c201d8debf5af789bf 15-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: separate vsync isr register/unregister

Create separate functions for the vsync isr register/unregister code for
cleaner code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
6e53ca9dda65dd300ce150822832ba6e169643c7 01-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: cleanup dss_mgr_start_update

dss_mgr_start_update() has a loop, of which sole purpose is to find the
manager used for this update. The whole loop is extra, as we already
know the manager.

Remove the loop.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
04f6643a8657bd080344d2928dde917e0b1b3800 07-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: skip isr register and config for disabled displays

There's no need to register the vsync ISR and configure the hardware if
the overlay manager is disabled, so this patch adds a check for disabled
managers to the omap_dss_mgr_apply() function.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
18135eadac6f0fd1bf61b7af24f14e7174155e6d 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: skip isr register and config for manual update displays

The mechanism to cache manager and overlay settings and configure them
into the HW registers in VSYNC is meant only for auto-update displays,
as it doesn't make sense (and doesn't work) for manual-update displays.

This patchs adds a check so that we skip the above for manual update
displays.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
be729178f0e0f31ab14b42b3fe5d6b4463fbeb3a 04-Nov-2011 Tomi Valkeinen <tomi.valkeinen@ti.com> OMAPDSS: APPLY: track whether a manager is enabled

Add "enabled" field to struct omap_overlay_manager, which tells if the
output is enabled or not. This will be used in apply.c in the following
patches.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c
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>
/drivers/video/omap2/dss/apply.c