summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBob Paauwe <bob.j.paauwe@intel.com>2016-04-11 10:41:35 -0700
committerMarius Vlad <marius.c.vlad@intel.com>2016-04-20 13:39:50 +0300
commite3e00bae23ce3687f7e465d67318fca54f84f0ab (patch)
tree15715feb9dd2a03600a6378f6abd173f400f7178 /tests
parent459ff6b7e24dc0bda5d45b41afdf1fe9aaafc936 (diff)
ksm_pipe_color: Set legacy gamma values inside loop.
When testing multple outputs, make sure to set the gamma values before testing the output. Otherwise we're testing using the gamma values that were reset after last output was tested. Without this, the first output passes, but each output after that will fail. Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/kms_pipe_color.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c
index f08aabd7..9f7ac7ea 100644
--- a/tests/kms_pipe_color.c
+++ b/tests/kms_pipe_color.c
@@ -452,10 +452,6 @@ static void test_pipe_legacy_gamma(data_t *data,
green_lut = malloc(sizeof(uint16_t) * legacy_lut_size);
blue_lut = malloc(sizeof(uint16_t) * legacy_lut_size);
- red_lut[0] = green_lut[0] = blue_lut[0] = 0;
- for (i = 1; i < legacy_lut_size; i++)
- red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff;
-
for_each_connected_output(&data->display, output) {
drmModeModeInfo *mode;
struct igt_fb fb_modeset, fb;
@@ -500,6 +496,10 @@ static void test_pipe_legacy_gamma(data_t *data,
*/
paint_gradient_rectangles(data, mode, red_green_blue, &fb);
igt_plane_set_fb(primary, &fb);
+
+ red_lut[0] = green_lut[0] = blue_lut[0] = 0;
+ for (i = 1; i < legacy_lut_size; i++)
+ red_lut[i] = green_lut[i] = blue_lut[i] = 0xffff;
igt_assert_eq(drmModeCrtcSetGamma(data->drm_fd, primary->pipe->crtc_id,
legacy_lut_size, red_lut, green_lut, blue_lut), 0);
igt_display_commit(&data->display);