xf86-video-r128: Branch 'master'
Connor Behan
cbehan at kemper.freedesktop.org
Fri Aug 31 00:25:44 PDT 2012
src/r128_video.c | 34 +++++++++++++++++++++++++++++-----
1 file changed, 29 insertions(+), 5 deletions(-)
New commits:
commit 4ecd6e67fbbfd52e0ac77a6c48bd3c6a6d5598e7
Author: Connor Behan <connor.behan at gmail.com>
Date: Fri Aug 31 00:19:21 2012 -0700
Scale Xv with the vertical stretch ratio
If we are using a resolution lower than the native resolution of the
flat panel, the video overlay needs to know this. Otherwise a black bar
appears beneath the video. This is essentially Conn's patch from the bug
tracker except it doesn't always rely on info->PanelYRes. ACPI events
can change this without the driver's knowledge.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=6493
Signed-off-by: Connor Behan <connor.behan at gmail.com>
diff --git a/src/r128_video.c b/src/r128_video.c
index 4507b30..bb5a655 100644
--- a/src/r128_video.c
+++ b/src/r128_video.c
@@ -661,13 +661,25 @@ R128DisplayVideo422(
R128InfoPtr info = R128PTR(pScrn);
unsigned char *R128MMIO = info->MMIO;
R128PortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr;
- int v_inc, h_inc, step_by, tmp;
+ int v_inc, h_inc, step_by, tmp, v_inc_shift;
int p1_h_accum_init, p23_h_accum_init;
int p1_v_accum_init;
+ Bool rmx_active;
R128ECP(pScrn, pPriv);
- v_inc = (src_h << 20) / drw_h;
+ v_inc_shift = 20;
+ if (pScrn->currentMode->Flags & V_INTERLACE)
+ v_inc_shift++;
+ if (pScrn->currentMode->Flags & V_DBLSCAN)
+ v_inc_shift--;
+
+ rmx_active = INREG(R128_FP_VERT_STRETCH) & R128_VERT_STRETCH_ENABLE;
+ if (rmx_active) {
+ v_inc = ((src_h * pScrn->currentMode->CrtcVDisplay / info->PanelYRes) << v_inc_shift) / drw_h;
+ } else {
+ v_inc = (src_h << v_inc_shift) / drw_h;
+ }
h_inc = (src_w << (12 + pPriv->ecp_div)) / drw_w;
step_by = 1;
@@ -735,11 +747,23 @@ R128DisplayVideo420(
R128InfoPtr info = R128PTR(pScrn);
unsigned char *R128MMIO = info->MMIO;
R128PortPrivPtr pPriv = info->adaptor->pPortPrivates[0].ptr;
- int v_inc, h_inc, step_by, tmp, leftUV;
+ int v_inc, h_inc, step_by, tmp, leftUV, v_inc_shift;
int p1_h_accum_init, p23_h_accum_init;
int p1_v_accum_init, p23_v_accum_init;
-
- v_inc = (src_h << 20) / drw_h;
+ Bool rmx_active;
+
+ v_inc_shift = 20;
+ if (pScrn->currentMode->Flags & V_INTERLACE)
+ v_inc_shift++;
+ if (pScrn->currentMode->Flags & V_DBLSCAN)
+ v_inc_shift--;
+
+ rmx_active = INREG(R128_FP_VERT_STRETCH) & R128_VERT_STRETCH_ENABLE;
+ if (rmx_active) {
+ v_inc = ((src_h * pScrn->currentMode->CrtcVDisplay / info->PanelYRes) << v_inc_shift) / drw_h;
+ } else {
+ v_inc = (src_h << v_inc_shift) / drw_h;
+ }
h_inc = (src_w << (12 + pPriv->ecp_div)) / drw_w;
step_by = 1;
More information about the xorg-commit
mailing list