All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 02/11] drm/i915: Remove hw.mode
Date: Mon, 18 Nov 2019 19:39:59 +0200	[thread overview]
Message-ID: <20191118173959.GW1208@intel.com> (raw)
In-Reply-To: <20191114160522.9699-2-maarten.lankhorst@linux.intel.com>

On Thu, Nov 14, 2019 at 05:05:13PM +0100, Maarten Lankhorst wrote:
> The members in hw.mode can be used from adjusted_mode as well,
> use that when available.
> 
> Some places that use hw.mode can be converted to use adjusted_mode
> as well.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c  | 49 ++++++++++---------
>  .../drm/i915/display/intel_display_types.h    |  2 +-
>  drivers/gpu/drm/i915/display/intel_dvo.c      |  2 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c     | 16 +++---
>  4 files changed, 34 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index adf50c4b38ad..18acecc3642d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -8440,9 +8440,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,
>  	tmp = I915_READ(PIPESRC(crtc->pipe));
>  	pipe_config->pipe_src_h = (tmp & 0xffff) + 1;
>  	pipe_config->pipe_src_w = ((tmp >> 16) & 0xffff) + 1;
> -
> -	pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h;
> -	pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w;
>  }
>  
>  void intel_mode_from_pipe_config(struct drm_display_mode *mode,
> @@ -12098,8 +12095,8 @@ static int icl_add_sync_mode_crtcs(struct intel_crtc_state *crtc_state)
>  			continue;
>  		if (!connector->has_tile)
>  			continue;
> -		if (crtc_state->hw.mode.hdisplay != connector->tile_h_size ||
> -		    crtc_state->hw.mode.vdisplay != connector->tile_v_size)
> +		if (crtc_state->hw.adjusted_mode.crtc_hdisplay != connector->tile_h_size ||
> +		    crtc_state->hw.adjusted_mode.crtc_vdisplay != connector->tile_v_size)
>  			return 0;
>  		if (connector->tile_h_loc == connector->num_h_tile - 1 &&
>  		    connector->tile_v_loc == connector->num_v_tile - 1)
> @@ -12506,7 +12503,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,
>  		intel_dump_infoframe(dev_priv, &pipe_config->infoframes.hdmi);
>  
>  	DRM_DEBUG_KMS("requested mode:\n");
> -	drm_mode_debug_printmodeline(&pipe_config->hw.mode);
> +	drm_mode_debug_printmodeline(&pipe_config->uapi.mode);
>  	DRM_DEBUG_KMS("adjusted mode:\n");
>  	drm_mode_debug_printmodeline(&pipe_config->hw.adjusted_mode);
>  	intel_dump_crtc_timings(&pipe_config->hw.adjusted_mode);
> @@ -12640,16 +12637,16 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_crtc_state *crtc_state)
>  {
>  	crtc_state->hw.enable = crtc_state->uapi.enable;
>  	crtc_state->hw.active = crtc_state->uapi.active;
> -	crtc_state->hw.mode = crtc_state->uapi.mode;
>  	crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;
>  	intel_crtc_copy_uapi_to_hw_state_nomodeset(crtc_state);
>  }
>  
> -static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state)
> +static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,
> +					     struct drm_display_mode *user_mode)
>  {
>  	crtc_state->uapi.enable = crtc_state->hw.enable;
>  	crtc_state->uapi.active = crtc_state->hw.active;
> -	WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0);
> +	WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, user_mode) < 0);
>  
>  	crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;
>  
> @@ -12702,6 +12699,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)
>  	memcpy(crtc_state, saved_state, sizeof(*crtc_state));
>  	kfree(saved_state);
>  
> +	/* Clear I915_MODE_FLAG_INHERITED */
> +	crtc_state->uapi.mode.private_flags = 0;
> +	crtc_state->uapi.adjusted_mode.private_flags = 0;
> +
>  	intel_crtc_copy_uapi_to_hw_state(crtc_state);
>  
>  	return 0;
> @@ -12750,7 +12751,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)
>  	 * computation to clearly distinguish it from the adjusted mode, which
>  	 * can be changed by the connectors in the below retry loop.
>  	 */
> -	drm_mode_get_hv_timing(&pipe_config->hw.mode,
> +	drm_mode_get_hv_timing(&pipe_config->hw.pipe_mode,
>  			       &pipe_config->pipe_src_w,
>  			       &pipe_config->pipe_src_h);
>  
> @@ -12852,6 +12853,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)
>  	 */
>  	pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode;
>  
> +	/* without bigjoiner, pipe_mode == adjusted_mode */
> +	pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;
>  	return 0;
>  }
>  
> @@ -12995,8 +12998,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>  	bool ret = true;
>  	u32 bp_gamma = 0;
>  	bool fixup_inherited = fastset &&
> -		(current_config->hw.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
> -		!(pipe_config->hw.mode.private_flags & I915_MODE_FLAG_INHERITED);
> +		(current_config->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED) &&
> +		!(pipe_config->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED);
>  
>  	if (fixup_inherited && !fastboot_enabled(dev_priv)) {
>  		DRM_DEBUG_KMS("initial modeset and fastboot not set\n");
> @@ -14106,8 +14109,8 @@ static int intel_atomic_check(struct drm_device *dev,
>  	/* Catch I915_MODE_FLAG_INHERITED */
>  	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
>  					    new_crtc_state, i) {
> -		if (new_crtc_state->hw.mode.private_flags !=
> -		    old_crtc_state->hw.mode.private_flags)
> +		if (new_crtc_state->hw.adjusted_mode.private_flags !=
> +		    old_crtc_state->hw.adjusted_mode.private_flags)
>  			new_crtc_state->uapi.mode_changed = true;
>  	}
>  
> @@ -14361,7 +14364,7 @@ static void intel_update_crtc(struct intel_crtc *crtc,
>  	 * of enabling them on the CRTC's first fastset.
>  	 */
>  	if (new_crtc_state->update_pipe && !modeset &&
> -	    old_crtc_state->hw.mode.private_flags & I915_MODE_FLAG_INHERITED)
> +	    old_crtc_state->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED)
>  		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
>  }
>  
> @@ -14558,7 +14561,7 @@ static void intel_post_crtc_enable_updates(struct intel_crtc *crtc,
>  	 * of enabling them on the CRTC's first fastset.
>  	 */
>  	if (new_crtc_state->update_pipe && !modeset &&
> -	    old_crtc_state->hw.mode.private_flags & I915_MODE_FLAG_INHERITED)
> +	    old_crtc_state->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED)
>  		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
>  }
>  
> @@ -17524,15 +17527,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
>  		int min_cdclk = 0;
>  
>  		if (crtc_state->hw.active) {
> -			struct drm_display_mode *mode = &crtc_state->hw.mode;
> +			struct drm_display_mode mode;
>  
>  			intel_mode_from_pipe_config(&crtc_state->hw.adjusted_mode,
>  						    crtc_state);
>  
> -			*mode = crtc_state->hw.adjusted_mode;
> -			mode->hdisplay = crtc_state->pipe_src_w;
> -			mode->vdisplay = crtc_state->pipe_src_h;
> -
>  			/*
>  			 * The initial mode needs to be set in order to keep
>  			 * the atomic core happy. It wants a valid mode if the
> @@ -17542,13 +17541,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
>  			 * set a flag to indicate that a full recalculation is
>  			 * needed on the next commit.
>  			 */
> -			mode->private_flags = I915_MODE_FLAG_INHERITED;
> +			crtc_state->hw.adjusted_mode.private_flags = I915_MODE_FLAG_INHERITED;
> +
> +			mode = crtc_state->hw.adjusted_mode;
> +			mode.hdisplay = crtc_state->pipe_src_w;
> +			mode.vdisplay = crtc_state->pipe_src_h;
>  
>  			intel_crtc_compute_pixel_rate(crtc_state);
>  
>  			intel_crtc_update_active_timings(crtc_state);
>  
> -			intel_crtc_copy_hw_to_uapi_state(crtc_state);
> +			intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode);
>  		}
>  
>  		for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 83ea04149b77..0f20c7190eed 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -802,7 +802,7 @@ struct intel_crtc_state {
>  	struct {
>  		bool active, enable;
>  		struct drm_property_blob *degamma_lut, *gamma_lut, *ctm;
> -		struct drm_display_mode mode, adjusted_mode;
> +		struct drm_display_mode adjusted_mode;
>  	} hw;
>  
>  	/**
> diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c
> index a74dc5b915d1..ad8e9959d6e1 100644
> --- a/drivers/gpu/drm/i915/display/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_dvo.c
> @@ -207,7 +207,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder,
>  	u32 temp = I915_READ(dvo_reg);
>  
>  	intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev,
> -					 &pipe_config->hw.mode,
> +					 &pipe_config->hw.adjusted_mode,
>  					 &pipe_config->hw.adjusted_mode);

This looks very wrong.

>  
>  	I915_WRITE(dvo_reg, temp | DVO_ENABLE);
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index a4b1339fcc00..4ba7648a3145 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -1213,7 +1213,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
>  static bool
>  intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
>  				    struct intel_sdvo_connector *intel_sdvo_connector,
> -				    const struct drm_display_mode *mode,
>  				    struct drm_display_mode *adjusted_mode)
>  {
>  	struct intel_sdvo_dtd input_dtd;
> @@ -1224,9 +1223,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
>  
>  	if (!intel_sdvo_create_preferred_input_timing(intel_sdvo,
>  						      intel_sdvo_connector,
> -						      mode->clock / 10,
> -						      mode->hdisplay,
> -						      mode->vdisplay))
> +						      adjusted_mode->clock / 10,
> +						      adjusted_mode->hdisplay,
> +						      adjusted_mode->vdisplay))
>  		return false;
>  
>  	if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,
> @@ -1277,7 +1276,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  	struct intel_sdvo_connector *intel_sdvo_connector =
>  		to_intel_sdvo_connector(conn_state->connector);
>  	struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
> -	struct drm_display_mode *mode = &pipe_config->hw.mode;
>  
>  	DRM_DEBUG_KMS("forcing bpc to 8 for SDVO\n");
>  	pipe_config->pipe_bpp = 8*3;
> @@ -1293,12 +1291,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  	 * the sequence to do it. Oh well.
>  	 */
>  	if (IS_TV(intel_sdvo_connector)) {
> -		if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode))
> +		if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo,
> +							     adjusted_mode))
>  			return -EINVAL;
>  
>  		(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
>  							   intel_sdvo_connector,
> -							   mode,
>  							   adjusted_mode);
>  		pipe_config->sdvo_tv_clock = true;
>  	} else if (IS_LVDS(intel_sdvo_connector)) {
> @@ -1308,7 +1306,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  
>  		(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
>  							   intel_sdvo_connector,
> -							   mode,
>  							   adjusted_mode);
>  	}
>  
> @@ -1435,7 +1432,6 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
>  		to_intel_sdvo_connector_state(conn_state);
>  	const struct intel_sdvo_connector *intel_sdvo_connector =
>  		to_intel_sdvo_connector(conn_state->connector);
> -	const struct drm_display_mode *mode = &crtc_state->hw.mode;
>  	struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder);
>  	u32 sdvox;
>  	struct intel_sdvo_in_out_map in_out;
> @@ -1468,7 +1464,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
>  		intel_sdvo_get_dtd_from_mode(&output_dtd,
>  					     intel_sdvo_connector->base.panel.fixed_mode);
>  	else
> -		intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
> +		intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);
>  	if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
>  		DRM_INFO("Setting output timings on %s failed\n",
>  			 SDVO_NAME(intel_sdvo));
> -- 
> 2.24.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 02/11] drm/i915: Remove hw.mode
Date: Mon, 18 Nov 2019 19:39:59 +0200	[thread overview]
Message-ID: <20191118173959.GW1208@intel.com> (raw)
Message-ID: <20191118173959.BPPXwTvb6AIrpTwFusiO8lSwcQ3nDIlC4aDPzsP9Pwg@z> (raw)
In-Reply-To: <20191114160522.9699-2-maarten.lankhorst@linux.intel.com>

On Thu, Nov 14, 2019 at 05:05:13PM +0100, Maarten Lankhorst wrote:
> The members in hw.mode can be used from adjusted_mode as well,
> use that when available.
> 
> Some places that use hw.mode can be converted to use adjusted_mode
> as well.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c  | 49 ++++++++++---------
>  .../drm/i915/display/intel_display_types.h    |  2 +-
>  drivers/gpu/drm/i915/display/intel_dvo.c      |  2 +-
>  drivers/gpu/drm/i915/display/intel_sdvo.c     | 16 +++---
>  4 files changed, 34 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index adf50c4b38ad..18acecc3642d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -8440,9 +8440,6 @@ static void intel_get_pipe_src_size(struct intel_crtc *crtc,
>  	tmp = I915_READ(PIPESRC(crtc->pipe));
>  	pipe_config->pipe_src_h = (tmp & 0xffff) + 1;
>  	pipe_config->pipe_src_w = ((tmp >> 16) & 0xffff) + 1;
> -
> -	pipe_config->hw.mode.vdisplay = pipe_config->pipe_src_h;
> -	pipe_config->hw.mode.hdisplay = pipe_config->pipe_src_w;
>  }
>  
>  void intel_mode_from_pipe_config(struct drm_display_mode *mode,
> @@ -12098,8 +12095,8 @@ static int icl_add_sync_mode_crtcs(struct intel_crtc_state *crtc_state)
>  			continue;
>  		if (!connector->has_tile)
>  			continue;
> -		if (crtc_state->hw.mode.hdisplay != connector->tile_h_size ||
> -		    crtc_state->hw.mode.vdisplay != connector->tile_v_size)
> +		if (crtc_state->hw.adjusted_mode.crtc_hdisplay != connector->tile_h_size ||
> +		    crtc_state->hw.adjusted_mode.crtc_vdisplay != connector->tile_v_size)
>  			return 0;
>  		if (connector->tile_h_loc == connector->num_h_tile - 1 &&
>  		    connector->tile_v_loc == connector->num_v_tile - 1)
> @@ -12506,7 +12503,7 @@ static void intel_dump_pipe_config(const struct intel_crtc_state *pipe_config,
>  		intel_dump_infoframe(dev_priv, &pipe_config->infoframes.hdmi);
>  
>  	DRM_DEBUG_KMS("requested mode:\n");
> -	drm_mode_debug_printmodeline(&pipe_config->hw.mode);
> +	drm_mode_debug_printmodeline(&pipe_config->uapi.mode);
>  	DRM_DEBUG_KMS("adjusted mode:\n");
>  	drm_mode_debug_printmodeline(&pipe_config->hw.adjusted_mode);
>  	intel_dump_crtc_timings(&pipe_config->hw.adjusted_mode);
> @@ -12640,16 +12637,16 @@ intel_crtc_copy_uapi_to_hw_state(struct intel_crtc_state *crtc_state)
>  {
>  	crtc_state->hw.enable = crtc_state->uapi.enable;
>  	crtc_state->hw.active = crtc_state->uapi.active;
> -	crtc_state->hw.mode = crtc_state->uapi.mode;
>  	crtc_state->hw.adjusted_mode = crtc_state->uapi.adjusted_mode;
>  	intel_crtc_copy_uapi_to_hw_state_nomodeset(crtc_state);
>  }
>  
> -static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state)
> +static void intel_crtc_copy_hw_to_uapi_state(struct intel_crtc_state *crtc_state,
> +					     struct drm_display_mode *user_mode)
>  {
>  	crtc_state->uapi.enable = crtc_state->hw.enable;
>  	crtc_state->uapi.active = crtc_state->hw.active;
> -	WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, &crtc_state->hw.mode) < 0);
> +	WARN_ON(drm_atomic_set_mode_for_crtc(&crtc_state->uapi, user_mode) < 0);
>  
>  	crtc_state->uapi.adjusted_mode = crtc_state->hw.adjusted_mode;
>  
> @@ -12702,6 +12699,10 @@ intel_crtc_prepare_cleared_state(struct intel_crtc_state *crtc_state)
>  	memcpy(crtc_state, saved_state, sizeof(*crtc_state));
>  	kfree(saved_state);
>  
> +	/* Clear I915_MODE_FLAG_INHERITED */
> +	crtc_state->uapi.mode.private_flags = 0;
> +	crtc_state->uapi.adjusted_mode.private_flags = 0;
> +
>  	intel_crtc_copy_uapi_to_hw_state(crtc_state);
>  
>  	return 0;
> @@ -12750,7 +12751,7 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)
>  	 * computation to clearly distinguish it from the adjusted mode, which
>  	 * can be changed by the connectors in the below retry loop.
>  	 */
> -	drm_mode_get_hv_timing(&pipe_config->hw.mode,
> +	drm_mode_get_hv_timing(&pipe_config->hw.pipe_mode,
>  			       &pipe_config->pipe_src_w,
>  			       &pipe_config->pipe_src_h);
>  
> @@ -12852,6 +12853,8 @@ intel_modeset_pipe_config(struct intel_crtc_state *pipe_config)
>  	 */
>  	pipe_config->uapi.adjusted_mode = pipe_config->hw.adjusted_mode;
>  
> +	/* without bigjoiner, pipe_mode == adjusted_mode */
> +	pipe_config->hw.pipe_mode = pipe_config->hw.adjusted_mode;
>  	return 0;
>  }
>  
> @@ -12995,8 +12998,8 @@ intel_pipe_config_compare(const struct intel_crtc_state *current_config,
>  	bool ret = true;
>  	u32 bp_gamma = 0;
>  	bool fixup_inherited = fastset &&
> -		(current_config->hw.mode.private_flags & I915_MODE_FLAG_INHERITED) &&
> -		!(pipe_config->hw.mode.private_flags & I915_MODE_FLAG_INHERITED);
> +		(current_config->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED) &&
> +		!(pipe_config->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED);
>  
>  	if (fixup_inherited && !fastboot_enabled(dev_priv)) {
>  		DRM_DEBUG_KMS("initial modeset and fastboot not set\n");
> @@ -14106,8 +14109,8 @@ static int intel_atomic_check(struct drm_device *dev,
>  	/* Catch I915_MODE_FLAG_INHERITED */
>  	for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
>  					    new_crtc_state, i) {
> -		if (new_crtc_state->hw.mode.private_flags !=
> -		    old_crtc_state->hw.mode.private_flags)
> +		if (new_crtc_state->hw.adjusted_mode.private_flags !=
> +		    old_crtc_state->hw.adjusted_mode.private_flags)
>  			new_crtc_state->uapi.mode_changed = true;
>  	}
>  
> @@ -14361,7 +14364,7 @@ static void intel_update_crtc(struct intel_crtc *crtc,
>  	 * of enabling them on the CRTC's first fastset.
>  	 */
>  	if (new_crtc_state->update_pipe && !modeset &&
> -	    old_crtc_state->hw.mode.private_flags & I915_MODE_FLAG_INHERITED)
> +	    old_crtc_state->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED)
>  		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
>  }
>  
> @@ -14558,7 +14561,7 @@ static void intel_post_crtc_enable_updates(struct intel_crtc *crtc,
>  	 * of enabling them on the CRTC's first fastset.
>  	 */
>  	if (new_crtc_state->update_pipe && !modeset &&
> -	    old_crtc_state->hw.mode.private_flags & I915_MODE_FLAG_INHERITED)
> +	    old_crtc_state->hw.adjusted_mode.private_flags & I915_MODE_FLAG_INHERITED)
>  		intel_crtc_arm_fifo_underrun(crtc, new_crtc_state);
>  }
>  
> @@ -17524,15 +17527,11 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
>  		int min_cdclk = 0;
>  
>  		if (crtc_state->hw.active) {
> -			struct drm_display_mode *mode = &crtc_state->hw.mode;
> +			struct drm_display_mode mode;
>  
>  			intel_mode_from_pipe_config(&crtc_state->hw.adjusted_mode,
>  						    crtc_state);
>  
> -			*mode = crtc_state->hw.adjusted_mode;
> -			mode->hdisplay = crtc_state->pipe_src_w;
> -			mode->vdisplay = crtc_state->pipe_src_h;
> -
>  			/*
>  			 * The initial mode needs to be set in order to keep
>  			 * the atomic core happy. It wants a valid mode if the
> @@ -17542,13 +17541,17 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
>  			 * set a flag to indicate that a full recalculation is
>  			 * needed on the next commit.
>  			 */
> -			mode->private_flags = I915_MODE_FLAG_INHERITED;
> +			crtc_state->hw.adjusted_mode.private_flags = I915_MODE_FLAG_INHERITED;
> +
> +			mode = crtc_state->hw.adjusted_mode;
> +			mode.hdisplay = crtc_state->pipe_src_w;
> +			mode.vdisplay = crtc_state->pipe_src_h;
>  
>  			intel_crtc_compute_pixel_rate(crtc_state);
>  
>  			intel_crtc_update_active_timings(crtc_state);
>  
> -			intel_crtc_copy_hw_to_uapi_state(crtc_state);
> +			intel_crtc_copy_hw_to_uapi_state(crtc_state, &mode);
>  		}
>  
>  		for_each_intel_plane_on_crtc(&dev_priv->drm, crtc, plane) {
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 83ea04149b77..0f20c7190eed 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -802,7 +802,7 @@ struct intel_crtc_state {
>  	struct {
>  		bool active, enable;
>  		struct drm_property_blob *degamma_lut, *gamma_lut, *ctm;
> -		struct drm_display_mode mode, adjusted_mode;
> +		struct drm_display_mode adjusted_mode;
>  	} hw;
>  
>  	/**
> diff --git a/drivers/gpu/drm/i915/display/intel_dvo.c b/drivers/gpu/drm/i915/display/intel_dvo.c
> index a74dc5b915d1..ad8e9959d6e1 100644
> --- a/drivers/gpu/drm/i915/display/intel_dvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_dvo.c
> @@ -207,7 +207,7 @@ static void intel_enable_dvo(struct intel_encoder *encoder,
>  	u32 temp = I915_READ(dvo_reg);
>  
>  	intel_dvo->dev.dev_ops->mode_set(&intel_dvo->dev,
> -					 &pipe_config->hw.mode,
> +					 &pipe_config->hw.adjusted_mode,
>  					 &pipe_config->hw.adjusted_mode);

This looks very wrong.

>  
>  	I915_WRITE(dvo_reg, temp | DVO_ENABLE);
> diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c
> index a4b1339fcc00..4ba7648a3145 100644
> --- a/drivers/gpu/drm/i915/display/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c
> @@ -1213,7 +1213,6 @@ intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
>  static bool
>  intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
>  				    struct intel_sdvo_connector *intel_sdvo_connector,
> -				    const struct drm_display_mode *mode,
>  				    struct drm_display_mode *adjusted_mode)
>  {
>  	struct intel_sdvo_dtd input_dtd;
> @@ -1224,9 +1223,9 @@ intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
>  
>  	if (!intel_sdvo_create_preferred_input_timing(intel_sdvo,
>  						      intel_sdvo_connector,
> -						      mode->clock / 10,
> -						      mode->hdisplay,
> -						      mode->vdisplay))
> +						      adjusted_mode->clock / 10,
> +						      adjusted_mode->hdisplay,
> +						      adjusted_mode->vdisplay))
>  		return false;
>  
>  	if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,
> @@ -1277,7 +1276,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  	struct intel_sdvo_connector *intel_sdvo_connector =
>  		to_intel_sdvo_connector(conn_state->connector);
>  	struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
> -	struct drm_display_mode *mode = &pipe_config->hw.mode;
>  
>  	DRM_DEBUG_KMS("forcing bpc to 8 for SDVO\n");
>  	pipe_config->pipe_bpp = 8*3;
> @@ -1293,12 +1291,12 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  	 * the sequence to do it. Oh well.
>  	 */
>  	if (IS_TV(intel_sdvo_connector)) {
> -		if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode))
> +		if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo,
> +							     adjusted_mode))
>  			return -EINVAL;
>  
>  		(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
>  							   intel_sdvo_connector,
> -							   mode,
>  							   adjusted_mode);
>  		pipe_config->sdvo_tv_clock = true;
>  	} else if (IS_LVDS(intel_sdvo_connector)) {
> @@ -1308,7 +1306,6 @@ static int intel_sdvo_compute_config(struct intel_encoder *encoder,
>  
>  		(void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
>  							   intel_sdvo_connector,
> -							   mode,
>  							   adjusted_mode);
>  	}
>  
> @@ -1435,7 +1432,6 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
>  		to_intel_sdvo_connector_state(conn_state);
>  	const struct intel_sdvo_connector *intel_sdvo_connector =
>  		to_intel_sdvo_connector(conn_state->connector);
> -	const struct drm_display_mode *mode = &crtc_state->hw.mode;
>  	struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder);
>  	u32 sdvox;
>  	struct intel_sdvo_in_out_map in_out;
> @@ -1468,7 +1464,7 @@ static void intel_sdvo_pre_enable(struct intel_encoder *intel_encoder,
>  		intel_sdvo_get_dtd_from_mode(&output_dtd,
>  					     intel_sdvo_connector->base.panel.fixed_mode);
>  	else
> -		intel_sdvo_get_dtd_from_mode(&output_dtd, mode);
> +		intel_sdvo_get_dtd_from_mode(&output_dtd, adjusted_mode);
>  	if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
>  		DRM_INFO("Setting output timings on %s failed\n",
>  			 SDVO_NAME(intel_sdvo));
> -- 
> 2.24.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-11-18 17:40 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 16:05 [PATCH 01/11] HAX to make DSC work on the icelake test system Maarten Lankhorst
2019-11-14 16:05 ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 02/11] drm/i915: Remove hw.mode Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-18 17:17   ` Ville Syrjälä
2019-11-18 17:17     ` [Intel-gfx] " Ville Syrjälä
2019-11-18 17:39   ` Ville Syrjälä [this message]
2019-11-18 17:39     ` Ville Syrjälä
2019-12-03  9:28     ` Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 03/11] drm/i915: Add hw.pipe_mode to allow bigjoiner pipe/transcoder split Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 04/11] drm/i915/dp: Allow big joiner modes in intel_dp_mode_valid(), v3 Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-28 19:04   ` Ville Syrjälä
2019-11-28 19:04     ` [Intel-gfx] " Ville Syrjälä
2019-12-03  9:18     ` Maarten Lankhorst
2019-12-03 13:39       ` Ville Syrjälä
2019-11-14 16:05 ` [PATCH 05/11] drm/i915: Try to make bigjoiner work in atomic check, v3 Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-28 19:24   ` Ville Syrjälä
2019-11-28 19:24     ` [Intel-gfx] " Ville Syrjälä
2019-12-03  9:13     ` Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 06/11] drm/i915: Enable big joiner support in enable and disable sequences Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-28 19:43   ` Ville Syrjälä
2019-11-28 19:43     ` [Intel-gfx] " Ville Syrjälä
2019-12-03  9:05     ` Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 07/11] drm/i915: Make hardware readout work on i915 Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 08/11] drm/i915: Link planes in a bigjoiner configuration, v3 Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 09/11] drm/i915: Add bigjoiner aware plane clipping checks Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 10/11] drm/i915: Add intel_update_bigjoiner handling Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 16:05 ` [PATCH 11/11] drm/i915: Add debugfs dumping for bigjoiner, v2 Maarten Lankhorst
2019-11-14 16:05   ` [Intel-gfx] " Maarten Lankhorst
2019-11-14 17:04 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/11] HAX to make DSC work on the icelake test system Patchwork
2019-11-14 17:04   ` [Intel-gfx] " Patchwork
2019-11-14 17:06 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-11-14 17:06   ` [Intel-gfx] " Patchwork
2019-11-14 17:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-11-14 17:25   ` [Intel-gfx] " Patchwork
2019-11-15 17:50 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-11-15 17:50   ` [Intel-gfx] " Patchwork
2019-12-12  0:27 ` [Intel-gfx] [PATCH 01/11] " Manasi Navare
2019-12-12 10:09   ` Maarten Lankhorst

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=20191118173959.GW1208@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.