Skip to contentSkip to conversation

tests/kms_rmfb: Fix cursor fb size

PATCH In review [email protected] 2 participants 2 messages Jun 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/kms_rmfb: Fix cursor fb size

From: Ville Syrjälä <[email protected]>

Don't use the display mode size to determine the cursor fb size. That will lead to a framebuffer with a stride that the cursor plane won't support. Just use the max cursor size as the fb size instead.

This started to trip up after i915 started to actually use the cursor fb stride in commit 1e1bb8710e60 ("drm/i915: Use fb->pitches[0] in cursor code")

Cc: Marta Löfstedt <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97975

---
 tests/kms_rmfb.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
tests/kms_rmfb.c +3 -8
index 5753d74c9411..9f1f564e54aa 100644
@@ -66,16 +66,11 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reo
 	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
 		      DRM_FORMAT_XRGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &fb);
 
-	igt_create_fb(data->drm_fd, mode->hdisplay, mode->vdisplay,
-		      DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &argb_fb);
-
 	do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width));
-	if (cursor_width > mode->hdisplay)
-		cursor_width = mode->hdisplay;
-
 	do_or_die(drmGetCap(data->drm_fd, DRM_CAP_CURSOR_HEIGHT, &cursor_height));
-	if (cursor_height > mode->vdisplay)
-		cursor_height = mode->vdisplay;
+
+	igt_create_fb(data->drm_fd, cursor_width, cursor_height,
+		      DRM_FORMAT_ARGB8888, LOCAL_DRM_FORMAT_MOD_NONE, &argb_fb);
 
 	/*
 	 * Make sure these buffers are suited for display use
Signature · 6 lines
2.13.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Tested OK, also NOTE that this fixes bug 97975

/Marta

Quoted 56 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Monday, June 19, 2017 3:29 PM
To: [email protected]
Cc: Lofstedt, Marta <[email protected]>
Subject: [PATCH i-g-t] tests/kms_rmfb: Fix cursor fb size

From: Ville Syrjälä <[email protected]>

Don't use the display mode size to determine the cursor fb size. That will lead to a framebuffer with a stride that the cursor plane won't support. Just use the max cursor size as the fb size instead.

This started to trip up after i915 started to actually use the cursor fb stride in commit 1e1bb8710e60 ("drm/i915: Use fb->pitches[0] in cursor code")

Cc: Marta Löfstedt <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97975

---
 tests/kms_rmfb.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
tests/kms_rmfb.c index renamed from tests/kms_rmfb.c +0 -0

5753d74c9411..9f1f564e54aa 100644

tests/kms_rmfb.c +0 -6
@@ -66,16 +66,11 @@ test_rmfb(struct rmfb_data *data, igt_output_t
 *output, enum pipe pipe, bool reo
 	igt_create_fb(data->drm_fd, mode->hdisplay, mode-
 >vdisplay,
 		      DRM_FORMAT_XRGB8888,
 LOCAL_DRM_FORMAT_MOD_NONE, &fb);
 
-	igt_create_fb(data->drm_fd, mode->hdisplay, mode-
 >vdisplay,
-		      DRM_FORMAT_ARGB8888,
 LOCAL_DRM_FORMAT_MOD_NONE, &argb_fb);
-
 	do_or_die(drmGetCap(data->drm_fd,
 DRM_CAP_CURSOR_WIDTH, &cursor_width));
-	if (cursor_width > mode->hdisplay)
-		cursor_width = mode->hdisplay;
-
 	do_or_die(drmGetCap(data->drm_fd,

DRM_CAP_CURSOR_HEIGHT, &cursor_height));

tests/kms_rmfb.c +3 -2
-	if (cursor_height > mode->vdisplay)
-		cursor_height = mode->vdisplay;
+
+	igt_create_fb(data->drm_fd, cursor_width, cursor_height,
+		      DRM_FORMAT_ARGB8888,

LOCAL_DRM_FORMAT_MOD_NONE, &argb_fb);

tests/kms_rmfb.c +0 -1
 	/*
 	 * Make sure these buffers are suited for display use
--
Quoted 1 line

2.13.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx