summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-01-25 20:50:07 +0400
committerAlejandro Mery <amery@geeks.cl>2013-01-28 16:49:25 +0400
commit1785ac14a76450ee9be17ae7fae56597d1d21936 (patch)
tree51382f500a56166e1cbcebcb57c5c63c651a48be
parent7d352db70e82f2f5e17a03c44f8ba8f54923d145 (diff)
downloadlinux-sunxi-1785ac14a76450ee9be17ae7fae56597d1d21936.tar.xz
sunxi-hdmi: edid: introduce HT and VT helper variables
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--drivers/video/sunxi/hdmi/hdmi_edid.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/video/sunxi/hdmi/hdmi_edid.c b/drivers/video/sunxi/hdmi/hdmi_edid.c
index 6d2eb2ea9e77..1b12833d7bfd 100644
--- a/drivers/video/sunxi/hdmi/hdmi_edid.c
+++ b/drivers/video/sunxi/hdmi/hdmi_edid.c
@@ -216,7 +216,7 @@ Parse_DTD_Block(__u8 *pbuf)
__u32 dummy, pclk, sizex, Hblanking, sizey, Vblanking, Hsync_offset,
Hsync_pulsew, Vsync_offset, Vsync_pulsew, H_image_size,
V_image_size, H_Border, V_Border, pixels_total, frame_rate,
- Hsync, Vsync;
+ Hsync, Vsync, HT, VT;
pclk = (((__u32) pbuf[1] << 8) + pbuf[0]) * 10000;
sizex = (((__u32) pbuf[4] << 4) & 0x0f00) + pbuf[2];
Hblanking = (((__u32) pbuf[4] << 8) & 0x0f00) + pbuf[3];
@@ -232,8 +232,10 @@ Parse_DTD_Block(__u8 *pbuf)
V_Border = pbuf[16];
Hsync = (pbuf[17] & 0x02) >> 1;
Vsync = (pbuf[17] & 0x04) >> 2;
+ HT = sizex + Hblanking;
+ VT = sizey + Vblanking;
- pixels_total = (sizex + Hblanking) * (sizey + Vblanking);
+ pixels_total = HT * VT;
if ((pbuf[0] == 0) && (pbuf[1] == 0) && (pbuf[2] == 0))
return 0;
@@ -282,9 +284,9 @@ Parse_DTD_Block(__u8 *pbuf)
pr_info("PCLK=%d X %d %d %d %d Y %d %d %d %d fr %d %s%s\n", pclk,
sizex, sizex + Hsync_offset,
- sizex + Hsync_offset + Hsync_pulsew, sizex + Hblanking,
+ sizex + Hsync_offset + Hsync_pulsew, HT,
sizey, sizey + Vsync_offset,
- sizey + Vsync_offset + Vsync_pulsew, sizey + Vblanking,
+ sizey + Vsync_offset + Vsync_pulsew, VT,
frame_rate, Hsync ? "P" : "N", Vsync ? "P" : "N");
/* Pick the first mode with a width which is a multiple of 8 and
@@ -296,11 +298,11 @@ Parse_DTD_Block(__u8 *pbuf)
video_timing[video_timing_edid].AVI_PR = 0;
video_timing[video_timing_edid].INPUTX = sizex;
video_timing[video_timing_edid].INPUTY = sizey;
- video_timing[video_timing_edid].HT = sizex + Hblanking;
+ video_timing[video_timing_edid].HT = HT;
video_timing[video_timing_edid].HBP = Hblanking - Hsync_offset;
video_timing[video_timing_edid].HFP = Hsync_offset;
video_timing[video_timing_edid].HPSW = Hsync_pulsew;
- video_timing[video_timing_edid].VT = sizey + Vblanking;
+ video_timing[video_timing_edid].VT = VT;
video_timing[video_timing_edid].VBP = Vblanking - Vsync_offset;
video_timing[video_timing_edid].VFP = Vsync_offset;
video_timing[video_timing_edid].VPSW = Vsync_pulsew;