Re: [PATCH 01/15] drm/i915/plane: warn on non-zero plane offset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 26, 2023 at 07:37:54PM +0300, Jani Nikula wrote:
> We assume the plane offset is 0. Warn if it's not. This also fixes a
> warn on unused but set variable offset.
> 
> Suggested-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/i9xx_plane.c          | 2 ++
>  drivers/gpu/drm/i915/display/skl_universal_plane.c | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/i9xx_plane.c b/drivers/gpu/drm/i915/display/i9xx_plane.c
> index 616654adbfb8..b52a681ca85e 100644
> --- a/drivers/gpu/drm/i915/display/i9xx_plane.c
> +++ b/drivers/gpu/drm/i915/display/i9xx_plane.c
> @@ -1037,6 +1037,8 @@ i9xx_get_initial_plane_config(struct intel_crtc *crtc,
>  	}
>  	plane_config->base = base;
>  
> +	drm_WARN_ON(&dev_priv->drm, offset != 0);
> +

The gen2/3 codepath doesn't appear to initialize offset at all.

With that fixed this is
Reviewed-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

>  	val = intel_de_read(dev_priv, PIPESRC(pipe));
>  	fb->width = REG_FIELD_GET(PIPESRC_WIDTH_MASK, val) + 1;
>  	fb->height = REG_FIELD_GET(PIPESRC_HEIGHT_MASK, val) + 1;
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index 36070d86550f..6b01a0b68b97 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -2529,6 +2529,7 @@ skl_get_initial_plane_config(struct intel_crtc *crtc,
>  	plane_config->base = base;
>  
>  	offset = intel_de_read(dev_priv, PLANE_OFFSET(pipe, plane_id));
> +	drm_WARN_ON(&dev_priv->drm, offset != 0);
>  
>  	val = intel_de_read(dev_priv, PLANE_SIZE(pipe, plane_id));
>  	fb->height = REG_FIELD_GET(PLANE_HEIGHT_MASK, val) + 1;
> -- 
> 2.39.2

-- 
Ville Syrjälä
Intel



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux