[RFC] Add VDPAU drivers to the server's DRI2 implementation

Aaron Plattner aplattner at nvidia.com
Wed Nov 4 12:43:02 PST 2009


On Tue, Nov 03, 2009 at 06:30:33PM -0800, Kristian Høgsberg wrote:
> 2009/11/3 Aaron Plattner <aplattner at nvidia.com>:
> > The following changes since commit 412c56ef3332d09efbd861e41c3e985f44729729:
> >  Maarten Maathuis (1):
> >        exa: remove some outdated comment
> >
> > are available in the git repository at:
> >
> >  git://people.freedesktop.org/~aplattner/xserver dri2-vdpau
> 
> Hi Aaron,
> 
> The series looks good, except for the commit that adds
> DRI2CheckDriver() in all the protocol entry points.  All these entry
> points are useful no matter what driver the client has loaded.  The
> idea is that the client asks the server for buffers to render into
> (using DRI2GetBuffers), does the rendering client side and then copies
> from the buffer into the X window (using DRI2CopyRegion).  This flow
> is the same whether you're rendering OpenGL (which is what
> DRI2DriverDRI means; yes, it's badly named...), VDPAU, VAAPI,
> cairo-drm, or some other client side driver.  So all these entry
> points shouldn't depend on the DRI2DriverDRI driver to be present,
> they should always get passed through to the DDX driver.  If one of
> the function pointers are NULL and one of the entry points get called
> anyway, it's a client error (if the client is not relying on DRI2 for
> getting the bits into the X window, it shouldn't be calling those
> entry points), but of course that shouldn't crash the server.

Okay.  Since the ability for X clients to crash the server with unexpected
DRI2 requests is an existing bug, I opted not to fix it here and instead
just reverted/rebased (revertibased?) that part of the patchset, since it's
not actually necessary for the VDPAU stuff.  I rolled the equivalent
functionality into DRI2Connect, which now returns FALSE (instead of
BadValue) when the driver is unrecognized or not supported.

> Detecting that the function pointers are NULL from dri2ext.c is a
> little tricky though.  A lot of the dri2.c entry points don't return
> error codes, so maybe we can add a function like your
> DRI2CheckDriver(), but instead have it return TRUE if all the required
> function pointers are non-NULL.

Agreed.  I'll file a bug on it.

> Did we ever commit the DRI2DriverVDPAU token to the dri2proto module?
> I don't see it in the dri2tokens.h header.  We should get it in there,
> since adding VDPAU in the array of driver names effectively allocates
> 1 as the DRI2DriverVDPAU value.

Not yet.  That needs to be released first and I need to bump the DRI2PROTO
PKG_CHECK_MODULES version before this set can be pulled.

Thanks for your feedback!

Sincerely,
Aaron


The following changes since commit 7442f3355ab8f0bb2b1a270da18c65d8d315d4dd:
  Keith Packard (1):
        Merge remote branch 'jeremyhu/master'

are available in the git repository at:

  git://people.freedesktop.org/~aplattner/xserver dri2-vdpau

Aaron Plattner (3):
      DRI2: Tie the DRI2 module version to the protocol version.
      DRI2: Allow multiple driver names.
      DRI2: Print names of supported drivers in DRI2ScreenInit.

 hw/xfree86/dri2/dri2.c |   47 +++++++++++++++++++++++++++++++++++++++--------
 hw/xfree86/dri2/dri2.h |   10 +++++++++-
 2 files changed, 48 insertions(+), 9 deletions(-)


More information about the xorg-devel mailing list