Commit 1298977f authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen

drm/omap: Check omap_dss_device type based on the output_type field

Various functions that need to differentiate between omap_dss_device
instances corresponding to displays and to internal encoders use the
omap_dss_device.driver field, which is only set for display instances.
This gets in the way of the omap_dss_device operations refactoring.
Replace that with a check based on the output_type field which is set
for all omap_dss_device instances but displays.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent a4e9ecf4
...@@ -164,7 +164,8 @@ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, ...@@ -164,7 +164,8 @@ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from,
* Accept display entities if the display type is requested, * Accept display entities if the display type is requested,
* and output entities if the output type is requested. * and output entities if the output type is requested.
*/ */
if ((type & OMAP_DSS_DEVICE_TYPE_DISPLAY) && dssdev->driver) if ((type & OMAP_DSS_DEVICE_TYPE_DISPLAY) &&
!dssdev->output_type)
goto done; goto done;
if ((type & OMAP_DSS_DEVICE_TYPE_OUTPUT) && dssdev->id && if ((type & OMAP_DSS_DEVICE_TYPE_OUTPUT) && dssdev->id &&
dssdev->next) dssdev->next)
...@@ -223,7 +224,7 @@ void omapdss_device_disconnect(struct omap_dss_device *src, ...@@ -223,7 +224,7 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
dev_dbg(dst->dev, "disconnect\n"); dev_dbg(dst->dev, "disconnect\n");
if (!dst->id && !omapdss_device_is_connected(dst)) { if (!dst->id && !omapdss_device_is_connected(dst)) {
WARN_ON(!dst->driver); WARN_ON(dst->output_type);
return; return;
} }
......
...@@ -406,6 +406,12 @@ struct omap_dss_device { ...@@ -406,6 +406,12 @@ struct omap_dss_device {
unsigned int alias_id; unsigned int alias_id;
enum omap_display_type type; enum omap_display_type type;
/*
* DSS output type that this device generates (for DSS internal devices)
* or requires (for external encoders). Must be OMAP_DISPLAY_TYPE_NONE
* for display devices (connectors and panels) and to non-zero value for
* all other devices.
*/
enum omap_display_type output_type; enum omap_display_type output_type;
const char *name; const char *name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment