Commit Graph

152 Commits

Author SHA1 Message Date
Tomi Valkeinen eba358435b OMAPDSS: Remove unused get_context_loss_count support
The omapdss driver no longer uses get_context_loss_count call, so we can
remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2014-02-28 12:35:43 +02:00
Tomi Valkeinen 9560dc1059 OMAPDSS: rename omap_dss_device's 'device' field to 'dst'
In the old panel device model we had omap_dss_output entities,
representing the encoders in the DSS block. This entity had "device"
field, which pointed to the panel that was using the omap_dss_output.

With the new panel device model, the omap_dss_output is integrated into
omap_dss_device, which now represents a "display entity". Thus the "device"
field, now in omap_dss_device, points to the next entity in the display
entity-chain.

This patch renames the "device" field to "dst", which much better tells
what the field points to.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-30 08:51:11 +03:00
Tomi Valkeinen a73fdc6474 OMAPDSS: rename omap_dss_device's 'output' to 'src'
In the old panel device model we had "outputs", which were the encoders
inside OMAP DSS block, and panel devices (omap_dss_device). The panel
devices had a reference to the source of the video data, i.e. reference
to an "output", in a field named "output".

That was somewhat confusing even in the old panel device model, but even
more so with the panel device model where we can have longer chains of
display entities.

This patch renames the "output" field to "src", which much better tells
what the field points to.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-30 08:51:10 +03:00
Tomi Valkeinen b3864299c1 OMAPDSS: DSS: remove legacy dss bus support
With all the old panels removed and all the old panel model APIs removed
from the DSS encoders, we can now remove the custom omapdss-bus which
was used in the old panel model.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-30 08:51:10 +03:00
Tomi Valkeinen c1e4535d43 OMAPDSS: RFBI: remove code related to old panel model
Now that the old panel drivers have been removed, we can remove the
old-model API and related code from the DSS encoder drivers.

This patch removes the code from the RFBI driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29 16:21:53 +03:00
Tomi Valkeinen cd6e915b36 OMAPDSS: SDI: remove code related to old panel model
Now that the old panel drivers have been removed, we can remove the
old-model API and related code from the DSS encoder drivers.

This patch removes the code from the SDI driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29 16:21:53 +03:00
Tomi Valkeinen 5cfc1c3cb6 OMAPDSS: DSI: remove code related to old panel model
Now that the old panel drivers have been removed, we can remove the
old-model API and related code from the DSS encoder drivers.

This patch removes the code from the DSI driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29 16:21:52 +03:00
Tomi Valkeinen 86a3efe150 OMAPDSS: DPI: remove code related to old panel model
Now that the old panel drivers have been removed, we can remove the
old-model API and related code from the DSS encoder drivers.

This patch removes the code from the DPI driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29 16:21:52 +03:00
Tomi Valkeinen 9453e79335 OMAPDSS: remove omap_dss_device->channel field
The 'channel' field in struct omap_dss_device is no longer used, and can
be removed.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-08-29 16:21:51 +03:00
Tomi Valkeinen deb16df884 OMAPDSS: DSI: Add ops
Add "ops" style method for using DSI functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:01:01 +03:00
Tomi Valkeinen 0b450c3131 OMAPDSS: HDMI: Add ops
Add "ops" style method for using HDMI functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:01:00 +03:00
Tomi Valkeinen fb8efa4966 OMAPDSS: AnalogTV: Add ops
Add "ops" style method for using analog TV functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:01:00 +03:00
Tomi Valkeinen 7700c2d4f7 OMAPDSS: DVI: Add ops
Add "ops" style method for using DVI functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:01:00 +03:00
Tomi Valkeinen b1082dfd61 OMAPDSS: SDI: Add ops
Add "ops" style method for using SDI functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:59 +03:00
Tomi Valkeinen 0b24edb1c7 OMAPDSS: DPI: Add ops
Add "ops" style method for using DPI functionality.

Ops style calls will allow us to have arbitrarily long display
pipelines, where each entity can call ops in the previous display
entity.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:59 +03:00
Tomi Valkeinen bc24b8b6d7 OMAPDSS: add OMAP_DISPLAY_TYPE_DVI
Add new display bus type for DVI. This is not used by omapdss driver
itself, but is used by external encoder chips that output DVI.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:58 +03:00
Tomi Valkeinen 5d47dbc852 OMAPDSS: public omapdss_register_output()
In order to allow multiple display block in a video pipeline, we need to
give the drivers way to register themselves. For now we have
the omapdss_register_display() which is used to register panels, and
dss_register_output() which is used to register DSS encoders.

