summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2019-05-10 18:28:33 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2019-06-05 20:04:51 +0300
commit4f2b9f5930fa33d091cf89637dc6e7f76f632a88 (patch)
treef3c2c93148662803d8f1f604acf7978d7e901b0d /tests
parentf190ab5dcd3fa52f4b47bc28c01bcfbbdc888826 (diff)
tests/kms_big_fb: Test 8bpp
Now that igt_fb has some support for C8 we can enable the 8bpp subtests. v2: Make sure GAMMA_LUT prop is available (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_big_fb.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index b8813a33..c3498c67 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -206,6 +206,34 @@ static void cleanup_fb(data_t *data)
data->big_fb.fb_id = 0;
}
+static void set_c8_lut(data_t *data)
+{
+ igt_pipe_t *pipe = &data->display.pipes[data->pipe];
+ struct drm_color_lut *lut;
+ int i, lut_size = 256;
+
+ lut = calloc(lut_size, sizeof(lut[0]));
+
+ /* igt_fb uses RGB332 for C8 */
+ for (i = 0; i < lut_size; i++) {
+ lut[i].red = ((i & 0xe0) >> 5) * 0xffff / 0x7;
+ lut[i].green = ((i & 0x1c) >> 2) * 0xffff / 0x7;
+ lut[i].blue = ((i & 0x03) >> 0) * 0xffff / 0x3;
+ }
+
+ igt_pipe_obj_replace_prop_blob(pipe, IGT_CRTC_GAMMA_LUT, lut,
+ lut_size * sizeof(lut[0]));
+
+ free(lut);
+}
+
+static void unset_lut(data_t *data)
+{
+ igt_pipe_t *pipe = &data->display.pipes[data->pipe];
+
+ igt_pipe_obj_replace_prop_blob(pipe, IGT_CRTC_GAMMA_LUT, NULL, 0);
+}
+
static bool test_plane(data_t *data)
{
igt_plane_t *plane = data->plane;
@@ -318,6 +346,11 @@ static bool test_pipe(data_t *data)
int width, height;
bool ret = false;
+ if (data->format == DRM_FORMAT_C8 &&
+ !igt_pipe_obj_has_prop(&data->display.pipes[data->pipe],
+ IGT_CRTC_GAMMA_LUT))
+ return false;
+
mode = igt_output_get_mode(data->output);
data->width = mode->hdisplay;
@@ -355,6 +388,9 @@ static bool test_pipe(data_t *data)
igt_remove_fb(data->drm_fd, &fb);
}
+ if (data->format == DRM_FORMAT_C8)
+ set_c8_lut(data);
+
igt_display_commit2(&data->display, data->display.is_atomic ?
COMMIT_ATOMIC : COMMIT_UNIVERSAL);
@@ -367,6 +403,9 @@ static bool test_pipe(data_t *data)
break;
}
+ if (data->format == DRM_FORMAT_C8)
+ unset_lut(data);
+
igt_pipe_crc_free(data->pipe_crc);
igt_output_set_pipe(data->output, PIPE_ANY);
@@ -545,7 +584,6 @@ static const struct {
uint32_t format;
uint8_t bpp;
} formats[] = {
- /* FIXME igt_fb doesn't support C8 currently */
{ DRM_FORMAT_C8, 8, },
{ DRM_FORMAT_RGB565, 16, },
{ DRM_FORMAT_XRGB8888, 32, },
@@ -654,7 +692,8 @@ igt_main
igt_subtest_f("%s-%dbpp-rotate-%d", modifiers[i].name,
formats[j].bpp, rotations[k].angle) {
- igt_require(igt_fb_supported_format(data.format));
+ igt_require(data.format == DRM_FORMAT_C8 ||
+ igt_fb_supported_format(data.format));
igt_require(igt_display_has_format_mod(&data.display, data.format, data.modifier));
test_scanout(&data);
}