summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2022-06-30 15:16:23 +0200
committerGeert Uytterhoeven <geert@linux-m68k.org>2023-10-24 09:43:30 +0200
commiteb06a81e42195ef57dab4b567f646b5b7596ca90 (patch)
treed36082e7af82ee30709ef162938c3eea233b8fd7
parent5254fd1146b95a86fef1bb8e950d0146d829f3c4 (diff)
downloadlibdrm-eb06a81e42195ef57dab4b567f646b5b7596ca90.tar.gz
libdrm-eb06a81e42195ef57dab4b567f646b5b7596ca90.tar.bz2
libdrm-eb06a81e42195ef57dab4b567f646b5b7596ca90.zip
util: improve SMPTE color LUT accuracy
Fill in the LSB when converting color components from 8-bit to 16-bit. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- v5: - Add Reviewed-by, v4: - No changes, v3: - Add Acked-by, v2: - New.
-rw-r--r--tests/util/pattern.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/util/pattern.c b/tests/util/pattern.c
index bd0989e6..7d4f6610 100644
--- a/tests/util/pattern.c
+++ b/tests/util/pattern.c
@@ -646,9 +646,9 @@ void util_smpte_c8_gamma(unsigned size, struct drm_color_lut *lut)
memset(lut, 0, size * sizeof(struct drm_color_lut));
#define FILL_COLOR(idx, r, g, b) \
- lut[idx].red = (r) << 8; \
- lut[idx].green = (g) << 8; \
- lut[idx].blue = (b) << 8
+ lut[idx].red = (r) * 0x101; \
+ lut[idx].green = (g) * 0x101; \
+ lut[idx].blue = (b) * 0x101
FILL_COLOR( 0, 192, 192, 192); /* grey */
FILL_COLOR( 1, 192, 192, 0 ); /* yellow */