diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-04 22:28:25 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:27 +0300 |
commit | f7e376aece4636afb0c4da5ce54d5e805ce47a76 (patch) | |
tree | acd5140259b66edaaef296be10ea53f76a318d17 /drivers/gpu/drm/omapdrm/dss/base.c | |
parent | 27d624527d99265c2df999af3615ff71c29d06f4 (diff) | |
download | lwn-f7e376aece4636afb0c4da5ce54d5e805ce47a76.tar.gz lwn-f7e376aece4636afb0c4da5ce54d5e805ce47a76.zip |
drm/omap: dss: Add for_each_dss_output() macro
Similarly to for_each_dss_display(), the for_each_dss_output() macro
iterates over all the DSS connected outputs.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/base.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/dss/base.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c index 67086cbb3e24..1dbd08e6e029 100644 --- a/drivers/gpu/drm/omapdrm/dss/base.c +++ b/drivers/gpu/drm/omapdrm/dss/base.c @@ -126,12 +126,13 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src, } /* - * Search for the next device starting at @from. If display_only is true, skip - * non-display devices. Release the reference to the @from device, and acquire - * a reference to the returned device if found. + * Search for the next device starting at @from. The type argument specfies + * which device types to consider when searching. Searching for multiple types + * is supported by and'ing their type flags. Release the reference to the @from + * device, and acquire a reference to the returned device if found. */ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, - bool display_only) + enum omap_dss_device_type type) { struct omap_dss_device *dssdev; struct list_head *list; @@ -159,8 +160,14 @@ struct omap_dss_device *omapdss_device_get_next(struct omap_dss_device *from, goto done; } - /* Filter out non-display entries if display_only is set. */ - if (!display_only || dssdev->driver) + /* + * Accept display entities if the display type is requested, + * and output entities if the output type is requested. + */ + if ((type & OMAP_DSS_DEVICE_TYPE_DISPLAY) && dssdev->driver) + goto done; + if ((type & OMAP_DSS_DEVICE_TYPE_OUTPUT) && dssdev->id && + dssdev->next) goto done; } |