[Intel-gfx] [PATCH 04/38] drm/rcar-du: Use for_each_*_in_state
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Thu Jun 2 13:14:30 UTC 2016
Op 02-06-16 om 00:06 schreef Daniel Vetter:
> We want to hide drm_atomic_state internals better.
>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
> drivers/gpu/drm/rcar-du/rcar_du_kms.c | 8 ++++----
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 20 ++++++++------------
> 2 files changed, 12 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> index e70a4f33d970..f315c55c1f65 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
> @@ -288,6 +288,8 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
> {
> struct rcar_du_device *rcdu = dev->dev_private;
> struct rcar_du_commit *commit;
> + struct drm_crtc *crtc;
> + struct drm_crtc_state *crtc_state;
> unsigned int i;
> int ret;
>
> @@ -309,10 +311,8 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
> /* Wait until all affected CRTCs have completed previous commits and
> * mark them as pending.
> */
> - for (i = 0; i < dev->mode_config.num_crtc; ++i) {
> - if (state->crtcs[i])
> - commit->crtcs |= 1 << drm_crtc_index(state->crtcs[i]);
> - }
> + for_each_crtc_in_state(state, crtc, crtc_state, i)
> + commit->crtcs |= 1 << drm_crtc_index(crtc);
>
Maybe also change this one to _mask,
either way.
Reviewed-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
More information about the Intel-gfx
mailing list