From: Ulrich Hecht <uli@fpond.eu>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>
Subject: Re: [PATCH v3 07/10] drm: rcar-du: Provide for_each_group helper
Date: Tue, 18 Jun 2019 15:15:10 +0200 (CEST) [thread overview]
Message-ID: <197277619.790831.1560863710263@webmail.strato.com> (raw)
In-Reply-To: <20190617210930.6054-8-laurent.pinchart+renesas@ideasonboard.com>
> On June 17, 2019 at 11:09 PM Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> wrote:
>
>
> From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>
> Refactoring of the group control code will soon require more iteration
> over the available groups. Simplify this process by introducing a group
> iteration helper.
>
> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
> Changes since v2:
>
> - Don't assign __group in the condition part of the for statement of the
> for_each_rcdu_group() macro
> ---
> drivers/gpu/drm/rcar-du/rcar_du_drv.h | 5 +++++
> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 10 ++--------
> 2 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.h b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> index 1327cd0df90a..0cc0984bf2ea 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.h
> @@ -96,6 +96,11 @@ struct rcar_du_device {
> unsigned int vspd1_sink;
> };
>
> +#define for_each_rcdu_group(__rcdu, __group, __i) \
> + for ((__i) = 0, (__group) = &(__rcdu)->groups[0]; \
> + (__i) < DIV_ROUND_UP((__rcdu)->num_crtcs, 2); \
> + __i++, __group++)
> +
> static inline bool rcar_du_has(struct rcar_du_device *rcdu,
> unsigned int feature)
> {
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> index 144c0c1b1591..c04136674e58 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> @@ -627,9 +627,9 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
>
> struct drm_device *dev = rcdu->ddev;
> struct drm_encoder *encoder;
> + struct rcar_du_group *rgrp;
> unsigned int dpad0_sources;
> unsigned int num_encoders;
> - unsigned int num_groups;
> unsigned int swindex;
> unsigned int hwindex;
> unsigned int i;
> @@ -670,11 +670,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
> return ret;
>
> /* Initialize the groups. */
> - num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2);
> -
> - for (i = 0; i < num_groups; ++i) {
> - struct rcar_du_group *rgrp = &rcdu->groups[i];
> -
> + for_each_rcdu_group(rcdu, rgrp, i) {
> mutex_init(&rgrp->lock);
>
> rgrp->dev = rcdu;
> @@ -711,8 +707,6 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
>
> /* Create the CRTCs. */
> for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) {
> - struct rcar_du_group *rgrp;
> -
> /* Skip unpopulated DU channels. */
> if (!(rcdu->info->channels_mask & BIT(hwindex)))
> continue;
> --
> Regards,
>
> Laurent Pinchart
>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
next prev parent reply other threads:[~2019-06-18 13:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 21:09 [PATCH v3 00/10] drm: rcar-du: Rework CRTC and groups for atomic commits Laurent Pinchart
2019-06-17 21:09 ` [PATCH v3 01/10] media: vsp1: drm: Split vsp1_du_setup_lif() Laurent Pinchart
2019-06-18 12:32 ` Ulrich Hecht
2019-06-18 13:46 ` Laurent Pinchart
2019-06-17 21:09 ` [PATCH v3 02/10] media: vsp1: drm: Don't configure hardware when the pipeline is disabled Laurent Pinchart
2019-06-18 12:31 ` Kieran Bingham
2019-06-18 12:35 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 03/10] drm: rcar-du: Convert to the new VSP atomic API Laurent Pinchart
2019-06-18 12:39 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 04/10] media: vsp1: drm: Remove vsp1_du_setup_lif() Laurent Pinchart
2019-06-18 12:40 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 05/10] drm: rcar-du: Handle CRTC standby from commit tail handler Laurent Pinchart
2019-06-18 13:03 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 06/10] drm: rcar-du: Handle CRTC configuration " Laurent Pinchart
2019-06-18 13:11 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 07/10] drm: rcar-du: Provide for_each_group helper Laurent Pinchart
2019-06-18 10:43 ` Kieran Bingham
2019-06-18 13:15 ` Ulrich Hecht [this message]
2019-06-17 21:09 ` [PATCH v3 08/10] drm: rcar-du: Create a group state object Laurent Pinchart
2019-06-18 13:36 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 09/10] drm: rcar-du: Perform group setup from the atomic tail handler Laurent Pinchart
2019-06-18 13:46 ` Ulrich Hecht
2019-06-17 21:09 ` [PATCH v3 10/10] drm: rcar-du: Centralise routing configuration in commit " Laurent Pinchart
2019-06-18 14:12 ` Ulrich Hecht
2019-06-18 14:41 ` Laurent Pinchart
2019-06-18 17:16 ` [PATCH v3 00/10] drm: rcar-du: Rework CRTC and groups for atomic commits Kieran Bingham
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=197277619.790831.1560863710263@webmail.strato.com \
--to=uli@fpond.eu \
--cc=dri-devel@lists.freedesktop.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/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