summaryrefslogtreecommitdiff
path: root/src/i965_video.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-04-17 10:50:02 -0700
committerEric Anholt <eric@anholt.net>2007-04-17 11:01:24 -0700
commit37ee68a95ca8c86ebe9abafaaf55b060dd2a2f73 (patch)
treedfb2e4eb024dfbe746a3c963f98b1dfd7b425153 /src/i965_video.c
parentac9181c014638dbeb334b40b4029d0ccb2b7a0fc (diff)
Bug #10438: Fix 965 XV when sourcing from less than the full image.
Bob deinterlacing in MythTV, and the zoom options in totem would result in attempting to source from outside the video instead of scaling appropriately.
Diffstat (limited to 'src/i965_video.c')
-rw-r--r--src/i965_video.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/i965_video.c b/src/i965_video.c
index 9e96527d..17d20061 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -172,6 +172,7 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
struct brw_instruction *ps_kernel;
struct brw_instruction *sip_kernel;
float *vb;
+ float src_scale_x, src_scale_y;
CARD32 *binding_table;
Bool first_output = TRUE;
int dest_surf_offset, src_surf_offset, src_sampler_offset, vs_offset;
@@ -672,6 +673,10 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
dxo = dstRegion->extents.x1;
dyo = dstRegion->extents.y1;
+ /* Use normalized texture coordinates */
+ src_scale_x = ((float)src_w / width) / (float)drw_w;
+ src_scale_y = ((float)src_h / height) / (float)drw_h;
+
pbox = REGION_RECTS(dstRegion);
nbox = REGION_NUM_RECTS(dstRegion);
while (nbox--) {
@@ -680,7 +685,6 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
int box_x2 = pbox->x2;
int box_y2 = pbox->y2;
int i;
- float src_scale_x, src_scale_y;
if (!first_output) {
/* Since we use the same little vertex buffer over and over, sync
@@ -691,10 +695,6 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
pbox++;
- /* Use normalized texture coordinates */
- src_scale_x = (float)1.0 / (float)drw_w;
- src_scale_y = (float)1.0 / (float)drw_h;
-
i = 0;
vb[i++] = (box_x2 - dxo) * src_scale_x;
vb[i++] = (box_y2 - dyo) * src_scale_y;