summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-19 04:24:05 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-24 20:28:59 +0400
commitff7839d06af13c151c95e7c23e060143d7a580e1 (patch)
tree495fbeecd0649023e935873ab1be6ef7077506ac
parent49a9c5e45def814c31ab5b319ea24874d7884874 (diff)
downloadlinux-sunxi-ff7839d06af13c151c95e7c23e060143d7a580e1.tar.xz
sunxi-hdmi: Fix data byte 2 of hdmi avi frame
Before this patch the YUV_COLORSPACE was dynamically adjusting the 2nd data byte based on the pixelclock, to select between the ITU601 (old standard tv colorspace) and ITU709 colorspace (new hd tv colorspace), as well as between 4:3 and 16:9 picture aspect ratio. But in RGB colorspace mode the 2nd data byte is hardcoded to ITO601 4:3. This patch fixes this, and also makes only the colorspace selection depend on the pixelclock (checking for sd-mode clocks). While using the actual picture aspect ratio to set the aspect ratio. This is necessary since with EDID support non SD modes may still have a 4:3 aspect ratio. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_core.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/video/sunxi/hdmi/hdmi_core.c b/drivers/video/sunxi/hdmi/hdmi_core.c
index bebf76b1cc31..bae0408a894a 100644
--- a/drivers/video/sunxi/hdmi/hdmi_core.c
+++ b/drivers/video/sunxi/hdmi/hdmi_core.c
@@ -330,16 +330,19 @@ __s32 video_config(__s32 vic)
HDMI_WUINT8(0x083, 0x00);
#ifdef YUV_COLORSPACE /* Fix me */
HDMI_WUINT8(0x084, 0x52); /* Data Byte 1: 4:4:4 YCbCr */
- if (video_timing[vic_tab].PCLK < 74250000) /* 4:3 601 */
- HDMI_WUINT8(0x085, 0x58); /* Data Byte 2 */
- else /* 16:9 709 */
- HDMI_WUINT8(0x085, 0xa8); /* Data Byte 2 */
#else
HDMI_WUINT8(0x084, 0x12); /* Data Byte 1: RGB */
- /* 4:3 601 */
- HDMI_WUINT8(0x085, 0x58); /* Data Byte 2 */
#endif
-
+ if (video_timing[vic_tab].PCLK <= 27000000)
+ reg_val = 0x40; /* SD-modes, assume ITU601 colorspace */
+ else
+ reg_val = 0x80; /* HD-modes, assume ITU709 colorspace */
+ if (video_timing[vic_tab].INPUTX * 100 /
+ video_timing[vic_tab].INPUTY < 156)
+ reg_val |= 0x18; /* 4 : 3 */
+ else
+ reg_val |= 0x28; /* 16 : 9 */
+ HDMI_WUINT8(0x085, reg_val); /* Data Byte 2 */
HDMI_WUINT8(0x086, 0x00);
HDMI_WUINT8(0x087, (video_timing[vic_tab].VIC >=
HDMI_NON_CEA861D_START) ?