[Intel-gfx] [PATCH 3/3] XvMC: Hack up zero-copy bo passthrough to work with kms

Daniel Vetter daniel at ffwll.ch
Mon Nov 2 10:34:41 CET 2009


On Mon, Nov 02, 2009 at 04:06:58PM +0800, Zhenyu Wang wrote:
> > - the hack used there only works for i965, not for the XvMC code for
> >   i915. I prefer consistent ugly hacks over inconsistent ones.
>
> I don't think that's a 'hack', but a solution, and it's under IS_I965G().
> It seems i915 XvMC got no lover, and it needs full rework to be back to work
> in current world.

I called yours and my solution a hack because it slightly abuses the
interfaces and passes something else than a buffer of YUV data as argument
buf.

> The idea in my patch is simple, XvMC surface is just hw decoded image data like
> Xv image, so I tried to remove origin ugly code that tried to differentiate it,
> which is totally unnecessary. Yeah, it's only for i965.

Actually I'm using a slight variation of your idea. Instead of passing the
drm surface name I'm passing the drm_intel_bo * pointer into the buf
argument. This has the following advantages:
- the Xv code gets exactly what it needs, no drm_intel_bo_create_from_name
  call is needed.
- because the i915 hwmc code uses different surface names my solution
  doesn't need a special case to make i915 xvmc passthrough work.
- clients can pass in anything via the XVMC port. I'm afraid of ugly
  crashes when we assume it's an 0-terminated string.

> > - the changes to the xvmc_passthrough as forward-ported by Eric Anholt
> >   definitely breaks XvMC on Xv overlay with rotated crtc. Yep, it's
> >   totally unlikely anyone is using this, but still, try to keep it
> >   a supported config working.
> >
>
> But XvMC never works on overlay port, XvMC requires a specific Xv adapter
> assigned to it when init, and current code only gives texture video adapter
> to XvMC.

Uups, yes you're correct. I've just noticed that intel_xvmc_driver_init is
only called for the textured video adaptor. I was confused by the fact
because all the xvmc support code is still there in the overlay code (and
looked functional before you're changes).

I'll prep a patch to nuke all remnants of the xvmc support from the
overlay code to unconfuse my mind - I don't think anyone wants to
resurrect this.

Thanks for the review, Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list