diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2009-12-01 14:32:31 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-01-07 10:25:07 -0800 |
commit | 31f13fa8a0d4cd28067de37d0d31d23e8200d0ff (patch) | |
tree | 303605b26339a9b0f978d7fd2abec16debdce852 /src/i830_video.c | |
parent | ce6526b9b4df304ccd83a0a02a95621300dbaed3 (diff) |
Xv: move users of x1, x2, y1, y2 to PutImage
After this there are no other external users of these strange variables,
so we can nicely hide them somewhere in the next changeset.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/i830_video.c')
-rw-r--r-- | src/i830_video.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/i830_video.c b/src/i830_video.c index c0783993..30017f06 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -1427,14 +1427,11 @@ i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, s static Bool i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, short width, short height, int *dstPitch, int *dstPitch2, - INT32 x1, INT32 y1, INT32 x2, INT32 y2, + int top, int left, int npixels, int nlines, int id, unsigned char *buf) { -#ifdef INTEL_XVMC - intel_screen_private *intel = intel_get_screen_private(scrn); -#endif int srcPitch = 0, srcPitch2 = 0; - int top, left, npixels, nlines, size; + int size; if (is_planar_fourcc(id)) { srcPitch = (width + 0x3) & ~0x3; @@ -1476,20 +1473,13 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, #endif /* copy data */ - top = y1 >> 16; - left = (x1 >> 16) & ~1; - npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; - if (is_planar_fourcc(id)) { if (!xvmc_passthrough(id)) { - top &= ~1; - nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2, *dstPitch, height, top, left, nlines, npixels, id); } } else { - nlines = ((y2 + 0xffff) >> 16) - top; I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left, nlines, npixels); } @@ -1529,6 +1519,7 @@ I830PutImageTextured(ScrnInfoPtr scrn, int dstPitch2 = 0; BoxRec dstBox; xf86CrtcPtr crtc; + int top, left, npixels, nlines; #if 0 ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n" @@ -1554,9 +1545,18 @@ I830PutImageTextured(ScrnInfoPtr scrn, width, height)) return Success; + top = y1 >> 16; + left = (x1 >> 16) & ~1; + npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; + if (is_planar_fourcc(id)) { + top &= ~1; + nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + } else + nlines = ((y2 + 0xffff) >> 16) - top; + if (!i830_copy_video_data(scrn, adaptor_priv, width, height, &dstPitch, &dstPitch2, - x1, y1, x2, y2, id, buf)) + top, left, npixels, nlines, id, buf)) return BadAlloc; if (crtc && adaptor_priv->SyncToVblank != 0) { @@ -1599,6 +1599,7 @@ I830PutImageOverlay(ScrnInfoPtr scrn, int dstPitch2 = 0; BoxRec dstBox; xf86CrtcPtr crtc; + int top, left, npixels, nlines; #if 0 ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n" @@ -1642,9 +1643,18 @@ I830PutImageOverlay(ScrnInfoPtr scrn, return Success; } + top = y1 >> 16; + left = (x1 >> 16) & ~1; + npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left; + if (is_planar_fourcc(id)) { + top &= ~1; + nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; + } else + nlines = ((y2 + 0xffff) >> 16) - top; + if (!i830_copy_video_data(scrn, adaptor_priv, width, height, &dstPitch, &dstPitch2, - x1, y1, x2, y2, id, buf)) + top, left, npixels, nlines, id, buf)) return BadAlloc; if (!i830_display_overlay |