summaryrefslogtreecommitdiff
path: root/tests/kms_color.c
diff options
context:
space:
mode:
authorLeo (Sunpeng) Li <sunpeng.li@amd.com>2018-04-12 17:46:41 -0400
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2018-04-14 01:05:27 +0300
commit0941f7c3dee6633b518510ccd0cb25af2acbc55e (patch)
tree165b9a5671b6c7bcaf2a3f69b43745e9d62dcd26 /tests/kms_color.c
parentcf409424af808d258ccc8a4df7404208aafb54b3 (diff)
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 <sunpeng.li@amd.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/kms_color.c')
-rw-r--r--tests/kms_color.c7
1 files changed, 6 insertions, 1 deletions
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);