[igt-dev] [PATCH i-g-t] tests/kms_ccs: Avoid using plane sizes which exceed hw capability

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Fri Sep 21 13:38:01 UTC 2018


Max sprite plane width at 2000 to avoid going over hw watermark
limits.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105458
Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
---
 tests/kms_ccs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index e1ee588..f630029 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -68,6 +68,8 @@ typedef struct {
 #define CCS_UNCOMPRESSED	0x0
 #define CCS_COMPRESSED		0x55
 
+#define MAX_SPRITE_PLANE_WIDTH 2000
+
 struct local_drm_format_modifier {
        /* Bitmask of formats in get_plane format list this info applies to. The
 	* offset allows a sliding window of which 64 formats (bits).
@@ -408,12 +410,12 @@ static bool try_config(data_t *data, enum test_fb_flags fb_flags,
 	if (data->plane && fb_flags & FB_COMPRESSED) {
 		if (!plane_has_format_with_ccs(data, data->plane, DRM_FORMAT_XRGB8888))
 			return false;
-		generate_fb(data, &fb, drm_mode->hdisplay,
+		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
 			    drm_mode->vdisplay,
 			    (fb_flags & ~FB_COMPRESSED) | FB_HAS_PLANE);
 		generate_fb(data, &fb_sprite, 256, 256, fb_flags);
 	} else {
-		generate_fb(data, &fb, drm_mode->hdisplay,
+		generate_fb(data, &fb, min(MAX_SPRITE_PLANE_WIDTH, drm_mode->hdisplay),
 			    drm_mode->vdisplay, fb_flags);
 	}
 
-- 
2.7.4



More information about the igt-dev mailing list