From 0941f7c3dee6633b518510ccd0cb25af2acbc55e Mon Sep 17 00:00:00 2001 From: "Leo (Sunpeng) Li" Date: Thu, 12 Apr 2018 17:46:41 -0400 Subject: tests/kms_color: Do not mask LUT for non i915 drivers. Masking assumes a direct relationship between the software LUT structure, and hardware LUT. This is not always the case. On AMD hardware for example, the hardware LUT is composed of piecewise-linear segments, with end-point spaced exponentially along the X axis, while software LUT is spaced linearly. Masking the LUT for the purpose of truncating the resulting colors won't work here. v2: Add commit message and sign off. Signed-off-by: Leo (Sunpeng) Li Acked-by: Arkadiusz Hiler --- tests/kms_color.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/kms_color.c') diff --git a/tests/kms_color.c b/tests/kms_color.c index c3126977..1e51917d 100644 --- a/tests/kms_color.c +++ b/tests/kms_color.c @@ -165,7 +165,12 @@ static struct _drm_color_lut *coeffs_to_lut(data_t *data, struct _drm_color_lut *lut; uint32_t i; uint32_t max_value = (1 << 16) - 1; - uint32_t mask = ((1 << color_depth) - 1) << 8; + uint32_t mask; + + if (is_i915_device(data->drm_fd)) + mask = ((1 << color_depth) - 1) << 8; + else + mask = max_value; lut = malloc(sizeof(struct _drm_color_lut) * lut_size); -- cgit v1.2.3