From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: tomi.valkeinen@ti.com, dri-devel@lists.freedesktop.org
Subject: Re: [RFC 5/7] drm/omap: Do dss_device (display) ordering in omap_drv.c
Date: Fri, 01 Sep 2017 14:32:06 +0300 [thread overview]
Message-ID: <2510999.llnHGBdv16@avalon> (raw)
In-Reply-To: <20170829073218.11097-6-peter.ujfalusi@ti.com>
Hi Peter,
Thank you for the patch.
On Tuesday, 29 August 2017 10:32:16 EEST Peter Ujfalusi wrote:
> Sort the dssdev array based on DT aliases.
>
> With this change we can remove the panel ordering from dss/display.c and
> have all sorting related to dssdevs in one place.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
> ---
> drivers/gpu/drm/omapdrm/omap_drv.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 32dc0e88220f..0e100a359d26
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -18,6 +18,8 @@
> */
>
> #include <linux/sys_soc.h>
> +#include <linux/sort.h>
> +#include <linux/of.h>
Please keep this list alphabetically sorted.
> #include <drm/drm_atomic.h>
> #include <drm/drm_atomic_helper.h>
> @@ -162,6 +164,22 @@ static void omap_disconnect_dssdevs(struct drm_device
> *ddev) priv->num_dssdevs = 0;
> }
>
> +static int omap_compare_dssdevs(const void *a, const void *b)
> +{
> + const struct omap_dss_device *dssdev1 = *(struct omap_dss_device **)a;
> + const struct omap_dss_device *dssdev2 = *(struct omap_dss_device **)b;
> + int id1, id2;
> +
> + id1 = of_alias_get_id(dssdev1->dev->of_node, "display");
> + id2 = of_alias_get_id(dssdev2->dev->of_node, "display");
Getting the alias id is a bit costly, how about caching them ?
> + if (id1 > id2)
> + return 1;
> + else if (id1 < id2)
> + return -1;
> + return 0;
> +}
> +
> static void omap_collect_dssdevs(struct drm_device *ddev)
> {
> struct omap_drm_private *priv = ddev->dev_private;
> @@ -176,6 +194,10 @@ static void omap_collect_dssdevs(struct drm_device
> *ddev) break;
> }
> }
> +
> + /* Sort the list by DT aliases */
> + sort(priv->dssdevs, priv->num_dssdevs, sizeof(priv->dssdevs[0]),
> + omap_compare_dssdevs, NULL);
> }
>
> static int omap_connect_dssdevs(struct drm_device *ddev)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-09-01 13:13 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-29 7:32 [RFC 0/7] drm/omap: Module parameter for display order configuration Peter Ujfalusi
2017-08-29 7:32 ` [RFC 1/7] drm/omap: Use devm_kzalloc() to allocate omap_drm_private Peter Ujfalusi
2017-09-01 11:10 ` Laurent Pinchart
2017-09-04 9:13 ` Peter Ujfalusi
2017-09-04 9:41 ` Laurent Pinchart
2017-09-04 11:16 ` Peter Ujfalusi
2017-09-04 14:19 ` Laurent Pinchart
2017-09-05 6:35 ` Peter Ujfalusi
2017-08-29 7:32 ` [RFC 2/7] drm/omap: Allocate drm_device earlier and unref it as last step Peter Ujfalusi
2017-09-01 11:12 ` Laurent Pinchart
2017-08-29 7:32 ` [RFC 3/7] drm/omap: Manage the usable omap_dss_device list within omap_drm_private Peter Ujfalusi
2017-09-01 11:27 ` Laurent Pinchart
2017-09-04 9:19 ` Peter Ujfalusi
2017-09-04 9:45 ` Laurent Pinchart
2017-08-29 7:32 ` [RFC 4/7] drm/omap: Separate the dssdevs array setup from the connect function Peter Ujfalusi
2017-08-29 7:32 ` [RFC 5/7] drm/omap: Do dss_device (display) ordering in omap_drv.c Peter Ujfalusi
2017-09-01 11:32 ` Laurent Pinchart [this message]
2017-09-04 9:26 ` Peter Ujfalusi
2017-09-04 9:46 ` Laurent Pinchart
2017-08-29 7:32 ` [RFC 6/7] drm/omap: dss: Remove display ordering from dss/display.c Peter Ujfalusi
2017-08-29 7:32 ` [RFC 7/7] drm/omap: Add kernel parameter to specify the desired display order Peter Ujfalusi
2017-09-01 11:36 ` [RFC 0/7] drm/omap: Module parameter for display order configuration Laurent Pinchart
2017-09-04 10:03 ` Peter Ujfalusi
2018-05-25 20:09 ` Laurent Pinchart
2017-10-05 9:56 ` Pekka Paalanen
2017-10-05 10:01 ` Tomi Valkeinen
2017-10-05 10:43 ` Pekka Paalanen
2017-10-05 11:24 ` Tomi Valkeinen
2017-10-05 11:54 ` Pekka Paalanen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2510999.llnHGBdv16@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=peter.ujfalusi@ti.com \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).