summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJouni Högander <jouni.hogander@intel.com>2022-05-27 09:22:50 +0300
committerJouni Högander <jouni.hogander@intel.com>2022-05-30 14:21:07 +0300
commitddf15f129d86fe0b4ba76ccf1fff4b4ae0d290d2 (patch)
tree528fa6b5f1015dc1bd379f2ed3928e6c0ef04b11
parentc0ec2a7311007e1689ccd2dcf1c3312935c39266 (diff)
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@intel.com>
-rw-r--r--tests/i915/kms_psr2_sf.c20
1 files 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) {