I want to bring that patch up again, because in the meantime i can add
my Tested-by to that, because it works as expected.
The patch is needed for correct csc handling (e.g. within libvdpau-sunxi).
Without it, the csc matrix is calculated wrong, when someone wants to
set bright, contrast, saturation and hue with the display engine ioctls.
So maybe someone can push that to stage/sunxi-3.4
Thanks
Andreas
Am 06.03.2015 um 11:21 schrieb Andreas Baierl:
From: Andreas Baierl <ich...@imkreisrum.de>
There is some bogus code, which calculates the variable bright four times.
This typo is corrected.
The code also checks for a valid input value (0-100) and calculates
the correct (rounded) value for bright, contrast, saturation and hue in
the needed range 0-63.
Changes since v2:
Use clamp macro.
Changes since v1:
Use macro DIV_ROUND_CLOSEST for rounding.
Check for valid parameter values (0-100).
Signed-off-by: Andreas Baierl <ich...@imkreisrum.de>
---
drivers/video/sunxi/disp/de_fe.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/video/sunxi/disp/de_fe.c b/drivers/video/sunxi/disp/de_fe.c
index 92799a0..54dfe7f 100644
--- a/drivers/video/sunxi/disp/de_fe.c
+++ b/drivers/video/sunxi/disp/de_fe.c
@@ -1382,10 +1382,10 @@ __s32 DE_SCAL_Set_CSC_Coef_Enhance(__u8 sel, __u8
in_csc_mode,
__u32 i;
__s32 sinv, cosv; /* sin_tab: 7 bit fractional */
- bright = bright * 64 / 100;
- bright = saturation * 64 / 100;
- bright = contrast * 64 / 100;
- bright = hue * 64 / 100;
+ bright = DIV_ROUND_CLOSEST((clamp(bright, 0, 100) * 63), 100);
+ saturation = DIV_ROUND_CLOSEST((clamp(saturation, 0, 100) * 63), 100);
+ contrast = DIV_ROUND_CLOSEST((clamp(contrast, 0, 100) * 63), 100);
+ hue = DIV_ROUND_CLOSEST((clamp(hue, 0, 100) * 63), 100);
sinv = image_enhance_tab[8 * 12 + (hue & 0x3f)];
cosv = image_enhance_tab[8 * 12 + 8 * 8 + (hue & 0x3f)];
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.