diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2009-12-01 14:32:33 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-01-07 10:25:07 -0800 |
commit | ce7ba18f577cc9aedddaff303dbc9662a276b4cf (patch) | |
tree | 69abfcbe5031bb7c4ccde355a93e38fd5a171e67 | |
parent | 1ac7c94083a3266e2d5dd932709118436074dd00 (diff) |
Xv: consolidate xmvc passthrough handling
It's now all in I830PutImageTextured. Also kill some leftovers
from XVMC-on-overlay support and ums-XVMC-on-i915 support. Plus
a small comment as a reminder for where to add i915 xvmc support
back in.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | src/i830_video.c | 88 |
1 files changed, 37 insertions, 51 deletions
diff --git a/src/i830_video.c b/src/i830_video.c index 2f38b2b7..397a2644 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -1355,22 +1355,12 @@ i830_setup_video_buffer(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, adaptor_priv->buf = NULL; } - if (xvmc_passthrough(id)) { - i830_free_video_buffers(adaptor_priv); - if (IS_I965G(intel)) { - adaptor_priv->buf = - drm_intel_bo_gem_create_from_name(intel->bufmgr, - "xvmc surface", - (uintptr_t)buf); - } - } else { - if (adaptor_priv->buf == NULL) { - adaptor_priv->buf = drm_intel_bo_alloc(intel->bufmgr, - "xv buffer", alloc_size, - 4096); - if (adaptor_priv->buf == NULL) - return FALSE; - } + if (adaptor_priv->buf == NULL) { + adaptor_priv->buf = drm_intel_bo_alloc(intel->bufmgr, + "xv buffer", alloc_size, + 4096); + if (adaptor_priv->buf == NULL) + return FALSE; } return TRUE; @@ -1389,11 +1379,6 @@ i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, s */ if (adaptor_priv->textured) { pitchAlignMask = 3; -#ifdef INTEL_XVMC - /* for i915 xvmc, hw requires at least 1kb aligned surface */ - if ((id == FOURCC_XVMC) && IS_I915(intel)) - pitchAlignMask = 0x3ff; -#endif } else { if (IS_I965G(intel)) pitchAlignMask = 255; @@ -1471,38 +1456,25 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, return FALSE; /* fixup pointers */ -#ifdef INTEL_XVMC - if (id == FOURCC_XVMC && IS_I915(intel)) { - adaptor_priv->YBufOffset = (uint32_t) ((uintptr_t) buf); - adaptor_priv->VBufOffset = adaptor_priv->YBufOffset + (*dstPitch2 * height); + adaptor_priv->YBufOffset = 0; + + if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) { adaptor_priv->UBufOffset = - adaptor_priv->VBufOffset + (*dstPitch * height / 2); + adaptor_priv->YBufOffset + (*dstPitch * 2 * width); + adaptor_priv->VBufOffset = + adaptor_priv->UBufOffset + (*dstPitch * width / 2); } else { -#endif - adaptor_priv->YBufOffset = 0; - - if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) { - adaptor_priv->UBufOffset = - adaptor_priv->YBufOffset + (*dstPitch * 2 * width); - adaptor_priv->VBufOffset = - adaptor_priv->UBufOffset + (*dstPitch * width / 2); - } else { - adaptor_priv->UBufOffset = - adaptor_priv->YBufOffset + (*dstPitch * 2 * height); - adaptor_priv->VBufOffset = - adaptor_priv->UBufOffset + (*dstPitch * height / 2); - } -#ifdef INTEL_XVMC + adaptor_priv->UBufOffset = + adaptor_priv->YBufOffset + (*dstPitch * 2 * height); + adaptor_priv->VBufOffset = + adaptor_priv->UBufOffset + (*dstPitch * height / 2); } -#endif /* copy data */ if (is_planar_fourcc(id)) { - if (!xvmc_passthrough(id)) { - I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2, - *dstPitch, height, top, left, nlines, - npixels, id); - } + I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2, + *dstPitch, height, top, left, nlines, + npixels, id); } else { I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left, nlines, npixels); @@ -1561,10 +1533,24 @@ I830PutImageTextured(ScrnInfoPtr scrn, width, height)) return Success; - if (!i830_copy_video_data(scrn, adaptor_priv, width, height, - &dstPitch, &dstPitch2, - top, left, npixels, nlines, id, buf)) - return BadAlloc; + if (xvmc_passthrough(id)) { + i830_free_video_buffers(adaptor_priv); + if (IS_I965G(intel)) { + adaptor_priv->buf = + drm_intel_bo_gem_create_from_name(intel->bufmgr, + "xvmc surface", + (uintptr_t)buf); + } else { + /* XXX: i915 is not support and needs some serious care. + * grep for KMS in i915_hwmc.c */ + return BadAlloc; + } + } else { + if (!i830_copy_video_data(scrn, adaptor_priv, width, height, + &dstPitch, &dstPitch2, + top, left, npixels, nlines, id, buf)) + return BadAlloc; + } if (crtc && adaptor_priv->SyncToVblank != 0) { i830_wait_for_scanline(scrn, pixmap, crtc, clipBoxes); |