[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
Mon Sep 24 08:29:10 UTC 2018
Max sprite plane width at 2000 to avoid going over hw watermark
limits.
v2: (Ville Syrjälä) comment on source added plane width limitation.
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 | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index e1ee588..64a4fdd 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -68,6 +68,15 @@ typedef struct {
#define CCS_UNCOMPRESSED 0x0
#define CCS_COMPRESSED 0x55
+/*
+ * Limit maximum used sprite plane width so this test will not mistakenly
+ * fail on hardware limitations which are not interesting to this test.
+ * On this test too wide sprite plane may fail during creation with dmesg
+ * comment saying:
+ * "Requested display configuration exceeds system watermark limitations"
+ */
+#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 +417,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