platform/kernel/linux-arm64.git
11 years agoOMAPDSS: Remove dss_debug variable
Chandrabhanu Mahapatra [Sat, 29 Sep 2012 08:27:31 +0000 (13:57 +0530)]
OMAPDSS: Remove dss_debug variable

All the debug prints have been replaced with pr_debug(). Thus, the dependency on
dss_debug variable is replaced with dyndbg in dynamic debugging mode and DEBUG
flag otherwise. So, the dss_debug variable is removed along with checks for
DEBUG flag.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Reviewed-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Replace multi part debug prints with pr_debug
Chandrabhanu Mahapatra [Sat, 29 Sep 2012 07:03:05 +0000 (12:33 +0530)]
OMAPDSS: Replace multi part debug prints with pr_debug

The various functions in dispc and dsi such as print_irq_status(),
print_irq_status_vc(), print_irq_status_cio() and _dsi_print_reset_status()
consist of a number of debug prints which need to be enabled all at once or none
at all. So, these debug prints in corresponding functions are replaced with one
dynamic debug enabled pr_debug() each.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Reviewed-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Cleanup DSSDBG with dynamic pr_debug function
Chandrabhanu Mahapatra [Mon, 24 Sep 2012 11:42:58 +0000 (17:12 +0530)]
OMAPDSS: Cleanup DSSDBG with dynamic pr_debug function

The printk in DSSDBG function definition is replaced with dynamic debug enabled
pr_debug(). The use of dynamic debugging provides more flexibility as each debug
statement can be enabled or disabled dynamically on basis of source filename,
line number, module name etc., by writing to a control file in debugfs
filesystem. For better understanding please refer to
Documentation/dynamic-debug-howto.txt.

The DSSDBGF() differs from DSSDBG() by providing function name. However,
function name, line number, module name and thread ID can be printed through
dynamic debug by setting appropriate flags 'f','l','m' and 't' in the debugfs
control file. So, DSSDBGF instances are replaced with DSSDBG.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Reviewed-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Create new debug config options
Chandrabhanu Mahapatra [Sat, 29 Sep 2012 05:55:42 +0000 (11:25 +0530)]
OMAPDSS: Create new debug config options

The config option CONFIG_OMAP2_DSS_DEBUG_SUPPORT has been removed and replaced
with CONFIG_OMAP2_DSS_DEBUG and CONFIG_OMAP2_DSS_DEBUGFS. CONFIG_OMAP2_DSS_DEBUG
enables DEBUG flag and CONFIG_OMAP2_DSS_DEBUGFS enables creation of debugfs for
OMAPDSS. Both the config options are disabled by default and can be enabled
independently of one another as per convenience.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Reviewed-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Move definition of DEBUG flag to Makefile
Chandrabhanu Mahapatra [Thu, 27 Sep 2012 11:22:17 +0000 (16:52 +0530)]
OMAPDSS: Move definition of DEBUG flag to Makefile

In OMAPDSS the DEBUG flag is set only after the OMAPDSS module is called, for
which the debugging capabilities are available only after its proper
initialization. As a result of which tracking of bugs prior to or during initial
process becomes difficult. So, the definition of DEBUG is being moved to the
corresponding Makefile.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Reviewed-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: add missing include for string.h
Tomi Valkeinen [Fri, 28 Sep 2012 07:03:03 +0000 (10:03 +0300)]
OMAPDSS: add missing include for string.h

Both dpi.c and sdi.c use strcmp(), but do not include string.h. With
some Kconfig options string.h is included implicitly, but with some
other the compilation fails:

drivers/video/omap2/dss/dpi.c:407:5: error: implicit declaration of
function 'strcmp'

Include string.h in both dpi.c and sdi.c

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoMerge branch 'archit/wb-dispc-for-3.7'
Tomi Valkeinen [Wed, 26 Sep 2012 13:48:55 +0000 (16:48 +0300)]
Merge branch 'archit/wb-dispc-for-3.7'

Merge omapdss writeback work. These patches implement the low level writeback
features in the DISPC, but do not yet add a way to actually use the writeback
from the userspace.

* archit/wb-dispc-for-3.7:
  OMAPDSS: DISPC: Configure color conversion coefficients for writeback
  OMAPDSS: DISPC: Add manager like functions for writeback
  OMAPDSS: DISPC: Configure writeback FIFOs
  OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup()
  OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
  OMAPDSS: DISPC: Add function to set channel in for writeback
  OMAPDSS: DISPC: Don't set chroma resampling bit for writeback
  OMAPDSS: DISPC: Downscale chroma if plane is writeback
  OMAPDSS: DISPC: Configure input and output sizes for writeback
  OMAPDSS: DISPC: Add writeback register offsets and dss features structs
  OMAPDSS: DISPC: Allow both upscaling and downscaling of chroma
  OMAPDSS: DIPSC: Relax scaling limitations when in memory to memory mode
  OMAPDSS: DISPC: Don't pass channel out when configuring overlays
  OMAPDSS: DISPC: Make dispc_ovl_setup call dispc_ovl_setup_common
  OMAPDSS: OVERLAY: Add position and replication as overlay caps
  OMAPDSS: DISPC: Pass overlay caps as a parameter to dispc plane functions
  OMAPDSS: DISPC: Simplify function names for setting pipeline input and output sizes
  OMAPDSS: DISPC: Constify omap_overlay_info in dispc_ovl_setup()

11 years agoMerge branch 'archit/outputs-for-3.7'
Tomi Valkeinen [Wed, 26 Sep 2012 13:46:29 +0000 (16:46 +0300)]
Merge branch 'archit/outputs-for-3.7'

Merge omapdss output work, that creates a new entity "output" to represent the
outputs (DPI, DSI, HDMI, ...) from DSS. An output sits in between an overlay
manager and a panel, and helps us to remove references to panel devices from
the omapdss core.

* archit/outputs-for-3.7: (23 commits)
  OMAPDSS: Remove old way of setting manager and device links
  OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable
  OMAPDSS: OVERLAY/MANAGER: Get device via output
  OMAPDSS: MANAGER: Update display sysfs store
  OMAPFB: Change dssdev->manager references
  OMAPDSS: HDMI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: VENC: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: RFBI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: SDI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: DSI: Remove dsi_pdev_map global struct
  OMAPDSS: DPI: Replace dssdev->manager with dssdev->output->manager references
  OMAPDSS: Create links between managers, outputs and devices
  OMAPDRM: Remove manager->device references
  OMAPFB: remove manager->device references
  OMAP_VOUT: Remove manager->device references
  OMAPDSS: Remove manager->device references
  OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager
  OMAPDSS: output: Add set/unset device ops for omap_dss_output
  OMAPDSS: outputs: Create and register output instances
  ...

11 years agoOMAPDSS: DISPC: Configure color conversion coefficients for writeback
Archit Taneja [Tue, 11 Sep 2012 06:34:47 +0000 (12:04 +0530)]
OMAPDSS: DISPC: Configure color conversion coefficients for writeback

Writeback pipeline receives RGB data from one of the overlays or one of the
overlay managers. If the target color mode is YUV422 or NV12, we need to convert
the RGB pixels to YUV. The scaler in WB then converts it to the target color
mode.

Hence, the color conversion coefficients that need to be programmed are the ones
which convert a RGB24 pixel to YUV444. Program these coefficients for writeback
pipeline.

Rearrange the code a bit to configure different coefficients for overlays and
writeback.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Add manager like functions for writeback
Archit Taneja [Sat, 22 Sep 2012 07:09:33 +0000 (12:39 +0530)]
OMAPDSS: DISPC: Add manager like functions for writeback

Add functions to enable writeback, and set/check state of GO bit. These bits are
identical in behaviour with the corresponding overlay manager bits. Configure
them in a similar way to mgr_enable() and mgr_go_* functions. Add a helper to
get the FRAMEDONE irq corresponding to writeback.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Configure writeback FIFOs
Archit Taneja [Mon, 10 Sep 2012 12:01:39 +0000 (17:31 +0530)]
OMAPDSS: DISPC: Configure writeback FIFOs

Extend the DISPC fifo functions to also configure the writeback FIFO thresholds.

The most optimal configuration for writeback is to push out data to the
interconnect the moment writeback pushes enough pixels in the FIFO to form a
burst. This reduces the chance of writeback overflowing it's FIFO.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup()
Archit Taneja [Fri, 24 Aug 2012 11:29:26 +0000 (16:59 +0530)]
OMAPDSS: DISPC: Configure writeback specific parameters in dispc_wb_setup()

Configure some of the writeback specific parameters in dispc_wb_setup(). The
writeback parameters configured are:

truncation: This needs to be set if the color depth input to writeback is more
than the color depth of the color mode we want to store in memory.

writeback mode: This configures whether we want to use writeback in mem to mem
or capture mode. This information will be directly passed by APPLY later.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup
Archit Taneja [Fri, 31 Aug 2012 07:02:52 +0000 (12:32 +0530)]
OMAPDSS: DISPC: Configure overlay-like parameters in dispc_wb_setup

Create struct omap_dss_writeback_info, this is similar to omap_overlay_info,
the major difference is that there is no parameter which describes the input
size to writeback, this is because this is always fixed, and decided by the
connected overlay or overlay manager. One more difference is that screen_width
is renamed to buf_width, to give the value of stride the writeback buffer has.

Call dispc_ovl_setup_common() through dispc_wb_setup() to configure overlay-like
parameters. The parameters in dispc_ovl_setup_common() which do not hold for
writeback are filled passed as zeroes or false, the code takes care of not
configuring them as they won't possess the needed overlay caps.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Add function to set channel in for writeback
Archit Taneja [Sat, 22 Sep 2012 07:08:19 +0000 (12:38 +0530)]
OMAPDSS: DISPC: Add function to set channel in for writeback

Writeback can take input from either one of the overlays, or one of the overlay
managers. Add an enum which represents the channel_in for writeback, and maps
to the register field programming.

Add a function to configure channel in for writeback. This will be used later in
APPLY.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Don't set chroma resampling bit for writeback
Archit Taneja [Mon, 16 Jul 2012 11:07:45 +0000 (16:37 +0530)]
OMAPDSS: DISPC: Don't set chroma resampling bit for writeback

The bit YUVCHROMARESAMPLING isn't there for writeback in DISPC_WB_ATTRIBUTES2.
It isn't there because we don't upsample chroma like for video pipelines, we
downsample chroma in writeback to get YUV422 or NV12 formats from the YUV444
input.

Ignore this bit in dispc_ovl_set_scaling_uv() if the plane is OMAP_DSS_WB.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Downscale chroma if plane is writeback
Archit Taneja [Fri, 24 Aug 2012 05:41:14 +0000 (11:11 +0530)]
OMAPDSS: DISPC: Downscale chroma if plane is writeback

When converting YUYV444 content to YUV422 or NV12 formats through writeback
pipeline, the scaler needs to downscale the chroma plane. Ensure that chroma
is downscaled when the pipeline is writeback.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Configure input and output sizes for writeback
Archit Taneja [Sat, 28 Jul 2012 17:29:03 +0000 (22:59 +0530)]
OMAPDSS: DISPC: Configure input and output sizes for writeback

Writeback uses the WB_PICTURE_SIZE register to define the size of the content
written to memory, this is the output of the scaler. It uses the WB_SIZE
register to define the size of the content coming from the overlay/manager to
which it is connected, this is the input to the scaler. This naming is different
as compared to overlays.

Add checks for writeback in dispc_ovl_set_input_size() and
dispc_ovl_set_output_size() to write to the correct registers.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Add writeback register offsets and dss features structs
Archit Taneja [Mon, 16 Jul 2012 10:24:24 +0000 (15:54 +0530)]
OMAPDSS: DISPC: Add writeback register offsets and dss features structs

Since writeback has many overlay like properties, and most of it's registers are
similar to that of overlays, it's possible to reuse most of the overlay related
DISPC code for writeback when considering it as a plane. Writeback was added as
a plane in the omap_plane field as OMAP_DSS_WB.

Add the writeback register offsets in dispc.h, add minimal WB plane related info
needed in dss_features. Add a function which returns the number of writeback
pipelines an OMAP version has.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Allow both upscaling and downscaling of chroma
Archit Taneja [Wed, 22 Aug 2012 11:34:48 +0000 (17:04 +0530)]
OMAPDSS: DISPC: Allow both upscaling and downscaling of chroma

In the function dispc_plane_set_scaling_uv(), create a parameter which tells if
we want to upscale or downscale the chroma plane.

Downscaling of chroma is required by writeback pipeline for converting the input
YUV444 color format to YUV422 or NV12.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DIPSC: Relax scaling limitations when in memory to memory mode
Archit Taneja [Wed, 26 Sep 2012 11:30:37 +0000 (17:00 +0530)]
OMAPDSS: DIPSC: Relax scaling limitations when in memory to memory mode

The scalers of overlays and writeback do not have any constraints on downscale
ratio when operating in memory to memory mode.

This is because in memory to memory mode, we aren't connected to a display which
needs data output at the rate of pixel clock. The scalers can perform as much
downscaling as needed, the rate at which the scaler outputs is adjusted
accordingly.

Relax constraints related to downscaling based on whether the input overlays are
connected to writeback in memory to memory mode. We pass a mem_to_mem boolean
parameter to dispc_ovl_setup() from APPLY. This is currently set to false, this
will later be configured to the correct value based on whether the overlay is
connected to writeback or not. Do the same later for writeback when writeback is
configured.

In the scaling calculation code, we calculate the minimum amount of core clock we
need to achieve the required downscaling. If we are in memory to memory mode, we
set this to a very small value(1 in this case), this value would always be
lesser than the actual DISPC core clock value, and hence the scaling checks
would succeed.

We take care that pixel clock isn't calculated for writeback and the overlays
connected to it when in memory to memory mode. A pixel clock in such cases
doesn't make sense.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Don't pass channel out when configuring overlays
Archit Taneja [Wed, 26 Sep 2012 11:28:52 +0000 (16:58 +0530)]
OMAPDSS: DISPC: Don't pass channel out when configuring overlays

dispc_ovl_setup_common() is to be used by both overlays and writeback. We pass
channel out to figure out what manager the overlay is connected to, to determine
the pixel clock rate. This is used to decide the scaling limitations for that
overlay.

writeback doesn't have a channel out, it has a channel in field which tells
where writeback gets its input from. These are 2 different fields, and this
prevents us reusing the overlay configuration code for writeback.

To overcome this, we now pass omap_plane to overlay related functions rather
than passing channel out. We create helper functions which can derive pclk/lclk
from the omap_plane id.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Make dispc_ovl_setup call dispc_ovl_setup_common
Archit Taneja [Wed, 26 Sep 2012 11:27:37 +0000 (16:57 +0530)]
OMAPDSS: DISPC: Make dispc_ovl_setup call dispc_ovl_setup_common

Add a new static function called dispc_ovl_setup_common(). This function is used by
dispc_ovl_setup() to configure the overlay registers. This split is done so that
dispc_wb_setup() can reuse overlay register configuration related code.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: OVERLAY: Add position and replication as overlay caps
Archit Taneja [Sat, 22 Sep 2012 07:00:17 +0000 (12:30 +0530)]
OMAPDSS: OVERLAY: Add position and replication as overlay caps

Add position and replication as overlay caps, and pass overlay caps as an
argument to the corresponding functions. Adding position and replication to
overlay caps seems a bit unnecessary, but it allows us to use the
corresponding functions for writeback too.

These caps will be set for all overlays, but not for writeback. This is done
so writeback can reuse dispc_ovl_setup() to the maximum.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Pass overlay caps as a parameter to dispc plane functions
Archit Taneja [Wed, 26 Sep 2012 11:25:27 +0000 (16:55 +0530)]
OMAPDSS: DISPC: Pass overlay caps as a parameter to dispc plane functions

Currently, the functions below take the omap_plane parameter and derive the
overlay caps within them. Pass the overlay caps as a parameter to the function
to allow these to be used by writeback too.

- dispc_ovl_set_zorder()
- dispc_ovl_set_pre_mult_alpha()
- dispc_ovl_setup_global_alpha()
- dispc_ovl_calc_scaling()
- dispc_ovl_setup()

These functions will be used for writeback later, and the caps will help in
deciding if they are to be used for writeback or not. This allows reuse of
overlay caps for writeback.

Using omap_overlay_caps for writeback seems a bit incorrect, but caps is
something already in use by users of OMAPDSS(omapfb/omap_vout), so we use
overlay caps for overlay like features of writeback too.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Simplify function names for setting pipeline input and output sizes
Archit Taneja [Fri, 21 Sep 2012 09:21:49 +0000 (14:51 +0530)]
OMAPDSS: DISPC: Simplify function names for setting pipeline input and output sizes

The DISPC pipeline register names in the TRM for setting the buffer size and
the output size are a bit misleading, for example, there are different register
names for setting the buffer size for VID and GFX pipes. Things get more
confusing when considering writeback pipeline.

Rename the functions so that they tell whether they are configuring the input
to the scalar or the output. These will be extended later to support writeback
registers.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DISPC: Constify omap_overlay_info in dispc_ovl_setup()
Archit Taneja [Wed, 22 Aug 2012 07:03:49 +0000 (12:33 +0530)]
OMAPDSS: DISPC: Constify omap_overlay_info in dispc_ovl_setup()

The struct omap_overlay_info passed to dispc_ovl_setup() is used to configure
DISPC registers. It shouldn't modify the overlay_info structure. The pos_y field
was being changed in dispc_ovl_setup in the case of interlaced displays. Fix
this and const qualifier to the omap_overlay_info argument.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: Remove old way of setting manager and device links
Archit Taneja [Tue, 5 Jun 2012 13:07:27 +0000 (18:37 +0530)]
OMAPDSS: Remove old way of setting manager and device links

Now that an omap_dss_output can be used to link between managers and devices, we
can remove the old way of setting manager and device links. This involves
removing the device and manager pointers from omap_overlay_manager and
omap_dss_device respectively, and removing the set_device/unset_device ops from
omap_overlay_manager.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable
Archit Taneja [Mon, 3 Sep 2012 11:44:09 +0000 (17:14 +0530)]
OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable

An overlay isn't allowed to be enabled/disabled if it isn't connected to an
omap_dss_device. This requirement isn't needed any more. An overlay can be
enabled/disabled as long as it has an output connected to it. The output may
not be connected to a device, but we can be assured that the connected
manager's output is in use by an output interface.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: OVERLAY/MANAGER: Get device via output
Archit Taneja [Tue, 5 Jun 2012 13:03:28 +0000 (18:33 +0530)]
OMAPDSS: OVERLAY/MANAGER: Get device via output

A manager is not connected to a device directly any more. It first connects
to an output, and then to the display. Update overlay and manager get_device ops
to return the device via the connected output.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: MANAGER: Update display sysfs store
Archit Taneja [Fri, 7 Sep 2012 12:30:07 +0000 (18:00 +0530)]
OMAPDSS: MANAGER: Update display sysfs store

The display sysfs attribute's store function needs to be changed with the
introduction of outputs.

The DSS driver ensures that there is one display per output, and that a
registered omap_dss_device will have an output connected to it. The display
sysfs store function unsets the current output connected to the manager, and
sets it with the output connected to the new display. If the new display doesn't
have an output for some reason, we just bail out. The function doesn't set/unset
output->device links. These remain the same as when the omap_dss_device was
registered.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPFB: Change dssdev->manager references
Archit Taneja [Mon, 10 Sep 2012 09:13:39 +0000 (14:43 +0530)]
OMAPFB: Change dssdev->manager references

To retrieve the manager pointer via a device, we need to now access it via the
output to which the device is connected. Make this change in omapfb_ioctl()
where the WAITFORVSYNC ioctl tries to access the manager's device.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: HDMI: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Fri, 7 Sep 2012 12:26:20 +0000 (17:56 +0530)]
OMAPDSS: HDMI: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the HDMI output, check whether the output entity connected to
display is not NULL.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: VENC: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Fri, 7 Sep 2012 12:24:27 +0000 (17:54 +0530)]
OMAPDSS: VENC: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the VENC output, check whether the output entity connected to
display is not NULL.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: RFBI: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Tue, 4 Sep 2012 06:24:32 +0000 (11:54 +0530)]
OMAPDSS: RFBI: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the RFBI output, check whether the output entity connected to
display is not NULL.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: SDI: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Tue, 4 Sep 2012 06:19:30 +0000 (11:49 +0530)]
OMAPDSS: SDI: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the SDI output, check whether the output entity connected to
display is not NULL.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Tue, 4 Sep 2012 06:12:36 +0000 (11:42 +0530)]
OMAPDSS: DSI: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the DSI output, check whether the output entity connected to
display is not NULL.

In dsi_init_display(), the display won't be connected to the DSI output yet,
that happens later in dss_recheck_connections() in the panel driver's probe. Get
the dsidev platform device pointer using the DSI moudle number provided in the
omap_dss_device struct.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DSI: Remove dsi_pdev_map global struct
Archit Taneja [Wed, 4 Jul 2012 08:18:34 +0000 (13:48 +0530)]
OMAPDSS: DSI: Remove dsi_pdev_map global struct

dsi_pdev_map is a struct visible globally in the DSI driver to get the platform
device pointer of the DSI device corresponding to it's module ID. This was
required because there was no clean way to derive the platform device from
the DSI module instance number or from the connected panel.

With the new output entity, it is possible to retrieve the platform device
pointer if the omap_dss_output pointer is available. Modify the functions
dsi_get_dsidev_from_dssdev() dsi_get_dsidev_from_id() so that they use output
instead of dsi_pdev_map to retrieve the dsi platform device pointer.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DPI: Replace dssdev->manager with dssdev->output->manager references
Archit Taneja [Fri, 7 Sep 2012 12:23:38 +0000 (17:53 +0530)]
OMAPDSS: DPI: Replace dssdev->manager with dssdev->output->manager references

With addition of output entities, a device connects to an output, and an output
connects to overlay manager. Replace the dssdev->manager references with
dssdev->output->manager to access the manager correctly.

When enabling the DPI output, check whether the output entity connected to
display is not NULL.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: Create links between managers, outputs and devices
Archit Taneja [Mon, 10 Sep 2012 09:04:16 +0000 (14:34 +0530)]
OMAPDSS: Create links between managers, outputs and devices

Links between DSS entities are made in dss_init_connections() when a panel
device is registered, and are removed in dss_uninit_connections() when the
device is unregistered. Modify these functions to incorporate the addition of
outputs.

The fields in omap_dss_device struct gives information on which output and
manager to connect to. The desired manager and output pointers are retrieved and
prepared to form the desired links. The output is linked to the device, and then
the manager to the output.

A helper function omapdss_get_output_from_device() is created to retrieve the
output from the display by checking it's type, and the module id in case of DSI.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDRM: Remove manager->device references
Archit Taneja [Fri, 20 Jul 2012 13:00:50 +0000 (18:30 +0530)]
OMAPDRM: Remove manager->device references

With the introduction of output entities, managers will now connect to outputs.
Use the helper op for managers named get_device. This will abstract away the
information on how to get the device from an overlay manager.

Using the helper function will reduce the number of pointer dereferences a user
of OMAPDSS needs to do and reduce risk of a NULL dereference.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPFB: remove manager->device references
Archit Taneja [Fri, 20 Jul 2012 12:56:56 +0000 (18:26 +0530)]
OMAPFB: remove manager->device references

With the introduction of output entities, managers will now connect to outputs.
Use the helper op for overlays named get_device. This will abstract away the
information on how to get the device from an overlay.

Using the helper function will reduce the number of pointer dereferences a user
of OMAPDSS needs to do and reduce risk of a NULL dereference.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAP_VOUT: Remove manager->device references
Archit Taneja [Fri, 20 Jul 2012 12:56:30 +0000 (18:26 +0530)]
OMAP_VOUT: Remove manager->device references

With the introduction of output entities, managers will now connect to outputs.
Use the helper op for overlays named get_device. This will abstract away the
information on how to get the omap_dss_device pointer from an overlay.

Using the helper function will reduce the number of pointer dereferences a user
of OMAPDSS needs to do and reduce risk of a NULL dereference.

Cc: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: Remove manager->device references
Archit Taneja [Fri, 7 Sep 2012 12:14:51 +0000 (17:44 +0530)]
OMAPDSS: Remove manager->device references

With the introduction of output entities, managers will now connect to outputs.
Create helper ops for overlays and managers named get_device. This will abstract
away the information on how to get the device from an overlay or an overlay
manager. The get_device ops currently retrieve the output via a
ovl->manager->device reference. This will be later replaced by
ovl->manager->output->device references.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager
Archit Taneja [Wed, 26 Sep 2012 11:12:39 +0000 (16:42 +0530)]
OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager

Add set_output/unset_output ops for overlay managers, these form links between
managers and outputs. Create a function in dss features which tell all the
output instances that connect to a manager, use it when a manager tries to set
an output. Add a constraint of not unsetting an output when the manager is
enabled.

Keep the omap_dss_device pointer and set/unset_device ops in overlay_manager for
now to not break things. Keep the dss feature function get_supported_displays
as it's used in some places. These will be removed later.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: output: Add set/unset device ops for omap_dss_output
Archit Taneja [Wed, 29 Aug 2012 08:00:15 +0000 (13:30 +0530)]
OMAPDSS: output: Add set/unset device ops for omap_dss_output

An output entity represented by the struct omap_dss_output connects to a
omap_dss_device entity. Add functions to set or unset an output's device. This
is similar to how managers and devices were connected previously. An output can
connect to a device without being connected to a manager. However, the output
needs to eventually connect to a manager so that the connected panel can be
enabled.

Keep the omap_overlay_manager pointer in omap_dss_device for now to prevent
breaking things. This will be removed later when outputs are supported
completely.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: outputs: Create and register output instances
Archit Taneja [Wed, 26 Sep 2012 11:00:49 +0000 (16:30 +0530)]
OMAPDSS: outputs: Create and register output instances

Add output structs to output driver's private data. Register output instances by
having an init function in the probes of the platform device drivers for
different outputs. The *_init_output for each output registers the output and
fill up the output's plaform device, type and id fields. The *_uninit_output
functions unregister the output.

In the probe of each interface driver, the output entities are initialized
before the *_probe_pdata() functions intentionally. This is done to ensure that
the output entity is prepared before the panels connected to the output are
registered. We need the output entities to be ready because OMAPDSS will try
to make connections between overlays, managers, outputs and devices during the
panel's probe.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: outputs: Create a new entity called outputs
Archit Taneja [Fri, 7 Sep 2012 12:08:00 +0000 (17:38 +0530)]
OMAPDSS: outputs: Create a new entity called outputs

The current OMAPDSS design contains 3 software entities: Overlays, Managers and
Devices. These map to pipelines, overlay managers and the panels respectively in
hardware. One or more overlays connect to a manager to represent a composition,
the manager connects to a device(generally a display) to display the content.

The part of DSS hardware which isn't represented by any of the above entities
are interfaces/outputs that connect to an overlay manager, i.e blocks like DSI,
HDMI, VENC and so on. Currently, an overlay manager directly connects to the
display, and the output to which it is actually connected is ignored. The panel
driver of the display is responsible of calling output specific functions to
configure the output.

Adding outputs as a new software entity gives us the following benefits:

- Have exact information on the possible connections between managers and
  outputs: A manager can't connect to each and every output, there only limited
  hardware links between a manager's video port and some of the outputs.

- Remove hacks related to connecting managers and devices: Currently, default
  links between managers and devices are set in a not so clean way. Matching is
  done via comparing the device type, and the display types supported by the
  manager. This isn't sufficient to establish all the possible links between
  managers, outputs and devices in hardware.

- Make panel drivers more generic: The DSS panel drivers currently call
  interface/output specific functions to configure the hardware IP. When making
  these calls, the driver isn't actually aware of the underlying output. The
  output driver extracts information from the panel's omap_dss_device pointer
  to figure out which interface it is connected to, and then configures the
  corresponding output block. An example of this is when a DSI panel calls
  dsi functions, the dsi driver figures out whether the panel is connected
  to DSI1 or DSI2. This isn't correct, and having output as entities will
  give the panel driver the exact information on which output to configure.
  Having outputs also gives the opportunity to make panel drivers generic
  across different platforms/SoCs, this is achieved as omap specific output
  calls can be replaced by ops of a particular output type.

- Have more complex connections between managers, outputs and devices: OMAPDSS
  currently doesn't support use cases like 2 outputs connect to a single
  device. This can be achieved by extending properties of outputs to connect to
  more managers or devices.

- Represent writeback as an output: The writeback pipeline fits well in OMAPDSS
  as compared to overlays, managers or devices.

Add a new struct to represent outputs. An output struct holds pointers to the
manager and device structs to which it is connected. Add functions which can
register/unregister an output, or look for one. Create an enum which represent
each output instance.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: APPLY: Remove omap_dss_device references in wait_for_go functions
Archit Taneja [Tue, 26 Jun 2012 10:06:55 +0000 (15:36 +0530)]
OMAPDSS: APPLY: Remove omap_dss_device references in wait_for_go functions

The functions dss_mgr_wait_for_go() and dss_mgr_wait_for_go_ovl() check if there
is an enabled display connected to the manager before trying to see the state of
the GO bit.

The checks related to the display can be replaced by checking the state of the
manager, i.e, whether the manager is enabled or not. This makes more sense than
checking with the connected display as the GO bit behaviour is more connected
with the manager state rather than the display state. A GO bit can only be set
if the manager is enabled. If a manager isn't enabled, we can safely assume that
the GO bit is not set.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DSI: Pass dsi platform device wherever possible
Archit Taneja [Tue, 14 Aug 2012 06:59:22 +0000 (12:29 +0530)]
OMAPDSS: DSI: Pass dsi platform device wherever possible

Many of the DSI functions receive the connected panel's omap_dss_device pointer
as an argument. The platform device pointer is then derived via omap_dss_device
pointers.

Most of these functions don't really require omap_dss_device pointer anymore
since we now keep copies of parameters in the driver data which were previously
available only via omap_dss_device. Replace the arguments with platform device
pointers for such functions.

Signed-off-by: Archit Taneja <archit@ti.com>
11 years agoOMAPDSS: DSI: fix tlpx_half reg field length
Tomi Valkeinen [Mon, 24 Sep 2012 06:34:52 +0000 (09:34 +0300)]
OMAPDSS: DSI: fix tlpx_half reg field length

tlpx_half bit field in DSI_DSIPHY_CFG1 is [20,16], not [22,16] as
accessed in the code currently. Fix this.

The bug should not have caused any problems on OMAP3/4, as the bits
21,22 are unused. They are used on OMAP5, though.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DISPC: Add predecimation limit for TILER based rotations
Chandrabhanu Mahapatra [Mon, 24 Sep 2012 06:38:27 +0000 (12:08 +0530)]
OMAPDSS: DISPC: Add predecimation limit for TILER based rotations

In OMAP4 and OMAP5 when TILER 2D burst mode is used, a maximum of one line can
be skipped as per the respective TRMs. The MBlockStride OCP signal, which is
sum of ROWINC and image width in memory, is only 17 bits wide. In 2D mode TILER
supports 8192, 16384, 32768 and 65536 values of MBlockStride. In case when 2 or
more lines are skipped the ROWINC value exceeds 65536 resulting in OCP errors.
So, maximum vertical predecimation achievable is 2.

Signed-off-by: Chandrabhanu Mahapatra <cmahapatra@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoMerge OMAP5 DSS changes to omapdss
Tomi Valkeinen [Tue, 25 Sep 2012 08:26:28 +0000 (11:26 +0300)]
Merge OMAP5 DSS changes to omapdss

This series adds basic OMAP5 DSS functionality, mainly related to DSS core, DPI
and DSI.

* omap5-dss:
  OMAPDSS: DSI: make OMAP2_DSS_DSI depend on ARCH_OMAP5
  OMAPDSS: DSI: Add code to disable PHY DCC
  OMAPDSS: DSI: Add new linebuffer size for OMAP5
  OMAPDSS: DSI: Add FEAT_DSI_PLL_REFSEL
  OMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO
  OMAPDSS: Add support for DPI source selection
  OMAPDSS: move dss feats to the end of dss.c
  OMAPDSS: Add basic omap5 features to dss and dispc
  OMAPDSS: DSI: improve DSI clock calcs for DISPC

11 years agoMerge omapdss single-dssdev series
Tomi Valkeinen [Tue, 25 Sep 2012 08:23:14 +0000 (11:23 +0300)]
Merge omapdss single-dssdev series

This series contains patches that change how omapdss's panel devices
(omap_dss_device) are initialized and registered. There are two patches that
change behaviour, the rest are just cleanups:

The patch "omap_dss_register_device() doesn't take display index" affects the
number for the "displayX" sysfs files. This hopefully doesn't affect the
userspace, as the number has never been a clear indication of what the
particular display is.

The patch "register only one display device per output" affects how panel
devices are created. Currently we support multiple panels per output, i.e. you
could have DVI and an LCD displays using the same DPI output, as long as the
DVI and LCD are not used at the same time.

This patch changes the omapdss driver to only register one display device per
output. If there are multiple displays for the output, either the first one is
picked or, if def_display has been defined in kernel parameters and the
def_display is one of the displays for this output, the def_display is picked.
See the patch for more information.

  OMAPDSS: alloc dssdevs dynamically
  OMAPDSS: cleanup dss_recheck_connections further
  OMAPDSS: cleanup dss_recheck_connections
  OMAPDSS: handle errors in dss_init_device
  OMAPDSS: explicitely initialize dssdev->channel for new displays
  OMAPDSS: register only one display device per output
  OMAPDSS: Add dss_get_default_display_name()
  OMAPDSS: omap_dss_register_device() doesn't take display index

11 years agoOMAPDSS: Do not require a VDDS_DSI regulator on AM35xx
Raphaël Assénat [Wed, 19 Sep 2012 19:53:14 +0000 (15:53 -0400)]
OMAPDSS: Do not require a VDDS_DSI regulator on AM35xx

On our AM3505 based board, dpi.c complains that there is no VDDS_DSI
regulator and the framebuffer cannot be enabled. However, this check
does not seem to apply to AM3505/17 chips.

This patch adds new features list for AM35xxx, which is the same as for
OMAP3 except the VDDS_DSI is removed.

Signed-off-by: Raphael Assenat <raph@8d.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: make OMAP2_DSS_DSI depend on ARCH_OMAP5
Tomi Valkeinen [Wed, 22 Aug 2012 12:55:21 +0000 (15:55 +0300)]
OMAPDSS: DSI: make OMAP2_DSS_DSI depend on ARCH_OMAP5

Change omapdss Kconfig file to make OMAP2_DSS_DSI depend on ARCH_OMAP5.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: Add code to disable PHY DCC
Tomi Valkeinen [Mon, 24 Sep 2012 12:15:57 +0000 (15:15 +0300)]
OMAPDSS: DSI: Add code to disable PHY DCC

OMAP5 DSI PHY has DCC (Duty Cycle Corrector) block, and by default DCC
is enabled and thus the PLL clock is divided by 2 to get the DSI DDR
clk. This divider has been 4 for all previous OMAPs, and changing it
needs some reorganization of the code. The DCC can be disabled, and in
that case the divider is back to the old 4.

This patch adds dss feature for the DCC, and adds code to always disable
the DCC.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: Add new linebuffer size for OMAP5
Tomi Valkeinen [Wed, 22 Aug 2012 13:00:47 +0000 (16:00 +0300)]
OMAPDSS: DSI: Add new linebuffer size for OMAP5

OMAP5's DSI has a larger line buffer than earlier OMAPs. This patch adds
support for this to the DSI driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: Add FEAT_DSI_PLL_REFSEL
Tomi Valkeinen [Wed, 22 Aug 2012 13:00:40 +0000 (16:00 +0300)]
OMAPDSS: DSI: Add FEAT_DSI_PLL_REFSEL

