Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Manasi Navare <manasi.d.navare@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Nuke drm_crtc_state and use intel_atomic_state instead
Date: Fri, 12 Apr 2019 12:58:50 -0700	[thread overview]
Message-ID: <20190412195850.GE17858@intel.com> (raw)
In-Reply-To: <20190412061158.GE3888@intel.com>

On Fri, Apr 12, 2019 at 09:11:58AM +0300, Ville Syrjälä wrote:
> On Thu, Apr 11, 2019 at 04:02:54PM -0700, Manasi Navare wrote:
> > This is one of the patches to start replacing drm pointers
> > and use the intel_atomic_state and intel_crtc to derive
> > the necessary intel state variables required for the intel
> > modeset functions.
> > 
> > Suggested-by: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> > Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 38 +++++++++++++---------------
> >  1 file changed, 18 insertions(+), 20 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index f29a348e8d71..062b9e86a987 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -125,8 +125,8 @@ static void vlv_prepare_pll(struct intel_crtc *crtc,
> >  			    const struct intel_crtc_state *pipe_config);
> >  static void chv_prepare_pll(struct intel_crtc *crtc,
> >  			    const struct intel_crtc_state *pipe_config);
> > -static void intel_begin_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
> > -static void intel_finish_crtc_commit(struct drm_crtc *, struct drm_crtc_state *);
> > +static void intel_begin_crtc_commit(struct intel_crtc *, struct intel_atomic_state *);
> > +static void intel_finish_crtc_commit(struct intel_crtc *, struct intel_atomic_state *);
> >  static void intel_crtc_init_scalers(struct intel_crtc *crtc,
> >  				    struct intel_crtc_state *crtc_state);
> >  static void skylake_pfit_enable(const struct intel_crtc_state *crtc_state);
> > @@ -13273,14 +13273,14 @@ static void intel_update_crtc(struct drm_crtc *crtc,
> >  	else if (new_plane_state)
> >  		intel_fbc_enable(intel_crtc, pipe_config, new_plane_state);
> >  
> > -	intel_begin_crtc_commit(crtc, old_crtc_state);
> > +	intel_begin_crtc_commit(intel_crtc, to_intel_atomic_state(state));
> >  
> >  	if (INTEL_GEN(dev_priv) >= 9)
> >  		skl_update_planes_on_crtc(to_intel_atomic_state(state), intel_crtc);
> >  	else
> >  		i9xx_update_planes_on_crtc(to_intel_atomic_state(state), intel_crtc);
> >  
> > -	intel_finish_crtc_commit(crtc, old_crtc_state);
> > +	intel_finish_crtc_commit(intel_crtc, to_intel_atomic_state(state));
> >  }
> >  
> >  static void intel_update_crtcs(struct drm_atomic_state *state)
> > @@ -14070,18 +14070,16 @@ skl_max_scale(const struct intel_crtc_state *crtc_state,
> >  	return max_scale;
> >  }
> >  
> > -static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> > -				    struct drm_crtc_state *old_crtc_state)
> > +static void intel_begin_crtc_commit(struct intel_crtc *crtc,
> > +				    struct intel_atomic_state *state)
> 
> Flip the arguments around to be consistent with existing code.

But most functions have the modeset object (crtc, plane etc) as the first argument
then the state.
Do you still want to flip the arguments?

Manasi

> 
> >  {
> > -	struct drm_device *dev = crtc->dev;
> > +	struct drm_device *dev = crtc->base.dev;
> 
> That can be killed as well.
> 
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> > -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> >  	struct intel_crtc_state *old_intel_cstate =
> 
> Please rename to old_crtc_state, and similarly for new_crtc_state.
> 
> > -		to_intel_crtc_state(old_crtc_state);
> > -	struct intel_atomic_state *old_intel_state =
> > -		to_intel_atomic_state(old_crtc_state->state);
> > +		intel_atomic_get_old_crtc_state(state,
> > +						crtc);
> 
> Too many newlines.
> 
> >  	struct intel_crtc_state *intel_cstate =
> > -		intel_atomic_get_new_crtc_state(old_intel_state, intel_crtc);
> > +		intel_atomic_get_new_crtc_state(state, crtc);
> >  	bool modeset = needs_modeset(&intel_cstate->base);
> >  
> >  	/* Perform vblank evasion around commit operation */
> > @@ -14101,7 +14099,7 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc,
> >  
> >  out:
> >  	if (dev_priv->display.atomic_update_watermarks)
> > -		dev_priv->display.atomic_update_watermarks(old_intel_state,
> > +		dev_priv->display.atomic_update_watermarks(state,
> >  							   intel_cstate);
> >  }
> >  
> > @@ -14121,21 +14119,21 @@ void intel_crtc_arm_fifo_underrun(struct intel_crtc *crtc,
> >  	}
> >  }
> >  
> > -static void intel_finish_crtc_commit(struct drm_crtc *crtc,
> > -				     struct drm_crtc_state *old_crtc_state)
> > +static void intel_finish_crtc_commit(struct intel_crtc *crtc,
> > +				     struct intel_atomic_state *state)
> >  {
> > -	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
> > -	struct intel_atomic_state *old_intel_state =
> > -		to_intel_atomic_state(old_crtc_state->state);
> > +	struct drm_crtc_state *old_crtc_state =
> 
> Pls convert this to intel type as well.
> 
> > +		&intel_atomic_get_old_crtc_state(state,
> > +						crtc)->base;
> >  	struct intel_crtc_state *new_crtc_state =
> > -		intel_atomic_get_new_crtc_state(old_intel_state, intel_crtc);
> > +		intel_atomic_get_new_crtc_state(state, crtc);
> >  
> >  	intel_pipe_update_end(new_crtc_state);
> >  
> >  	if (new_crtc_state->update_pipe &&
> >  	    !needs_modeset(&new_crtc_state->base) &&
> >  	    old_crtc_state->mode.private_flags & I915_MODE_FLAG_INHERITED)
> > -		intel_crtc_arm_fifo_underrun(intel_crtc, new_crtc_state);
> > +		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
> >  }
> >  
> >  /**
> > -- 
> > 2.19.1
> 
> -- 
> Ville Syrjälä
> Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-04-12 19:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 23:02 [PATCH] drm/i915: Nuke drm_crtc_state and use intel_atomic_state instead Manasi Navare
2019-04-12  0:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-04-12  6:11 ` [PATCH] " Ville Syrjälä
2019-04-12 19:58   ` Manasi Navare [this message]
2019-04-12 21:22 ` [PATCH v2] " Manasi Navare
2019-04-15 12:17   ` Ville Syrjälä
2019-04-15 18:15     ` Manasi Navare
2019-04-15 18:22   ` [PATCH v3] " Manasi Navare
2019-04-15 20:02     ` Manasi Navare
2019-04-12 22:33 ` ✓ Fi.CI.BAT: success for drm/i915: Nuke drm_crtc_state and use intel_atomic_state instead (rev2) Patchwork
2019-04-13  2:30 ` ✓ Fi.CI.IGT: " Patchwork
2019-04-15 18:56 ` ✓ Fi.CI.BAT: success for drm/i915: Nuke drm_crtc_state and use intel_atomic_state instead (rev3) Patchwork
2019-04-15 20:00 ` ✗ Fi.CI.IGT: failure " Patchwork

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=20190412195850.GE17858@intel.com \
    --to=manasi.d.navare@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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