DRI2: advertise lowest supported DRI2 protocol version
Update our supported DRI2 protocol version as each driver does DRI2ScreenInit, since depending on available kernel features, each DDX may support different callbacks and therefore protocol. Reviewed-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
This commit is contained in:
parent
87ca6320f2
commit
db1c7cb604
|
@ -45,6 +45,9 @@
|
|||
|
||||
#include "xf86.h"
|
||||
|
||||
CARD8 dri2_major; /* version of DRI2 supported by DDX */
|
||||
CARD8 dri2_minor;
|
||||
|
||||
static int dri2ScreenPrivateKeyIndex;
|
||||
static DevPrivateKey dri2ScreenPrivateKey = &dri2ScreenPrivateKeyIndex;
|
||||
static int dri2WindowPrivateKeyIndex;
|
||||
|
@ -848,6 +851,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
|||
"VDPAU", /* DRI2DriverVDPAU */
|
||||
};
|
||||
unsigned int i;
|
||||
CARD8 cur_minor;
|
||||
|
||||
if (info->version < 3)
|
||||
return FALSE;
|
||||
|
@ -864,6 +868,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
|||
|
||||
ds->fd = info->fd;
|
||||
ds->deviceName = info->deviceName;
|
||||
dri2_major = 1;
|
||||
|
||||
ds->CreateBuffer = info->CreateBuffer;
|
||||
ds->DestroyBuffer = info->DestroyBuffer;
|
||||
|
@ -873,8 +878,15 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
|
|||
ds->ScheduleSwap = info->ScheduleSwap;
|
||||
ds->ScheduleWaitMSC = info->ScheduleWaitMSC;
|
||||
ds->GetMSC = info->GetMSC;
|
||||
cur_minor = 2;
|
||||
} else {
|
||||
cur_minor = 1;
|
||||
}
|
||||
|
||||
/* Initialize minor if needed and set to minimum provied by DDX */
|
||||
if (!dri2_minor || dri2_minor > cur_minor)
|
||||
dri2_minor = cur_minor;
|
||||
|
||||
if (info->version == 3 || info->numDrivers == 0) {
|
||||
/* Driver too old: use the old-style driverName field */
|
||||
ds->numDrivers = 1;
|
||||
|
|
|
@ -46,6 +46,9 @@ typedef struct {
|
|||
void *driverPrivate;
|
||||
} DRI2BufferRec, *DRI2BufferPtr;
|
||||
|
||||
extern CARD8 dri2_major; /* version of DRI2 supported by DDX */
|
||||
extern CARD8 dri2_minor;
|
||||
|
||||
typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
|
||||
typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
|
||||
CARD64 ust, CARD64 msc, CARD64 sbc);
|
||||
|
|
|
@ -80,8 +80,8 @@ ProcDRI2QueryVersion(ClientPtr client)
|
|||
rep.type = X_Reply;
|
||||
rep.length = 0;
|
||||
rep.sequenceNumber = client->sequence;
|
||||
rep.majorVersion = SERVER_DRI2_MAJOR_VERSION;
|
||||
rep.minorVersion = SERVER_DRI2_MINOR_VERSION;
|
||||
rep.majorVersion = dri2_major;
|
||||
rep.minorVersion = dri2_minor;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber, n);
|
||||
|
|
|
@ -51,10 +51,6 @@
|
|||
#define SERVER_DMX_MINOR_VERSION 2
|
||||
#define SERVER_DMX_PATCH_VERSION 20040604
|
||||
|
||||
/* DRI2 */
|
||||
#define SERVER_DRI2_MAJOR_VERSION 1
|
||||
#define SERVER_DRI2_MINOR_VERSION 2
|
||||
|
||||
/* Generic event extension */
|
||||
#define SERVER_GE_MAJOR_VERSION 1
|
||||
#define SERVER_GE_MINOR_VERSION 0
|
||||
|
|
Loading…
Reference in New Issue