]> git.baikalelectronics.ru Git - kernel.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)
commit88ab05812e5d6b12cc8c14a750879be2700cbe13
treec78b1c39cc2dbab1470c349a63b0ae578ff65885
parent81c4a295285edf71d30b0b77dcd3af7c2ccf8b99
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