Add FEAT_DSI_PLL_REFSEL. OMAP5's DSI PLL needs configuration to select
the reference clock to be used. We always use SYSCLK.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO
Tomi Valkeinen [Wed, 22 Aug 2012 13:00:31 +0000 (16:00 +0300)]
OMAPDSS: DSI: Add FEAT_DSI_PLL_SELFREQDCO

Add FEAT_DSI_PLL_SELFREQDCO. OMAP5's DSI PLL has a new configuration
option that needs to be programmed depending on the PLL's output clock
frequency.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Add support for DPI source selection
Tomi Valkeinen [Fri, 21 Sep 2012 09:09:54 +0000 (12:09 +0300)]
OMAPDSS: Add support for DPI source selection

We can select the video source for DPI output as follows:

OMAP2/3: always LCD1
OMAP4: LCD2 or DIGIT
OMAP5: LCD1/LCD2/LCD3/DIGIT

This patch adds support to select the source, and makes dpi.c call the
function to set the source.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: David Anders <x0132446@ti.com>
11 years agoOMAPDSS: move dss feats to the end of dss.c
Tomi Valkeinen [Fri, 21 Sep 2012 09:03:31 +0000 (12:03 +0300)]
OMAPDSS: move dss feats to the end of dss.c

Move dss_features to the end of dss.c the same way they are in dispc.c,
so that we don't have to declare prototypes for static feat-related
functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Add basic omap5 features to dss and dispc
Archit Taneja [Sun, 8 Apr 2012 11:17:01 +0000 (16:47 +0530)]
OMAPDSS: Add basic omap5 features to dss and dispc

Add basic omap5 features for dss and dispc.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: DSI: improve DSI clock calcs for DISPC
Tomi Valkeinen [Mon, 24 Sep 2012 12:15:06 +0000 (15:15 +0300)]
OMAPDSS: DSI: improve DSI clock calcs for DISPC

Commit ee144e645a081daad5de1ccac77f0a0e98e6a67b added
dsi_pll_calc_ddrfreq() which calculates PLL dividers based on given DSI
bus clock speed. The function works ok, but it can be improved for the
DISPC clock calc.

The current version calculates the clock going from the PLL to the DISPC
simply by setting the clock as close to DISPC maximum as possible, and
the pixel clock is calculated based on that.

This patch changes the function to calculate DISPC clock more
dynamically, iterating through different DISPC clocks and pixel clock
values, and thus we'll get more suitable pixel clocks.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: alloc dssdevs dynamically
Tomi Valkeinen [Mon, 10 Sep 2012 10:58:29 +0000 (13:58 +0300)]
OMAPDSS: alloc dssdevs dynamically

We currently create omap_dss_devices statically in board files, and use
those devices directly in the omapdss driver. This model prevents us
from having the platform data (which the dssdevs in board files
practically are) as read-only, and it's also different than what we will
use with device tree.

This patch changes the model to be in line with DT model: we allocate
the dssdevs dynamically, and initialize them according to the data in
the board file's dssdev (basically we memcopy the dssdev fields).

The allocation and registration is done in the following steps in the
output drivers:

- Use dss_alloc_and_init_device to allocate and initialize the device.
  The function uses kalloc and device_initialize to accomplish this.
- Call dss_copy_device_pdata to copy the data from the board file's
  dssdev
- Use dss_add_device to register the device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: cleanup dss_recheck_connections further
Tomi Valkeinen [Fri, 7 Sep 2012 12:48:45 +0000 (15:48 +0300)]
OMAPDSS: cleanup dss_recheck_connections further

Cleanup dss_recheck_connections, move and rename it to a static
dss_init_connections function inside display.c. Improve the function to
return errors, and implement a matching dss_uninit_connections that can
be used to free the mgr->dssdev link.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: cleanup dss_recheck_connections
Tomi Valkeinen [Fri, 7 Sep 2012 12:21:56 +0000 (15:21 +0300)]
OMAPDSS: cleanup dss_recheck_connections

dss_recheck_connections is quite a mess. With the previous commit that
initializes the channel field for HDMI and VENC displays, we can greatly
simplify the dss_recheck_connections.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: handle errors in dss_init_device
Tomi Valkeinen [Fri, 7 Sep 2012 12:44:30 +0000 (15:44 +0300)]
OMAPDSS: handle errors in dss_init_device

Add error handling to dss_init_device(), which has, for some reason,
been missing.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: explicitely initialize dssdev->channel for new displays
Tomi Valkeinen [Fri, 7 Sep 2012 12:21:36 +0000 (15:21 +0300)]
OMAPDSS: explicitely initialize dssdev->channel for new displays

HDMI and VENC outputs always use the DIGIT output from DISPC. The dssdev
struct contains "channel" field which is used to specify the DISPC
output for the display, but this was not used for HDMI and VENC.

This patch fills the channel field explicitely for HDMI and VENC
displays so that we can always rely on the channel field.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: register only one display device per output
Tomi Valkeinen [Thu, 6 Sep 2012 11:29:31 +0000 (14:29 +0300)]
OMAPDSS: register only one display device per output

We have boards with multiple panel devices connected to the same
physical output, of which only one panel can be enabled at one time.
Examples of these are Overo, where you can use different daughter boards
that have different LCDs, and 3430SDP which has an LCD and a DVI output
and a physical switch to select the active display.

These are supported by omapdss so that we add all the possible display
devices at probe, but the displays are inactive until somebody enables
one. At this point the panel driver starts using the DSS, thus reserving
the physcal resource and excluding the other panels.

This is problematic:
- Panel drivers can't allocate their resources properly at probe(),
  because the resources can be shared with other panels. Thus they can
  be only reserved at enable time.
- Managing this in omapdss is confusing. It's not natural to have
  child devices, which may not even exist (for example, a daughterboard
  that is not connected).

Only some boards have multiple displays per output, and of those, only
very few have possibility of switching the display during runtime.
Because of the above points:
- We don't want to make omapdss and all the panel drivers more complex
  just because some boards have complex setups.
- Only few boards support runtime switching, and afaik even then it's
  not required. So we don't need to support runtime switching.

Thus we'll change to a model where we will have only one display device
per output and this cannot be (currently) changed at runtime. We'll
still have the possibility to select the display from multiple options
during boot with the default display option.

This patch accomplishes the above by changing how the output drivers
register the display device. Instead of registering all the devices
given from the board file, we'll only register one. If the default
display option is set, the output driver selects that display from its
displays. If the default display is not set, or the default display is
not one of the output's displays, the output driver selects the first
display.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Add dss_get_default_display_name()
Tomi Valkeinen [Thu, 6 Sep 2012 11:26:10 +0000 (14:26 +0300)]
OMAPDSS: Add dss_get_default_display_name()

Add function dss_get_default_display_name() which returns the name of
the default display, given from the board file or via module parameters.
The default display name can be used by output drivers to decide which
display is the wanted one.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: omap_dss_register_device() doesn't take display index
Tomi Valkeinen [Thu, 6 Sep 2012 10:57:39 +0000 (13:57 +0300)]
OMAPDSS: omap_dss_register_device() doesn't take display index

We used to have all the displays of the board in one list, and we made a
"displayX" directory in the sysfs, where X was the index of the display
in the list.

This doesn't work anymore with device tree, as there's no single list to
get the number from, and it doesn't work very well even with non-DT as
we need to do some tricks to get the index nowadays.

