[PATCH v2 18/60] drm/omap: dss: Allow looking up any device by port
Sebastian Reichel
sre at kernel.org
Sun Jun 10 19:25:02 UTC 2018
Hi,
On Sat, May 26, 2018 at 08:24:36PM +0300, Laurent Pinchart wrote:
> The omap_dss_find_output_by_port() function looks up an omap_dss_device
> by port from the list of devices registered as outputs. In preparation
> for looking up sinks in addition to sources, allow the function to look
> up any registered device. Rename it to omap_dss_find_device_by_port() to
> match its new purpose.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
Reviewed-by: Sebastian Reichel <sebastian.reichel at collabora.co.uk>
-- Sebastian
> drivers/gpu/drm/omapdrm/dss/base.c | 13 +++++++++++++
> drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 +-
> drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++--
> drivers/gpu/drm/omapdrm/dss/output.c | 13 -------------
> 4 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
> index 63fe0a717884..df6cb1ac43c8 100644
> --- a/drivers/gpu/drm/omapdrm/dss/base.c
> +++ b/drivers/gpu/drm/omapdrm/dss/base.c
> @@ -89,6 +89,19 @@ static bool omapdss_device_is_registered(struct device_node *node)
> return found;
> }
>
> +struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,
> + unsigned int port)
> +{
> + struct omap_dss_device *dssdev;
> +
> + list_for_each_entry(dssdev, &omapdss_devices_list, list) {
> + if (dssdev->dev->of_node == src && dssdev->port_num == port)
> + return omap_dss_get_device(dssdev);
> + }
> +
> + return NULL;
> +}
> +
> /* -----------------------------------------------------------------------------
> * Components Handling
> */
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss-of.c b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> index b51af09e9111..771b20db2d98 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss-of.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss-of.c
> @@ -74,7 +74,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
> return NULL;
>
> /* ... and finally the source. */
> - src = omap_dss_find_output_by_port(src_node, port_number);
> + src = omapdss_find_device_by_port(src_node, port_number);
> of_node_put(src_node);
>
> return src ? src : ERR_PTR(-EPROBE_DEFER);
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> index ff0f603bce76..2ec74206bcff 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -563,6 +563,8 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev);
>
> void omapdss_device_register(struct omap_dss_device *dssdev);
> void omapdss_device_unregister(struct omap_dss_device *dssdev);
> +struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,
> + unsigned int port);
>
> struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev);
> void omap_dss_put_device(struct omap_dss_device *dssdev);
> @@ -576,8 +578,6 @@ int omap_dss_get_num_overlays(void);
> int omapdss_register_output(struct omap_dss_device *output);
> void omapdss_unregister_output(struct omap_dss_device *output);
> struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
> -struct omap_dss_device *omap_dss_find_output_by_port(struct device_node *src,
> - unsigned int port);
> int omapdss_output_set_device(struct omap_dss_device *out,
> struct omap_dss_device *dssdev);
> int omapdss_output_unset_device(struct omap_dss_device *out);
> diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
> index be254ea42e08..e659c8e5c419 100644
> --- a/drivers/gpu/drm/omapdrm/dss/output.c
> +++ b/drivers/gpu/drm/omapdrm/dss/output.c
> @@ -122,19 +122,6 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)
> }
> EXPORT_SYMBOL(omap_dss_get_output);
>
> -struct omap_dss_device *omap_dss_find_output_by_port(struct device_node *src,
> - unsigned int port)
> -{
> - struct omap_dss_device *out;
> -
> - list_for_each_entry(out, &output_list, output_list) {
> - if (out->dev->of_node == src && out->port_num == port)
> - return omap_dss_get_device(out);
> - }
> -
> - return NULL;
> -}
> -
> struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev)
> {
> while (dssdev->src)
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20180610/73de0636/attachment-0001.sig>
More information about the dri-devel
mailing list