Hi,
On Wed, Jun 06, 2018 at 12:36:33PM +0300, Laurent Pinchart wrote:
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: Laurent Pinchart laurent.pinchart@ideasonboard.com
Reviewed-by: Sebastian Reichel sebastian.reichel@collabora.co.uk
-- Sebastian
drivers/gpu/drm/omapdrm/dss/base.c | 4 ++-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index cce09a48d769..6a73d3559257 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -165,7 +165,7 @@ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, * Filter out non-display entries if display_only is set, and * non-output entries if output_only is set. */
if (display_only && !dssdev->driver)
if (output_only && (!dssdev->id || !dssdev->next)) continue;if (display_only && dssdev->output_type) continue;
@@ -224,7 +224,7 @@ void omapdss_device_disconnect(struct omap_dss_device *src, dev_dbg(src->dev, "disconnect\n");
if (!omapdss_device_is_connected(dst)) {
WARN_ON(!dst->driver);
return; }WARN_ON(dst->output_type);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 3bfb62b28a77..ae30802f2151 100644 --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h @@ -401,6 +401,12 @@ struct omap_dss_device { unsigned int alias_id;
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;
const char *name;
-- Regards,
Laurent Pinchart
dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel