Daniel Mack [Tue, 20 Dec 2011 09:54:32 +0000 (10:54 +0100)]
OMAP: DSS2: Support for UMSH-8173MD TFT panel
This patch adds support for Microtip Technologies' UMSH-8173MD 800x480
RGB TFT panel. Tested with an OMAP3 board.
Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
[tomi.valkeinen@ti.com: changed the panel name string] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Ricardo Neri [Sun, 27 Nov 2011 22:18:01 +0000 (16:18 -0600)]
ASoC: OMAP: HDMI: Move HDMI codec trigger function to generic HDMI driver
The function hdmi_audio_trigger is a callback used by ASoC to stop/start
HDMI audio. Also, it does not perform IP-specific configuration directly.
Hence, it should be placed in the general portion of the HDMI driver,
along with the other ASoC callbacks.
Also, make this function static.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Ricardo Neri [Sun, 27 Nov 2011 22:09:58 +0000 (16:09 -0600)]
OMAPDSS: HDMI: Create function to enable HDMI audio
In order to separate clearly IP-specific code from general DSS code,
a function for OMAP4 audio enable is created. This function is
included in the HDMI IP ops to align with the current implementation
of the DSS HDMI driver. This function is to be used by the ASoC
HDMI audio codec.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Ricardo Neri [Wed, 23 Nov 2011 02:50:50 +0000 (20:50 -0600)]
ASoC: OMAP: HDMI: Correct signature of ASoC functions
These functions require access to IP-secific data. However, it is not possible
to pass such data as a function argument as such functions have a specific
signature specified by ASoC. Instead, they will have access to the IP-specific
data by calling snd_soc_codec_get_drvdata. The codec driver data is set
at probe time.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Ricardo Neri [Wed, 23 Nov 2011 02:09:41 +0000 (20:09 -0600)]
ASoC: OMAP: HDMI: Introduce driver data for audio codec
Under the new DSS architecture for HDMI, there is a clear separation
between general DSS code and HDMI IP-specific data. Functions
that require access to the HDMI driver IP-specific data receive an
hdmi_ip_data structure. The ASoC codec require access to such
IP-specific data. Then, instead of accessing it directly, it will be
passed as codec driver data. This also helps to have a clear separation
between DSS and ASoC portions of the code.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Clock requirements for scaling in OMAP2, OMAP3 and OMAP4 are different. In
OMAP2 and OMAP3 the required clock rate is a function of pixel clock, vertical
downscale ratio and horizontal downscale ratio whereas in OMAP4 it is a
function of pixel clock and horizontal downscale ratio only. Selection of 3-tap
vs 5-tap coefficients depends on clock rate line buffer width in OMAP3 whereas
in OMAP4 it is independent of clock rate and line buffer width. In OMAP2 3-tap
for vertical and 5-tap for horizontal scaling is used. In OMAP4 5-tap is used
both for horizontal and vertical scaling for better performance. Also, the
number and width of line buffers differs in OMAP3 and OMAP4.
So, clock functions have been fined tuned for OMAP3 and support has been added
added for OMAP4. This code has been tested on OMAP2, OMAP3 and OMAP4, and
scaling issues due to clock errors have been resolved.
Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
The FIR coefficients present in kernel are being updated to new coefficients
consisting of 24 coefficient tables, with 12 each for 3 tap and 5 tap scenario,
which are chosen on the basis of DISPC up/downsampling filters M value. M is
the inverse of low pass cut off frequency of the sampling filter. For vertical
scaling 3 tap or 5 tap tables are used based on the clock rate and width of
the line buffer whereas in OMAP2 3 tap is always used. For horizontal scaling
however 5 tap tables are always used.
New coefficients and the corresponding logic have been tested on OMAP2, OMAP3
and OMAP4. Horizontal and vertical scaling worked fine except for some 3 tap
vs 5 tap issue during vertical upscaling and clock failing issues which is
acknowledged in the next patch. Vertical upscaling was found to perform better
under 5 taps. The 24 coefficient tables have been moved to another file
dispc_coefs.c for proper maintainance.
This code is written based on code written by Lajos Molnar <lajos@ti.com> in
Android Kernel for scaling. Lajos Molnar <lajos@ti.com> had fine tuned the FIR
coefficient selection process and reduced outliness and blockiness around
images when upscaling more than 2 times.
Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Rob Clark [Sat, 17 Dec 2011 19:28:52 +0000 (13:28 -0600)]
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>
Archit Taneja [Mon, 12 Dec 2011 06:17:42 +0000 (11:47 +0530)]
OMAPDSS: Panel NEC: Set omap_dss_device states correctly
The display state parameter of omap_dss_device struct is not being set correctly
in the panel driver NEC panel driver panel-nec-nl8048hl11-01b.c. Set the correct
states in the panel's enable/disable/suspend/resume functions.
CC: Erik Gilling <konkers@android.com> Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Archit Taneja [Mon, 12 Dec 2011 06:17:41 +0000 (11:47 +0530)]
OMAPDSS: DSI: Fix HSDIV related PLL info in dsi_dump_clocks()
The clock names of DSI_PLL_HSDIV_DISPC and DSI_PLL_HSDIV_DSI was made
dynamic based on the current value of DISPC and DSI FCLK sources. This
doesn't need to be done since we are just interested in the clock names,
and not the current clock sources for DISPC and DSI FCLKs.
Use only the generic and omap specific names for the DSI PLL's HSDIV
clocks.
Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Tue, 13 Dec 2011 11:18:52 +0000 (13:18 +0200)]
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>
Rob Clark [Sun, 11 Dec 2011 20:02:27 +0000 (14:02 -0600)]
OMAPDSS: fix potential NULL pointer ref in OCP_ERR handling path
The dispc's error handler tries to disable all outputs when OCP_ERR
happens. However, the code doesn't check if there actually is a display
on each particular output, nor if there's a driver for the display. This
may lead to NULL pointer reference.
Signed-off-by: Rob Clark <rob@ti.com>
[tomi.valkeinen@ti.com: added patch description] Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Axel Lin [Fri, 9 Dec 2011 01:59:56 +0000 (09:59 +0800)]
video: omap: convert drivers/video/omap/* to use module_platform_driver()
This patch converts the drivers in drivers/video/omap/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.
Cc: Jonathan McDowell <noodles@earth.li> Cc: Cory Maccarrone <darkstar6262@gmail.com> Cc: Laurent Gonzalez <palmte.linux@free.fr> Cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 8 Dec 2011 08:32:37 +0000 (10:32 +0200)]
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>
Tomi Valkeinen [Sat, 26 Nov 2011 12:39:16 +0000 (14:39 +0200)]
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>
Tomi Valkeinen [Sat, 26 Nov 2011 12:36:19 +0000 (14:36 +0200)]
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>
Tomi Valkeinen [Sat, 26 Nov 2011 12:26:46 +0000 (14:26 +0200)]
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>
Tomi Valkeinen [Fri, 25 Nov 2011 15:32:20 +0000 (17:32 +0200)]
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>
Tomi Valkeinen [Fri, 25 Nov 2011 15:27:45 +0000 (17:27 +0200)]
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>
Tomi Valkeinen [Fri, 25 Nov 2011 15:26:13 +0000 (17:26 +0200)]
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>
Tomi Valkeinen [Fri, 25 Nov 2011 15:22:53 +0000 (17:22 +0200)]
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>
Tomi Valkeinen [Thu, 17 Nov 2011 15:35:28 +0000 (17:35 +0200)]
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>
Tomi Valkeinen [Thu, 17 Nov 2011 12:31:09 +0000 (14:31 +0200)]
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>
Tomi Valkeinen [Thu, 17 Nov 2011 12:26:48 +0000 (14:26 +0200)]
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>
Tomi Valkeinen [Wed, 16 Nov 2011 14:53:44 +0000 (16:53 +0200)]
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>
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>
Tomi Valkeinen [Wed, 16 Nov 2011 14:01:33 +0000 (16:01 +0200)]
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>
Tomi Valkeinen [Wed, 16 Nov 2011 13:25:53 +0000 (15:25 +0200)]
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>
Tomi Valkeinen [Wed, 16 Nov 2011 12:28:12 +0000 (14:28 +0200)]
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>
Tomi Valkeinen [Wed, 16 Nov 2011 12:17:54 +0000 (14:17 +0200)]
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>
Tomi Valkeinen [Fri, 18 Nov 2011 13:43:29 +0000 (15:43 +0200)]
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>
Tomi Valkeinen [Fri, 18 Nov 2011 13:39:52 +0000 (15:39 +0200)]
OMAPDSS: DISPC: add dispc_mgr_get_framedone_irq
Add dispc_mgr_get_framedone_irq() which returns the irq number for
FRAMEDONE for the given channel.
Note that the function returns always 0 for DIGIT channel, even if OMAP4
does have FRAMEDONE_TV interrupt. The reason for this is that this
function is currently used only to track manual updates, and thus
FRAMEDONE_TV is not needed.
If there's need in the future to also get the FRAMEDONE_TV this needs
revisiting. However, as FRAMEDONE_TV doesn't exist on OMAP2/3, the use
of this function for that purpose needs some extra code to handle the
OMAP2/3 case.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Tue, 15 Nov 2011 16:25:23 +0000 (18:25 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 14:37:53 +0000 (16:37 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 13:04:25 +0000 (15:04 +0200)]
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>
Tomi Valkeinen [Wed, 9 Nov 2011 13:30:11 +0000 (15:30 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 12:32:57 +0000 (14:32 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 12:28:48 +0000 (14:28 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 11:37:33 +0000 (13:37 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 10:15:18 +0000 (12:15 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 10:11:11 +0000 (12:11 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 10:04:10 +0000 (12:04 +0200)]
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>
Tomi Valkeinen [Tue, 15 Nov 2011 09:47:39 +0000 (11:47 +0200)]
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>
Tomi Valkeinen [Sat, 5 Nov 2011 08:59:59 +0000 (10:59 +0200)]
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>
Tomi Valkeinen [Tue, 1 Nov 2011 11:58:50 +0000 (13:58 +0200)]
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>
Tomi Valkeinen [Mon, 7 Nov 2011 13:04:01 +0000 (15:04 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 07:35:59 +0000 (09:35 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 08:30:47 +0000 (10:30 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 08:22:46 +0000 (10:22 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 07:48:54 +0000 (09:48 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 07:23:10 +0000 (09:23 +0200)]
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>
Tomi Valkeinen [Fri, 4 Nov 2011 11:00:10 +0000 (13:00 +0200)]
OMAPDSS: remove unneeded dss_ovl_wait_for_go()
There's an unnecessary wrapper function, dss_ovl_wait_for_go(), which
does nothing else than call dss_mgr_wait_for_go_ovl(). The
dss_ovl_wait_for_go() function can be removed.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 3 Nov 2011 15:03:44 +0000 (17:03 +0200)]
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>
Tomi Valkeinen [Thu, 3 Nov 2011 15:00:07 +0000 (17:00 +0200)]
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>
Tomi Valkeinen [Thu, 3 Nov 2011 14:52:06 +0000 (16:52 +0200)]
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>
Tomi Valkeinen [Thu, 3 Nov 2011 14:08:27 +0000 (16:08 +0200)]
OMAPDSS: DISPC: handle 0 out_width/out_height in ovl_setup()
Overlay out_width/height are set to 0 when scaling is not used by the
users of omapdss. Currently ovl_setup() expects the caller of
ovl_setup() to convert those zero values to width or height.
This patch makes ovl_setup() accept zero values for out_width/height,
making calling ovl_setup() a bit simpler as the overlay_info can be
just passed to this function without modifications.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Fri, 18 Nov 2011 09:14:01 +0000 (11:14 +0200)]
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>
Tomi Valkeinen [Thu, 3 Nov 2011 14:45:07 +0000 (16:45 +0200)]
OMAPDSS: remove partial update from panel-taal
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 panel-taal.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 3 Nov 2011 14:34:20 +0000 (16:34 +0200)]
OMAPDSS: remove partial update from DSI
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 dsi.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 3 Nov 2011 14:17:37 +0000 (16:17 +0200)]
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>
Tomi Valkeinen [Thu, 27 Oct 2011 10:11:31 +0000 (13:11 +0300)]
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>
Tomi Valkeinen [Thu, 13 Oct 2011 16:06:49 +0000 (19:06 +0300)]
OMAPDSS: DSI: improve wait_for_bit_change
We sometimes get timeout when disabling the DSI interface with video
mode. It looks like the disable will stall until the current frame has
been finished, and this can take multiple milliseconds.
wait_for_bit_change() currently uses a busyloop to wait for a bit to
change. This is used in multiple places. The problem is, we don't have
clear understanding how long particular operations can take, so the
function needs to support longer waits.
Improve wait_for_bit_change() to first busy loop for 100 times to see if
the bit changes almost right away. If the bit hasn't changed, move to a
loop with a sleep of 1ms, and poll for 500ms.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 13 Oct 2011 13:12:29 +0000 (16:12 +0300)]
OMAPDSS: DSI: remove dsi_get_num_lanes_used
There's no longer need for the dsi_get_num_lanes_used function, so it
can be removed. The lane check in dsi_init_display() can be removed as
the validity of the config will be verified when parsing it.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tomi Valkeinen [Thu, 13 Oct 2011 08:22:06 +0000 (11:22 +0300)]
OMAPDSS: DSI: Parse lane config
Parse the lane configuration from the device data into internal lane
config format. This will be used in the following patches to clean up
the lane handling.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>