diff mbox series

[v2,2/4] drm/i915/display: Use original src in psr2 sel fetch area calculation

Message ID 20220823112920.352563-3-jouni.hogander@intel.com (mailing list archive)
State New, archived
Headers show
Series Fixes for damage clips handling | expand

Commit Message

Hogander, Jouni Aug. 23, 2022, 11:29 a.m. UTC
drm_plane_state->src is modified when offset is calculated:

before calculation:
src.x1 = 8192, src.y1 = 8192

after calculation (pitch = 65536, cpp = 4, alignment = 262144)
src.x1 = 8192, src.y1 = 0, offset = 0x20000000

Damage clips are relative to original coodrdinates provided by
user-space. To compare these against src coordinates we need to use
original coordinates as provided by user-space. These can be obtained
by using drm_plane_state_src.

Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Mika Kahola Sept. 2, 2022, 10:59 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Jouni
> Högander
> Sent: Tuesday, August 23, 2022 2:29 PM
> To: dri-devel@lists.freedesktop.org; intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH v2 2/4] drm/i915/display: Use original src in psr2 sel
> fetch area calculation
> 
> drm_plane_state->src is modified when offset is calculated:
> 
> before calculation:
> src.x1 = 8192, src.y1 = 8192
> 
> after calculation (pitch = 65536, cpp = 4, alignment = 262144)
> src.x1 = 8192, src.y1 = 0, offset = 0x20000000
> 
> Damage clips are relative to original coodrdinates provided by user-space. To
> compare these against src coordinates we need to use original coordinates as
> provided by user-space. These can be obtained by using drm_plane_state_src.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_psr.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 98c3c8015a5c..16985de24019 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -1767,7 +1767,8 @@ int intel_psr2_sel_fetch_update(struct
> intel_atomic_state *state,
>  			continue;
>  		}
> 
> -		drm_rect_fp_to_int(&src, &new_plane_state->uapi.src);
> +		src = drm_plane_state_src(&new_plane_state->uapi);
> +		drm_rect_fp_to_int(&src, &src);
> 
>  		drm_atomic_helper_damage_iter_init(&iter,
>  						   &old_plane_state->uapi,
> --
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 98c3c8015a5c..16985de24019 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -1767,7 +1767,8 @@  int intel_psr2_sel_fetch_update(struct intel_atomic_state *state,
 			continue;
 		}
 
-		drm_rect_fp_to_int(&src, &new_plane_state->uapi.src);
+		src = drm_plane_state_src(&new_plane_state->uapi);
+		drm_rect_fp_to_int(&src, &src);
 
 		drm_atomic_helper_damage_iter_init(&iter,
 						   &old_plane_state->uapi,