From: Hans Verkuil Date: Sat, 7 Mar 2015 15:53:39 +0000 (-0300) Subject: [media] vivid-tpg: don't add offset when switching to monochrome X-Git-Tag: firefly_0821_release~176^2~795^2~1186 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9c35bd48d54345b2c89426dd2efdb33adaa0aac3;p=firefly-linux-kernel-4.4.55.git [media] vivid-tpg: don't add offset when switching to monochrome The grayscale values are still full range sRGB, so don't add the limited range offset. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index 8f455681f606..145b6ff2f816 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -530,7 +530,7 @@ static void precalculate_color(struct tpg_data *tpg, int k) if (tpg->qual == TPG_QUAL_GRAY) { /* Rec. 709 Luma function */ /* (0.2126, 0.7152, 0.0722) * (255 * 256) */ - r = g = b = ((13879 * r + 46688 * g + 4713 * b) >> 16) + (16 << 4); + r = g = b = (13879 * r + 46688 * g + 4713 * b) >> 16; } /*