This patch changes omap_dss_register_device() so that it doesn't take
disp_num as a parameter anymore, but uses a private increasing counter
for the display number.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPFB: Clear framebuffers before they are registered
Archit Taneja [Tue, 11 Sep 2012 10:04:08 +0000 (15:34 +0530)]
OMAPFB: Clear framebuffers before they are registered

The framebuffers are cleared with the function omapfb_clear_fb(), which
internally calls cfb_fillrect(). The boot logo is copied on to the
framebuffer when the fb device is registered with fb framework.

omapfb_clear_fb() is called after the framebuffer is registered, leading to
the boot logo getting cleared. Clear the framebuffers using omapfb_clear_fb()
before registering the framebuffer devices.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoMerge branch 'fbdev-for-linus' of git://github.com/schandinat/linux-2.6
Tomi Valkeinen [Tue, 11 Sep 2012 08:28:59 +0000 (11:28 +0300)]
Merge branch 'fbdev-for-linus' of git://github.com/schandinat/linux-2.6

Merge omapfb and OMAP SDI fixes:

* OMAPFB: fix framebuffer console colors
* OMAPDSS: Fix SDI PLL locking

Conflicts:
drivers/video/omap2/dss/sdi.c

11 years agoMerge miscellaneous omapdss changes
Tomi Valkeinen [Mon, 10 Sep 2012 06:18:03 +0000 (09:18 +0300)]
Merge miscellaneous omapdss changes

Most important changes:

* Remove OMAP4 HDMI gpio handling from board files
* Add vdda_hdmi_dac supply for HDMI to twl-common.c
* Calculate DSI clocks dynamically
* Remove DSS clock dividers from 4430sdp board file
* vram.c no longer uses OMAP's sDMA to clear the memory
* Fifomerge has been reverted
* Swap GFX and WB fifos to avoid underflows

11 years agoOMAPDSS: fix dss_ovl_unset_manager
Tomi Valkeinen [Thu, 6 Sep 2012 13:10:28 +0000 (16:10 +0300)]
OMAPDSS: fix dss_ovl_unset_manager

When we removed fifomerge support, we also changed dss_ovl_disable so
that it doesn't wait for the hardware to be finished with the overlay.
This may cause a problem when changing the overlay's manager, as
changing the manager is an immediate change. Thus if the overlay is
still being used by the HW when the manager is changed, there may be
glitches on the screen.

This patch adds a wait into dss_ovl_unset_manager, which ensures the
overlays are disabled in the HW.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: fix set_timings
Tomi Valkeinen [Wed, 5 Sep 2012 11:09:33 +0000 (14:09 +0300)]
OMAPDSS: fix set_timings

set_timings function of DSS's output drivers are not consistent. Some of
them disable the output, set the timings, and re-enable the output. Some
set the timings on the fly, while the output is enabled. And some just
store the given timings, so that they will be taken into use next time
the output is enabled.

We require the DISPC output to be disabled when changing the timings,
and so we can change all the output drivers' set_timings to just store
the given timings.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Use WB fifo for GFX overlay
Tomi Valkeinen [Wed, 22 Aug 2012 13:57:02 +0000 (16:57 +0300)]
OMAPDSS: Use WB fifo for GFX overlay

OMAP4's GFX overlay has smaller fifo than the rest of the overlays
(including writeback "overlay"). This seems to be the reason for
underflows in some more demanding scenarios.

We can avoid the problems by using the WB fifo for GFX overlay, and vice
versa. WB usage is not supported yet, but when it will, it should
perform just fine with smaller fifo as there are no hard realtime
constraints with WB.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Improve fifo management code
Tomi Valkeinen [Wed, 22 Aug 2012 13:56:57 +0000 (16:56 +0300)]
OMAPDSS: Improve fifo management code

OMAP4+ allows assigning the overlay FIFOs freely, but that is not
supported by omapdss yet. This patch takes a step forward by improving
the fifo management to be more flexible.

dispc.c is changed to keep track of the sizes of each fifo, and also the
overlay using each fifo.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoRevert "OMAPDSS: APPLY: add fifo merge support funcs"
Tomi Valkeinen [Mon, 6 Aug 2012 13:51:42 +0000 (16:51 +0300)]
Revert "OMAPDSS: APPLY: add fifo merge support funcs"

This reverts commit fb0119742291b6f30cd97026ee137b2d3d1f4de8.

Adding fifo merge feature as an omapdss internal configuration was a
mistake. We cannot hide from the users of omapdss the complexities of
fifo merge.

The previous commit removed fifo merge itself, and this removes the
remaining fifo merge support functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoRevert "OMAPDSS: APPLY: add fifo-merge support"
Tomi Valkeinen [Mon, 6 Aug 2012 13:50:14 +0000 (16:50 +0300)]
Revert "OMAPDSS: APPLY: add fifo-merge support"

This reverts commit 1d71f42b35ed66d90a9a39bc515bb16cfe2d4a46.

Adding fifo merge feature as an omapdss internal configuration was a
mistake. We cannot hide from the users of omapdss the complexities of
fifo merge.

This commit removes the fifo merge support, which luckily is easily done
as it was handled totally inside apply.c. Note that this is not a 1:1
revert, but some resolving was needed for the dss_ovl_setup_fifo.

The plan is to try fifo merge again later when it is more clear how the
hardware acts in various situations, and how the omapdrm wants to use
fifo merge.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: clean up dss_mgr_set_timings
Tomi Valkeinen [Thu, 9 Aug 2012 15:13:13 +0000 (18:13 +0300)]
OMAPDSS: clean up dss_mgr_set_timings

dss_mgr_set_timings() can only be called when the output is not active.
This means that most of the code in the function is extra, as there's no
need to write the values to registers, etc, because that will be handled
when the output will be enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: clean up dss_mgr_set_lcd_config
Tomi Valkeinen [Thu, 9 Aug 2012 15:07:45 +0000 (18:07 +0300)]
OMAPDSS: clean up dss_mgr_set_lcd_config

dss_mgr_set_lcd_config() can only be called when the output is not
active. This means that most of the code in the function is extra, as
there's no need to write the values to registers, etc, because that will
be handled when the output will be enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: split manager sysfs code
Tomi Valkeinen [Mon, 6 Aug 2012 11:44:09 +0000 (14:44 +0300)]
OMAPDSS: split manager sysfs code

Separate sysfs code for managers to a separate file. This is a bit
cleaner, and will allow us later to easily switch off the sysfs support
via Kconfig option.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: split overlay sysfs code
Tomi Valkeinen [Mon, 6 Aug 2012 11:40:00 +0000 (14:40 +0300)]
OMAPDSS: split overlay sysfs code

Separate sysfs code for overlays to a separate file. This is a bit
cleaner, and will allow us later to easily switch off the sysfs support
via Kconfig option.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: TFP410: use devm_gpio_request_one
Tomi Valkeinen [Tue, 4 Sep 2012 07:52:19 +0000 (10:52 +0300)]
OMAPDSS: TFP410: use devm_gpio_request_one

Use devm_ version instead of the regular gpio_request_one to simplify
the error handling.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Taal: Reogranize for device tree
Tomi Valkeinen [Mon, 3 Sep 2012 07:42:50 +0000 (10:42 +0300)]
OMAPDSS: Taal: Reogranize for device tree

