summaryrefslogtreecommitdiff
path: root/include/video
diff options
context:
space:
mode:
authorRobert Morell <rmorell@nvidia.com>2011-03-21 14:32:29 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:48:13 -0800
commit491cb2c5948ccf7ce53c81dbca8d19475667a400 (patch)
treeb9fbc8fd153ccb44fbfcd3036a86b5126fe18ca0 /include/video
parentd69bf1aa9ddf62411b4e964f69d9f7a4ffb91816 (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 Original-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> Rebase-Id: R1f445ab544b4c06f56dde1e3f0e9db3c930a9c14
Diffstat (limited to 'include/video')
-rw-r--r--include/video/tegra_dc_ext.h34
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,