[Intel-gfx] [PATCH 09/24] drm/i915: Handle a few more cases for crtc hw/uapi split

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Oct 4 13:31:54 UTC 2019


On Fri, Oct 04, 2019 at 01:34:59PM +0200, Maarten Lankhorst wrote:
> We are still looking at drm_crtc_state in a few places, convert those
> to use intel_crtc_state instead. Look at uapi/hw where appropriate.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> Reviewed-by: Matt Roper <matthew.d.roper at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 14 +++++++-------
>  drivers/gpu/drm/i915/display/intel_dp_mst.c  |  2 +-
>  drivers/gpu/drm/i915/display/intel_psr.c     |  4 ++--
>  3 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f555ff6b1f6a..fcd295ed80ed 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -16126,8 +16126,8 @@ static int intel_initial_commit(struct drm_device *dev)
>  {
>  	struct drm_atomic_state *state = NULL;
>  	struct drm_modeset_acquire_ctx ctx;
> -	struct drm_crtc *crtc;
> -	struct drm_crtc_state *crtc_state;
> +	struct intel_crtc *crtc;
> +	struct intel_crtc_state *crtc_state;

I'd prefer to lift most of this patch to before we do that state split
so it can be pushed out of the way.

>  	int ret = 0;
>  
>  	state = drm_atomic_state_alloc(dev);
> @@ -16139,15 +16139,15 @@ static int intel_initial_commit(struct drm_device *dev)
>  retry:
>  	state->acquire_ctx = &ctx;
>  
> -	drm_for_each_crtc(crtc, dev) {
> -		crtc_state = drm_atomic_get_crtc_state(state, crtc);
> +	for_each_intel_crtc(dev, crtc) {
> +		crtc_state = intel_atomic_get_crtc_state(state, crtc);
>  		if (IS_ERR(crtc_state)) {
>  			ret = PTR_ERR(crtc_state);
>  			goto out;
>  		}
>  
> -		if (crtc_state->active) {
> -			ret = drm_atomic_add_affected_planes(state, crtc);
> +		if (crtc_state->hw.active) {
> +			ret = drm_atomic_add_affected_planes(state, &crtc->base);
>  			if (ret)
>  				goto out;
>  
> @@ -16157,7 +16157,7 @@ static int intel_initial_commit(struct drm_device *dev)
>  			 * having a proper LUT loaded. Remove once we
>  			 * have readout for pipe gamma enable.
>  			 */
> -			crtc_state->color_mgmt_changed = true;
> +			crtc_state->uapi.color_mgmt_changed = true;
>  		}
>  	}
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index cecb7ba5b482..adf1d3895419 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -187,7 +187,7 @@ intel_dp_mst_atomic_check(struct drm_connector *connector,
>  
>  		if (!crtc_state ||
>  		    !drm_atomic_crtc_needs_modeset(crtc_state) ||
> -		    crtc_state->enable)
> +		    to_intel_crtc_state(crtc_state)->hw.enable)
>  			return 0;
>  	}
>  
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index 8988dbe8c19e..979e166f5639 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -1068,9 +1068,9 @@ static int intel_psr_fastset_force(struct drm_i915_private *dev_priv)
>  
>  		intel_crtc_state = to_intel_crtc_state(crtc_state);
>  
> -		if (crtc_state->active && intel_crtc_state->has_psr) {
> +		if (intel_crtc_state->hw.active && intel_crtc_state->has_psr) {
>  			/* Mark mode as changed to trigger a pipe->update() */
> -			crtc_state->mode_changed = true;
> +			intel_crtc_state->uapi.mode_changed = true;
>  			break;
>  		}
>  	}
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list