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

Aaron Plattner aplattner at nvidia.com
Tue Nov 3 10:51:38 PST 2009


On Tue, Oct 27, 2009 at 12:42:50PM -0700, Aaron Plattner wrote:
> On Mon, Oct 26, 2009 at 02:58:50PM -0700, Kristian Høgsberg wrote:
> > 2009/10/26 Aaron Plattner <aplattner at nvidia.com>:
> > > On Mon, Oct 26, 2009 at 10:45:31AM -0700, Kristian Høgsberg wrote:
> > >> 2009/10/26 Aaron Plattner <aplattner at nvidia.com>:
> > >> > On Sat, Oct 24, 2009 at 08:56:11AM -0700, Kristian Høgsberg wrote:
> > >> The only thing DRI2 should do in this case is to give out a different
> > >> driver name for different driver types.  The thinking is that for
> > >> different driver types (GL, VDPAU, VAAPI, cairo-drm, etc), the
> > >> implementation may be split into differently named .so's and may even
> > >> group the chip support differently.  For example, for mesa, the intel
> > >> driver is either i915_dri.so or i965_dri.so, but cairo-drm may just
> > >> load cairo-drm-intel.so for all chipsets (just an example).  The drm
> > >> device file to use is the same in all cases though.
> > >
> > > Oh, eww.  I didn't realize that's how driverType was intended to be used.
> > > For drivers that use DRI2 as their backend implementation to talk to the
> > > hardware (e.g. the Mesa/Gallium GL drivers or Cairo-DRM), I assumed the
> > > server wouldn't really care what they were and they'd just go through the
> > > same generic DRI2DriverDRI interface.
> > >
> > >> Right now, the DRI2 interface in the server doesn't support this,
> > >> since it only allows one driver name to be specified in the
> > >> DRI2InfoRec.  That's an oversight on my part.  But we can fix it by
> > >> adding an array of driver names to the struct and a length field.  If
> > >> the requested driver type passed in in DRI2Connect is outside the
> > >> array or the driver name entry is NULL, that driver type is not
> > >> supported and we can return BadValue.  Otherwise, we fill out the
> > >> return values and proceed as normal.
> > >
> > > So I'd just pass in .driverNames = { NULL, "nvidia" }, .driverCount = 2?
> > > I'll need to go through an make do_get_buffers and friends check whether
> > > ds->{Create,Destroy}Buffer, etc. are NULL if we go that route since those
> > > requests won't be implemented.
> > 
> > Yup, exactly.
> 
> Okay, I'll try to code that up along with the various NULL checks sometime
> soon.
> 
> Thanks a lot for your feedback.

I updated my private branch with your suggestions:


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

Aaron Plattner (4):
      DRI2: Tie the DRI2 module version to the protocol version.
      DRI2: Return BadMatch if the requested driver has not been initialized.
      DRI2: Allow multiple driver names.
      DRI2: Print names of supported drivers in DRI2ScreenInit.

 hw/xfree86/dri2/dri2.c    |   59 ++++++++++++++++++++++++++++++++++++++------
 hw/xfree86/dri2/dri2.h    |   21 +++++++++++++++-
 hw/xfree86/dri2/dri2ext.c |   14 ++++++++++
 3 files changed, 85 insertions(+), 9 deletions(-)


More information about the xorg-devel mailing list