diff options
author | Robert Morell <rmorell@nvidia.com> | 2011-03-21 14:32:29 -0700 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-08-11 11:53:55 -0700 |
commit | ac745fa558eba59a6b18333d098188f65202b22d (patch) | |
tree | 603f7063ede5840a759a1ee3643c9dccdb8049a1 /include | |
parent | d8dc0aa6548723d8b0637ab131e0732e2e7e7296 (diff) |
video: tegra: Add userspace CSC control
This adds configurability of the per-window color space conversion
support in the Tegra display controller through the dc extension
interface. The CSC matrix defaults to its previously-hardcoded values,
but can be overridden by userspace.
bug 818525
Change-Id: I00d8e48dd38a40e5b8c36d4624d31c834e5cd9de
Signed-off-by: Robert Morell <rmorell@nvidia.com>
Reviewed-on: http://git-master/r/40527
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/video/tegra_dc_ext.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/video/tegra_dc_ext.h b/include/video/tegra_dc_ext.h index 2e89a12add3e..a7c455ce8b4d 100644 --- a/include/video/tegra_dc_ext.h +++ b/include/video/tegra_dc_ext.h @@ -130,6 +130,37 @@ struct tegra_dc_ext_cursor { __u32 flags; }; +/* + * Color conversion is performed as follows: + * + * r = sat(kyrgb * sat(y + yof) + kur * u + kvr * v) + * g = sat(kyrgb * sat(y + yof) + kug * u + kvg * v) + * b = sat(kyrgb * sat(y + yof) + kub * u + kvb * v) + * + * Coefficients should be specified as fixed-point values; the exact format + * varies for each coefficient. + * The format for each coefficient is listed below with the syntax: + * - A "s." prefix means that the coefficient has a sign bit (twos complement). + * - The first number is the number of bits in the integer component (not + * including the optional sign bit). + * - The second number is the number of bits in the fractional component. + * + * All three fields should be tightly packed, justified to the LSB of the + * 16-bit value. For example, the "s.2.8" value should be packed as: + * (MSB) 5 bits of 0, 1 bit of sign, 2 bits of integer, 8 bits of frac (LSB) + */ +struct tegra_dc_ext_csc { + __u32 win_index; + __u16 yof; /* s.7.0 */ + __u16 kyrgb; /* 2.8 */ + __u16 kur; /* s.2.8 */ + __u16 kvr; /* s.2.8 */ + __u16 kug; /* s.1.8 */ + __u16 kvg; /* s.1.8 */ + __u16 kub; /* s.2.8 */ + __u16 kvb; /* s.2.8 */ +}; + #define TEGRA_DC_EXT_SET_NVMAP_FD \ _IOW('D', 0x00, __s32) @@ -150,6 +181,9 @@ struct tegra_dc_ext_cursor { #define TEGRA_DC_EXT_SET_CURSOR \ _IOW('D', 0x07, struct tegra_dc_ext_cursor) +#define TEGRA_DC_EXT_SET_CSC \ + _IOW('D', 0x08, struct tegra_dc_ext_csc) + enum tegra_dc_ext_control_output_type { TEGRA_DC_EXT_DSI, |