summaryrefslogtreecommitdiff
path: root/tests/kms_ccs.c
diff options
context:
space:
mode:
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>2018-09-24 11:29:10 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-10-16 13:37:32 +0300
commit27fa97d16294af9c9c42fd81b030a73e4aa2e7c3 (patch)
tree48c983697e8487db7c546d15f903d6ef053ea690 /tests/kms_ccs.c
parent017c749c8a963c1851580203b53b407666686c1d (diff)
tests/kms_ccs: Avoid using plane sizes which exceed hw capability
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@gmail.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/kms_ccs.c')
-rw-r--r--tests/kms_ccs.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index 950f15ee..1ed2b4a0 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);
}