]> asedeno.scripts.mit.edu Git - linux.git/commit
drm/omap: cleanup color space conversion
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 12 Sep 2016 07:00:15 +0000 (10:00 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 1 Mar 2018 07:18:18 +0000 (09:18 +0200)
commit4cba7071b70de271415a4d9e8bfb1e420d5942b1
treec78b1c39cc2dbab1470c349a63b0ae578ff65885
parentc1899cb368c1d280af48661c6edaa975cf653533
drm/omap: cleanup color space conversion

The setup code for color space conversion is a bit messy. This patch
cleans it up.

For some reason the TRM uses values in YCrCb order, which is also used
in the current driver, whereas everywhere else it's YCbCr (which also
matches YUV order). This patch changes the tables to use the common
order to avoid confusion.

The tables are split into separate lines, and comments added for
clarity.

WB color conversion registers are similar but different than non-WB, but
the same function was used to write both. It worked fine because the
coef table was adjusted accordingly, but that was rather confusing. This
patch adds a separate function to write the WB values so that the coef
table can be written in an understandable way.

Recalculation also showed that 'bcb' value in yuv-to-rgb conversion had
been rounded wrongly, and it should be 516 instead of 517.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/gpu/drm/omapdrm/dss/dispc.c