summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2005-07-05 09:25:03 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2005-07-05 09:25:03 +0000
commit8fced5b648b0666ca88221e37bc1131ab5c2072d (patch)
treea73d34a097224f946a7321a0b5a23ee478551cfd
parent68bc259fa1082f7780e524fc703e926a27fc7f9a (diff)
Fix Xvideo when operating in one line mode and video is pushed off the top of
the screen. Also some fixes for Xvideo skew in certain resolutions.
-rw-r--r--src/i830_video.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/i830_video.c b/src/i830_video.c
index 7c7031fb..834dd560 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1245,7 +1245,7 @@ I830DisplayVideo(ScrnInfoPtr pScrn, int id, short width, short height,
case FOURCC_UYVY:
case FOURCC_YUY2:
default:
- swidth = width << 1;
+ swidth = width;
overlay->SWIDTH = swidth;
ErrorF("Y width is %d\n", swidth);
@@ -1270,17 +1270,18 @@ I830DisplayVideo(ScrnInfoPtr pScrn, int id, short width, short height,
if (pPriv->oneLineMode) {
/* change the coordinates with panel fitting active */
- /* Should move this to before clip helper */
dstBox->y1 = (((dstBox->y1 - 1) * pPriv->scaleRatio) >> 16) + 1;
dstBox->y2 = ((dstBox->y2 * pPriv->scaleRatio) >> 16) + 1;
- if (dstBox->y1 < 0) dstBox->y1 = 0;
-
/* Now, alter the height, so we scale to the correct size */
- drw_h = dstBox->y2 - dstBox->y1;
- if (drw_h < height) drw_h = height;
+ drw_h = ((drw_h * pPriv->scaleRatio) >> 16) + 1;
+
+ /* Keep the engine happy */
+ if (dstBox->y1 < 0) dstBox->y1 = 0;
+ if (dstBox->y2 < 0) dstBox->y2 = 0;
}
+
overlay->DWINPOS = (dstBox->y1 << 16) | dstBox->x1;
overlay->DWINSZ = ((dstBox->y2 - dstBox->y1) << 16) |
@@ -1588,7 +1589,7 @@ I830PutImage(ScrnInfoPtr pScrn,
switch (id) {
case FOURCC_YV12:
case FOURCC_I420:
- srcPitch = width;
+ srcPitch = (width + 3) & ~3;
srcPitch2 = ((width >> 1) + 3) & ~3;
dstPitch = ((width / 2) + 63) & ~63; /* of chroma */
size = dstPitch * height * 3;