[PATCH 04/38] drm/rcar-du: Use for_each_*_in_state

Daniel Vetter daniel at ffwll.ch
Thu Jun 2 13:48:13 UTC 2016


On Thu, Jun 02, 2016 at 03:14:30PM +0200, Maarten Lankhorst wrote:
> 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>

Fixed up&applied, thanks for the review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list