[igt-dev] [PATCH i-g-t 1/4] tests/i915/kms_psr2_sf.c: Fix for setting wrong size for cursor fb
Kahola, Mika
mika.kahola at intel.com
Mon May 30 08:34:15 UTC 2022
> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Jouni
> Högander
> Sent: Monday, May 30, 2022 9:07 AM
> To: igt-dev at lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t 1/4] tests/i915/kms_psr2_sf.c: Fix for setting
> wrong size for cursor fb
>
> Current code is setting wrong size for cursor framebuffer. Fix thi by handling all
> plane types separately.
>
> Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/6064
> Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
Reviewed-by: Mika Kahola <mika.kahola at intel.com>
> ---
> tests/i915/kms_psr2_sf.c | 20 +++++++++++++++-----
> 1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/tests/i915/kms_psr2_sf.c b/tests/i915/kms_psr2_sf.c index
> 1ccbd11a..f9f514ab 100644
> --- a/tests/i915/kms_psr2_sf.c
> +++ b/tests/i915/kms_psr2_sf.c
> @@ -710,8 +710,7 @@ static void plane_move_continuous(data_t *data) static
> void damaged_plane_update(data_t *data) {
> igt_plane_t *test_plane = data->test_plane;
> - uint32_t h = data->mode->hdisplay;
> - uint32_t v = data->mode->vdisplay;
> + uint32_t h, v;
> int x, y;
>
> if (data->big_fb_test) {
> @@ -721,9 +720,20 @@ static void damaged_plane_update(data_t *data)
> x = y = 0;
> }
>
> - if (data->test_plane_id == DRM_PLANE_TYPE_OVERLAY) {
> - h = h/2;
> - v = v/2;
> + switch (data->test_plane_id) {
> + case DRM_PLANE_TYPE_OVERLAY:
> + h = data->mode->hdisplay / 2;
> + v = data->mode->vdisplay / 2;
> + break;
> + case DRM_PLANE_TYPE_PRIMARY:
> + h = data->mode->hdisplay;
> + v = data->mode->vdisplay;
> + break;
> + case DRM_PLANE_TYPE_CURSOR:
> + h = v = CUR_SIZE;
> + break;
> + default:
> + igt_assert(false);
> }
>
> if (data->screen_changes & 1) {
> --
> 2.25.1
More information about the igt-dev
mailing list