Automatic XvMC hardware driver loading.

Thomas Hellström unichrome at shipmail.org
Mon Nov 8 11:05:20 PST 2004


Hi!

After some discussions with Kendall Bennet, I've posted a proposed 
solution to make
XvMC automatically load the correct client driver.

Please take a look at

http://freedesktop.org/bugzilla/attachment.cgi?id=1242&action=diff

for comments/suggestions.

It works as follows:
1. The 2d driver calls

int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name,
                           char *busID, int major, int minor,
                           int patchLevel);

right after initializing the XvMC extension.
busid, and the version info of the internal protocol between the XvMC lib
and the 2d driver are optional.

2. The XvMC wrapper calls

Status XvMCGetDRInfo(Display *dpy, XvPortID port,
                     char **name, char **busID
		     int *major, int *minor,
                     int *patchLevel,int *isLocal)

To get the above info. Strings handed over should be freed with XFree.
If the connection is local, the wrapper then tries to load the library 
indicated by "name". The function is optionally usable also within the 
XvMC hardware driver to determine busID and internal protocol version.

3. XvMC version is bumped from 1.0 to 1.1. In this way the 2d driver 
will determine  using #if when this extension is available.

4. If the extension is not available or the call fails, the wrapper will 
revert back to the library name found in <config_dir>/XvMCConfig, thus 
being compatible with earlier Nvidia drivers. After having read Alan 
Cox' latest post, maybe it should be better to have it parse the main X 
config file for an XvMC section?

Also Kendall and me thought it would be best to incorporate the wrapper 
functionality into libXvMC but lauching "libXvMC2" or something similar 
being careful not to brake too many existing applications

Regards
Thomas







More information about the xorg mailing list