This patch makes dss_register_output() public (with the name of
omapdss_register_output), which can be used to register also external
encoders. The distinction between register_output and register_display
is that a "display" is an entity at the end of the videopipeline, and
"output" is something inside the pipeline.

The registration and naming will be made saner in the future, but the
current names and functions are kept to minimize changes during the dss
device model transition.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:57 +03:00
Tomi Valkeinen 94954fcb80 OMAPDSS: remove unused fields in omap_dss_device
The use of platform callbacks, backlight, DSI TE and reset gpio from the
struct omap_dss_device has been removed. We can thus remove the fields
from omap_dss_device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:55 +03:00
Tomi Valkeinen d35317a42d OMAPDSS: add module_get/put to omap_dss_get/put_device()
omap_dss_get_device() should be called for omap_dss_device before it is
used to increase its refcount. Currently we only increase the refcount
for the underlying device.

This patch adds managing the ref count to the underlying module also,
which contains the ops for the omap_dss_device.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:52 +03:00
Tomi Valkeinen 4f3e44ea07 OMAPDSS: omapdss.h: add owner field to omap_dss_device
Add struct module *owner field to omap_dss_device, which points to the
module containing the ops for this omap_dss_device. This will be used to
manage the ref count for the module.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:52 +03:00
Tomi Valkeinen 1f68d9c4b6 OMAPDSS: combine omap_dss_output into omap_dss_device
We currently have omap_dss_device, which represents an external display
device, sometimes an external encoder, sometimes a panel. Then we have
omap_dss_output, which represents DSS's output encoder.

In the future with new display device model, we construct a video
pipeline from the display blocks. To accomplish this, all the blocks
need to be presented by the same entity.

Thus, this patch combines omap_dss_output into omap_dss_device. Some of
the fields in omap_dss_output are already found in omap_dss_device, but
some are not. This means we'll have DSS output specific fields in
omap_dss_device, which is not very nice. However, it is easier to just
keep those output specific fields there for now, and after transition to
new display device model is made, they can be cleaned up easier than
could be done now.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:51 +03:00
Tomi Valkeinen d392393393 OMAPDSS: remove omap_dss_start/stop_device()
The omap_dss_start_device() and omap_dss_stop_device(), called by the
DSS output drivers, are old relics. They originally did something
totally else, but nowadays they increase the module ref count for panels
that are enabled.

This model is quite broken: the panel modules may be used even before
they are enabled. For example, configuring the panel requires calls to
functions located in the panel modules.

In the following patches we try to improve the ref count management for
the modules and display devices. The first step, however, is to remove
the omap_dss_start/stop_device() totally.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:51 +03:00
Tomi Valkeinen ecc8b37089 OMAPDSS: Add panel dev pointer to dssdev
We are about to remove the dss bus support, which also means that the
omap_dss_device won't be a real device anymore. This means that the
embedded "dev" struct needs to be removed from omap_dss_device.

After we've finished the removal of the dss bus, we see the following
changes:

- struct omap_dss_device won't be a real Linux device anymore, but more
  like a "display entity".
- struct omap_dss_driver won't be a Linux device driver, but "display
  entity ops".
- The panel devices/drivers won't be omapdss devices/drivers, but
  platform/i2c/spi/etc devices/drivers, whichever fits the control
  mechanism of the panel.
- The panel drivers will create omap_dss_device and omap_dss_driver,
  fill the required fields, and register the omap_dss_device to
  omapdss.
- omap_dss_device won't have an embedded dev struct anymore, but a
  dev pointer to the actual device that manages the omap_dss_device.

The model described above resembles the model that has been discussed
with CDF (common display framework).

For the duration of the conversion, we temporarily have two devs in the
dssdev, the old "old_dev", which is a full embedded device struct, and the
new "dev", which is a pointer to the device. "old_dev" will be removed
in the future.

For devices belonging to dss bus the dev is initialized to point to
old_dev. This way all the code can just use the dev, for both old and
new style panels.

Both the new and old style panel drivers work during the conversion, and
only after the dss bus support is removed will the old style panels stop
to compile.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:50 +03:00
Tomi Valkeinen 2e7e3dc794 OMAPDSS: add panel list
We currently use the omapdss bus (which contains all the available
displays) to iterate the displays. As the omapdss bus is on its way out,
this needs to be changed.

Instead of using the dss bus to iterate displays, this patch adds our
own list of displays which we manage. The panels on the dss bus are
automatically added to this new list.

An "alias" field is also added to omap_dss_device. This field is
set to "display%d", the same way as omap_dss_device's dev name is set.
This alias is later used to keep backward compatibility, when the
embedded dev is no longer used.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:48 +03:00
Tomi Valkeinen 6fcd485b04 OMAPDSS: add videomode conversion support
Add helper functions to convert between omapdss specific video timings
and the common videomode.

Eventually omapdss will be changed to use only the common video timings,
and these helper functions will make the transition easier.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:47 +03:00
Tomi Valkeinen a7e71e7f9f OMAPDSS: Implement display (dis)connect support
We currently have two steps in panel initialization and startup: probing
and enabling. After the panel has been probed, it's ready and can be
configured and later enabled.

This model is not enough with more complex display pipelines, where we
may have, for example, two panels, of which only one can be used at a
time, connected to the same video output.

To support that kind of scenarios, we need to add new step to the
initialization: connect.

This patch adds support for connecting and disconnecting panels. After
probe, but before connect, no panel ops should be called. When the
connect is called, a proper video pipeline is established, and the panel
is ready for use. If some part in the video pipeline is already
connected (by some other panel), the connect call fails.

One key difference with the old style setup is that connect() handles
also connecting to the overlay manager. This means that the omapfb (or
omapdrm) no longer needs to figure out which overlay manager to use, but
it can just call connect() on the panel, and the proper overlay manager
is connected by omapdss.

This also allows us to add back the support for dynamic switching
between two exclusive panels. However, the current panel device model is
not changed to support this, as the new device model is implemented in
the following patches and the old model will be removed. The new device
model supports dynamic switching.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:43 +03:00
Tomi Valkeinen be8e8e1c62 OMAPDSS: add helpers to get mgr or output from display
Add two helper functions that can be used to find either the DSS output
or the overlay manager that is connected to the given display.

This hides how the output and the manager are actually connected, making
it easier to change the connections in the future.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:42 +03:00
Tomi Valkeinen 12ca755ba1 OMAPDSS: add omap_dss_find_output_by_node()
Add a support function to find a DSS output by given DT node. This is
used in later patches to link the panels to DSS outputs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:40 +03:00
Tomi Valkeinen 805cc2d19c OMAPDSS: add omap_dss_find_output()
Add a support function to find a DSS output by given name. This is used
in later patches to link the panels to DSS outputs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-06-17 14:00:40 +03:00
Tomi Valkeinen 0a20012605 OMAPDSS: add pdata->default_display_name
We can currently set the default display (i.e. the initial display) in
the omapdss platform data by using a pointer to the default
omap_dss_device. Internally omapdss uses the device's name to resolve
the default display.

As it's difficult to get the omap_dss_device pointer in the future,
after we've changed the omapdss device model, this patch adds a new way
to define the default display, by using the name of the display.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-06-17 14:00:26 +03:00
Jean-Christophe PLAGNIOL-VILLARD 2436e8aa8a Merge branch 'fbdev-3.10-fixes' of git://gitorious.org/linux-omap-dss2/linux into linux-fbdev/for-3.10-fixes
Pull Tomi fixes for ps3fb and omap2

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2013-05-29 17:00:34 +08:00
Tomi Valkeinen 591a0ac7f1 OMAPDSS: Fix crash with DT boot
When booting with DT, there's a crash when omapfb is probed. This is
caused by the fact that omapdss+DT is not yet supported, and thus
omapdss is not probed at all. On the other hand, omapfb is always
probed. When omapfb tries to use omapdss, there's a NULL pointer
dereference crash. The same error should most likely happen with omapdrm
and omap_vout also.

To fix this, add an "initialized" state to omapdss. When omapdss has
been probed, it's marked as initialized. omapfb, omapdrm and omap_vout
check this state when they are probed to see that omapdss is actually
there.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
2013-05-23 12:54:21 +03:00
Tomi Valkeinen 77d3595b29 OMAPDSS: remove dsi videomode from dssdev
DSI videomode is no longer needed in the omap_dss_device, so remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03 15:19:18 +03:00
Tomi Valkeinen f1e0001f97 OMAPDSS: DSI: use new clock calculation code
Use the new clock calculation code in the DSI driver.

The new code does not need DSI video mode parameters from the panel
driver, like the old code does. Instead the new code is given the normal
video timings, and a few DSI parameters, which are used to create DSI
video timings.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03 15:19:18 +03:00
Tomi Valkeinen 478d7df8af OMAPDSS: DSI: add enum omap_dss_dsi_trans_mode
Instead of managing DSI sync ends with booleans, add an enum for the DSI
transfer mode. This is much cleaner way to handle the DSI syncs.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03 15:19:17 +03:00
Tomi Valkeinen 777f05cc79 OMAPDSS: DSI: simplify dsi configuration
We have a bunch of dsi functions that are used to do the basic
configuration for DSI. To simplify things, and to make sure we have all
the necessary information, create a single dsi config function, which
does the basic configuration.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-03 15:19:17 +03:00
Tomi Valkeinen 2eea5ae6c1 OMAPDSS: add output->dispc_channel
The DISPC channel used for each output is currently passed in panel
platform data from the board files.

To simplify this, and to make the panel drivers less dependent on OMAP,
this patch changes omapdss to resolve the channel independently. The
channel is resolved based on the OMAP version and, in case of DSI, the
DSI module id. This resolved channel is stored into a new field in
output, dispc_channel.

The few places where dssdev->channel was used are changed to use
output->recommended_channel. After this patch, dssdev->channel is
obsolete.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03 15:19:01 +03:00
Tomi Valkeinen 7286a08fb5 OMAPDSS: add output->name
Add name field to omapdss's outputs so that in the following patches
panels refer to the output by their name. The name also helps debugging.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03 15:19:01 +03:00
Tomi Valkeinen 4fdfdf062d OMAPDSS: HDMI: remove HDMI clk divisors from dssdev
struct omap_dss_device contains HDMI clock divisors. The idea is that the
board file can pass precalculated divisors to the display driver.
However, these divsors are no longer needed, as the omapdss driver can
calculate the divisors during runtime.

This patch removes the divisors from omap_dss_device, and their uses
from the hdmi driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03 15:19:00 +03:00
Tomi Valkeinen a0d269ec0b OMAPDSS: DSI: remove DSI & DISPC clk divisors from dssdev
struct omap_dss_device contains DSS clock divisors. The idea is that the
board file can pass precalculated divisors to the display driver.
However, these divsors are no longer needed, as the omapdss driver can
calculate the divisors during runtime.

This patch removes the divisors from omap_dss_device, and their uses
from the dsi driver.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Archit Taneja <archit@ti.com>
2013-04-03 15:19:00 +03:00
Tomi Valkeinen 348be69d30 OMAPDSS: export dispc functions
Export DISPC functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07 17:06:00 +02:00
Tomi Valkeinen eda3427363 OMAPDSS: export dss_feat functions
Export dss_features related functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07 17:05:59 +02:00
Tomi Valkeinen a97a963475 OMAPDSS: export dss_mgr_ops functions
Export dss_mgr_ops related functions.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07 17:05:59 +02:00
Tomi Valkeinen 549acbe7a3 OMAPDSS: move omap_dispc_wait_for_irq_interruptible_timeout to dispc-compat.c
We have two functions to wait for a dispc interrupt:

int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout);
int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask,

Of these, the former is not used at all, and can be removed. The latter
is only used by the compat layer, and can be moved to the compat layer
code.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07 17:05:56 +02:00
Tomi Valkeinen 8dd2491a42 OMAPDSS: add omapdss_compat_init()
Add two new exported functions, omapdss_compat_init and
omapdss_compat_uninit, which are to be used by omapfb, omap_vout to
enable compatibility mode for omapdss. The functions are called by
omapdss internally for now, and moved to other drivers later.

The compatibility mode is implemented fully in the following patches.
For now, enabling compat mode only sets up the private data in apply.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-12-07 17:05:53 +02:00
Tomi Valkeinen 9296dbd79e Merge branch '3.8/misc-2'
Merge omapdss miscellaneous patches.
2012-11-05 11:11:50 +02:00
Tomi Valkeinen 2bbcce5e0b OMAPDSS: export dss_get_def_display_name()
Export dss_get_def_display_name() with the name of
omapdss_get_def_display_name() so that omapfb can use it after the next
patch which moves default display handling to omapfb.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-29 12:40:46 +02:00
Tomi Valkeinen b2c7d54f72 OMAPDSS: get the dss version from core pdev
The output drivers get the omapdss hw version from the platform data for
their respective output device. This doesn't work with DT, as there's no
platform data for them.

Add a new function, omapdss_get_version(), which returns the dss version
from the core device, which will have platform data on DT also. The
function is exported so that users of omapdss can also use it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-24 08:48:16 +03:00
Tomi Valkeinen 998c336d4c OMAPDSS: remove omap_dss_device's suspend/resume
The panel drivers contain enable, disable, suspend and resume calls.
The suspend and resume are effectively identical to disable and enable.

This patch removes panel suspend and enable code from omapdss and the
panel drivers, and replaces their use with enable and disable.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-24 08:46:23 +03:00
Archit Taneja 5028ea04c8 OMAPDSS: Remove acb and acbi fields from omap_dss_device
acbi and acb fields were meant for passive matrix panels which omapdss
doesn't support any longer. Remove these fields from omap_dss_device
struct.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2012-10-22 09:49:31 +03:00