artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25ac824
)
drm/amd/display: Limit user regamma to a valid value
author
jsg
<jsg@openbsd.org>
Mon, 3 Oct 2022 11:52:57 +0000
(11:52 +0000)
committer
jsg
<jsg@openbsd.org>
Mon, 3 Oct 2022 11:52:57 +0000
(11:52 +0000)
From Yao Wang1
a541c011181823494c53b15020fae5c3b45f5ec2
in linux 5.15.y/5.15.71
3601d620f22e37740cf73f8278eabf9f2aa19eb7
in mainline linux
sys/dev/pci/drm/amd/display/modules/color/color_gamma.c
patch
|
blob
|
history
diff --git
a/sys/dev/pci/drm/amd/display/modules/color/color_gamma.c
b/sys/dev/pci/drm/amd/display/modules/color/color_gamma.c
index
ef742d9
..
c707c9b
100644
(file)
--- a/
sys/dev/pci/drm/amd/display/modules/color/color_gamma.c
+++ b/
sys/dev/pci/drm/amd/display/modules/color/color_gamma.c
@@
-1597,6
+1597,7
@@
static void interpolate_user_regamma(uint32_t hw_points_num,
struct fixed31_32 lut2;
struct fixed31_32 delta_lut;
struct fixed31_32 delta_index;
+ const struct fixed31_32 one = dc_fixpt_from_int(1);
i = 0;
/* fixed_pt library has problems handling too small values */
@@
-1625,6
+1626,9
@@
static void interpolate_user_regamma(uint32_t hw_points_num,
} else
hw_x = coordinates_x[i].x;
+ if (dc_fixpt_le(one, hw_x))
+ hw_x = one;
+
norm_x = dc_fixpt_mul(norm_factor, hw_x);
index = dc_fixpt_floor(norm_x);
if (index < 0 || index > 255)