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: v4.1-rc1~59^2~1^2~183 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9c35bd48d54345b2c89426dd2efdb33adaa0aac3;p=karo-tx-linux.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; } /*