Bug #3163: Create new DRIINFO_*_VERSION macros to indicate the version

number of the DRIInfoRec, disambiguating it from the XF86DRI protocol
    version number. Modify DRIQueryVersion to return the libdri version
    number, which all DDXes were requesting implicitly. Fix the DDXes to
    check for the DRIINFO version they were compiled against.
This commit is contained in:
Adam Jackson 2005-05-18 17:47:35 +00:00
parent fddcde777f
commit b87a32fb0e
2 changed files with 22 additions and 6 deletions

View File

@ -1958,14 +1958,15 @@ DRIGetWrappedFuncs(ScreenPtr pScreen)
return &(DRI_SCREEN_PRIV(pScreen)->wrap);
}
/* note that this returns the library version, not the protocol version */
void
DRIQueryVersion(int *majorVersion,
int *minorVersion,
int *patchVersion)
{
*majorVersion = XF86DRI_MAJOR_VERSION;
*minorVersion = XF86DRI_MINOR_VERSION;
*patchVersion = XF86DRI_PATCH_VERSION;
*majorVersion = DRIINFO_MAJOR_VERSION;
*minorVersion = DRIINFO_MINOR_VERSION;
*patchVersion = DRIINFO_PATCH_VERSION;
}
static void

View File

@ -94,14 +94,29 @@ typedef struct {
} DRIWrappedFuncsRec, *DRIWrappedFuncsPtr;
/*
* Prior to Xorg 6.8.99.8, the DRIInfoRec structure was implicitly versioned
* by the XF86DRI_*_VERSION defines in xf86dristr.h. These numbers were also
* being used to version the XFree86-DRI protocol. Bugs #3066 and #3163
* showed that this was inadequate. The DRIInfoRec structure is now versioned
* by the DRIINFO_*_VERSION defines in this file. - ajax, 2005-05-18.
*
* Revision history:
* 4.1.0 and earlier: DRIQueryVersion returns XF86DRI_*_VERSION.
* 4.2.0: DRIQueryVersion begins returning DRIINFO_*_VERSION.
*/
#define DRIINFO_MAJOR_VERSION 4
#define DRIINFO_MINOR_VERSION 2
#define DRIINFO_PATCH_VERSION 0
typedef struct {
/* driver call back functions
*
* New fields should be added at the end for backwards compatability.
* Don't forget to bump the version minor number in
* xc/lib/GL/dri/xf86dristr.h
* New fields should be added at the end for backwards compatibility.
* Bump the DRIINFO patch number to indicate bugfixes.
* Bump the DRIINFO minor number to indicate new fields.
* Bump the DRIINFO major number to indicate binary-incompatible changes.
*/
Bool (*CreateContext)(ScreenPtr pScreen,
VisualPtr visual,