Reorganize taal driver to make it easier to integrate device tree code.
Instead of storing the panel's platform data, we'll "parse" the platform
data and store the required information in driver's own data. This way
adding device tree data parsing is simple.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: VRAM: Remove clearing with sDMA
Tomi Valkeinen [Thu, 30 Aug 2012 13:54:01 +0000 (16:54 +0300)]
OMAPDSS: VRAM: Remove clearing with sDMA

Currently vram.c clears the allocated memory automatically using OMAP
system DMA. In an effort to reduce OMAP dependencies, we'll do the
memory clear with CPU from now on.

The previous patch implemented memory clear in the omapfb driver, and
this patch removes the now obsolete clear functionality from vram.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
11 years agoOMAPFB: clear framebuffers with CPU
Tomi Valkeinen [Thu, 30 Aug 2012 13:53:29 +0000 (16:53 +0300)]
OMAPFB: clear framebuffers with CPU

Currently vram.c clears the allocated memory automatically using OMAP
system DMA. In an effort to reduce OMAP dependencies, we'll do the
memory clear with CPU from now on.

This patch implements clearing of the framebuffer in omapfb, using
cfb_fillrect() to do the actual clear.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: remove unnecessary includes
Tomi Valkeinen [Thu, 30 Aug 2012 07:52:47 +0000 (10:52 +0300)]
OMAPDSS: remove unnecessary includes

Remove unnecessary includes from omapdss.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPFB1: remove a non-used table
Tomi Valkeinen [Thu, 30 Aug 2012 07:54:50 +0000 (10:54 +0300)]
OMAPFB1: remove a non-used table

The old omapfb driver contains a table for DMA element types, which is
not used. Remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPFB1: remove unnecessary includes
Tomi Valkeinen [Thu, 30 Aug 2012 07:54:12 +0000 (10:54 +0300)]
OMAPFB1: remove unnecessary includes

Remove unnecessary includes from the old omapfb driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Taal: use devm_* functions
Tomi Valkeinen [Wed, 29 Aug 2012 13:31:29 +0000 (16:31 +0300)]
OMAPDSS: Taal: use devm_* functions

Use devm_ functions in panel-taal.c's probe when possible. Also reorder
the initialization sequence so that devm_ allocations are done before
things that require explicit freeing. This simplifies the probe and
remove functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: fix use of dssdev->caps
Tomi Valkeinen [Thu, 23 Aug 2012 13:06:43 +0000 (16:06 +0300)]
OMAPDSS: fix use of dssdev->caps

Recent commit dca2b1522ccab28d03fb79f6e70e70ea78033d52 (OMAPDSS: DSI:
Maintain copy of operation mode in driver data) broke DSI for video mode
displays. The commit changed the way dssdev->caps are initialized, and
the result was that every DSI display is initialized with manual-update
and tear-elim caps.

The code that sets dssdev->caps is not very good, even when fixed.
omapdss driver shouldn't be writing dssdev->caps at all.

This patch fixes the problem with video mode displays by moving the
initialization of dssdev->caps to the panel driver. The same change is
done for RFBI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAP: 4430SDP: remove DSI clock config from board file
Tomi Valkeinen [Wed, 15 Aug 2012 14:40:05 +0000 (17:40 +0300)]
OMAP: 4430SDP: remove DSI clock config from board file

DSI clocks are now configured dynamically by the DSI driver, so we can
remove the hardcoded clock configuration from the board file.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
11 years agoOMAPDSS: DSI: calculate dsi clock
Tomi Valkeinen [Fri, 10 Aug 2012 13:50:51 +0000 (16:50 +0300)]
OMAPDSS: DSI: calculate dsi clock

Currently the way to configure clocks related to DSI (both DSI and DISPC
clocks) happens via omapdss platform data. The reason for this is that
configuring the DSS clocks is a very complex problem, and it's
impossible for the SW to know requirements about things like
interference.

However, for general cases it should be fine to calculate the dividers
for clocks in the SW. The calculated clocks are probably not perfect,
but should work.

This patch adds support to calculate the dividers when using DSI command
mode panels. The panel gives the required DDR clock rate and LP clock
rate, and the DSI driver configures itself and DISPC accordingly.

This patch is somewhat ugly, though. The code does its job by modifying
the platform data where the clock dividers would be if the board file
gave them. This is not how it's going to be in the future, but allows us
to have quite simple patch and keep the backward compatibility.

It also allows the developer to still give the exact dividers from the
board file when there's need for that, as long as the panel driver does
not override them.

There are also other areas for improvement. For example, it would be
better if the panel driver could ask for a DSI clock in a certain range,
as, at least command mode panels, the panel can work fine with many
different clock speeds.

While the patch is not perfect, it allows us to remove the hardcoded
clock dividers from the board file, making it easier to bring up a new
panel and to use device tree from omapdss.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: Add DSI fclk maximum to dss_features
Tomi Valkeinen [Thu, 16 Aug 2012 13:25:29 +0000 (16:25 +0300)]
OMAPDSS: Add DSI fclk maximum to dss_features

Add max value of DSI functional clock to dss_features, so that DSI
driver can use it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: HDMI: use vdda_hdmi_dac
Tomi Valkeinen [Wed, 15 Aug 2012 12:55:04 +0000 (15:55 +0300)]
OMAPDSS: HDMI: use vdda_hdmi_dac

The HDMI driver requires vdda_hdmi_dac power for operation, but does not
enable it. This has worked because the regulator has been always
enabled.

But this may not always be the case, as I encountered when implementing
HDMI device tree support.

This patch changes the HDMI driver to use the vdda_hdmi_dac.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAP4: TWL: add vdda_hdmi_dac regulator supply
Tomi Valkeinen [Wed, 15 Aug 2012 12:54:53 +0000 (15:54 +0300)]
OMAP4: TWL: add vdda_hdmi_dac regulator supply

HDMI requires vdda_hdmi_dac (vdac) power for operation. The regulator,
or the regulator supplying the vdac, has been enabled by default and
things have worked without the HDMI driver enabling the vdac.

I encountered the problem when implementing HDMI device tree support,
where the regulator was not enabled by default.

This patch adds the vdda_hdmi_dac to twl-common.c so that the HDMI
driver can use it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
11 years agoOMAPDSS: HDMI: Add delay to wait for 5V power
Tomi Valkeinen [Thu, 26 Apr 2012 11:58:41 +0000 (14:58 +0300)]
OMAPDSS: HDMI: Add delay to wait for 5V power

TPD12S015A spec says to wait 300us after setting CT_CP_HPD gpio for the
5V power output to reach 90% of the voltage. This patch adds the delay
to the driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
11 years agoOMAPDSS: HDMI: Move GPIO handling to HDMI driver
Tomi Valkeinen [Thu, 26 Apr 2012 11:48:32 +0000 (14:48 +0300)]
OMAPDSS: HDMI: Move GPIO handling to HDMI driver

We currently manage HDMI GPIOs in the board files via
platform_enable/disable calls. This won't work with device tree, and in
any case the correct place to manage the GPIOs is in the HDMI driver.

This patch moves the handling of the GPIOs to the HDMI driver. The GPIO
handling is moved to the common hdmi.c file, and this probably needs to
be revisited when adding OMAP5 HDMI support to see if the GPIO handling
needs to be moved to IP specific files.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>