Add a version field to __DRIextension.
This commit is contained in:
@@ -74,20 +74,38 @@ typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
|
|||||||
* structs and the loader can use the extensions it knows about by
|
* structs and the loader can use the extensions it knows about by
|
||||||
* casting it to a more specific extension and optionally advertising
|
* casting it to a more specific extension and optionally advertising
|
||||||
* the GLX extension. See below for examples.
|
* the GLX extension. See below for examples.
|
||||||
|
*
|
||||||
|
* We never break API in for a DRI extension. If we need to change
|
||||||
|
* the way things work in a non-backwards compatible manner, we
|
||||||
|
* introduce a new extension. During a transition period, we can
|
||||||
|
* leave both the old and the new extension in the driver, which
|
||||||
|
* allows us to move to the new interface without having to update the
|
||||||
|
* loader(s) in lock step.
|
||||||
|
*
|
||||||
|
* However, we can add entry points to an extension over time as long
|
||||||
|
* as we don't break the old ones. As we add entry points to an
|
||||||
|
* extension, we increase the version number. The corresponding
|
||||||
|
* #define can be used to guard code that accesses the new entry
|
||||||
|
* points at compile time and the version field in the extension
|
||||||
|
* struct can be used at run-time to determine how to use the
|
||||||
|
* extension.
|
||||||
*/
|
*/
|
||||||
struct __DRIextensionRec {
|
struct __DRIextensionRec {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
int version;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by drivers to indicate support for setting the read drawable.
|
* Used by drivers to indicate support for setting the read drawable.
|
||||||
*/
|
*/
|
||||||
#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
|
#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
|
||||||
|
#define __DRI_READ_DRAWABLE_VERSION 1
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
|
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
|
||||||
*/
|
*/
|
||||||
#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
|
#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
|
||||||
|
#define __DRI_COPY_SUB_BUFFER_VERSION 1
|
||||||
struct __DRIcopySubBufferExtensionRec {
|
struct __DRIcopySubBufferExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
|
void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
|
||||||
@@ -98,6 +116,7 @@ struct __DRIcopySubBufferExtensionRec {
|
|||||||
* GLX_MESA_swap_control extension.
|
* GLX_MESA_swap_control extension.
|
||||||
*/
|
*/
|
||||||
#define __DRI_SWAP_CONTROL "DRI_SwapControl"
|
#define __DRI_SWAP_CONTROL "DRI_SwapControl"
|
||||||
|
#define __DRI_SWAP_CONTROL_VERSION 1
|
||||||
struct __DRIswapControlExtensionRec {
|
struct __DRIswapControlExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
|
void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
|
||||||
@@ -108,6 +127,7 @@ struct __DRIswapControlExtensionRec {
|
|||||||
* Used by drivers that implement the GLX_MESA_allocate_memory.
|
* Used by drivers that implement the GLX_MESA_allocate_memory.
|
||||||
*/
|
*/
|
||||||
#define __DRI_ALLOCATE "DRI_Allocate"
|
#define __DRI_ALLOCATE "DRI_Allocate"
|
||||||
|
#define __DRI_ALLOCATE_VERSION 1
|
||||||
struct __DRIallocateExtensionRec {
|
struct __DRIallocateExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
@@ -124,6 +144,7 @@ struct __DRIallocateExtensionRec {
|
|||||||
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
|
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
|
||||||
*/
|
*/
|
||||||
#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
|
#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
|
||||||
|
#define __DRI_FRAME_TRACKING_VERSION 1
|
||||||
struct __DRIframeTrackingExtensionRec {
|
struct __DRIframeTrackingExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
@@ -149,6 +170,7 @@ struct __DRIframeTrackingExtensionRec {
|
|||||||
* Used by drivers that implement the GLX_SGI_video_sync extension.
|
* Used by drivers that implement the GLX_SGI_video_sync extension.
|
||||||
*/
|
*/
|
||||||
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
|
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
|
||||||
|
#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
|
||||||
struct __DRImediaStreamCounterExtensionRec {
|
struct __DRImediaStreamCounterExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
@@ -171,6 +193,7 @@ struct __DRImediaStreamCounterExtensionRec {
|
|||||||
|
|
||||||
|
|
||||||
#define __DRI_TEX_OFFSET "DRI_TexOffset"
|
#define __DRI_TEX_OFFSET "DRI_TexOffset"
|
||||||
|
#define __DRI_TEX_OFFSET_VERSION 1
|
||||||
struct __DRItexOffsetExtensionRec {
|
struct __DRItexOffsetExtensionRec {
|
||||||
__DRIextension base;
|
__DRIextension base;
|
||||||
|
|
||||||
|
@@ -51,7 +51,7 @@ static const int empty_attribute_list[1] = { None };
|
|||||||
* supports setting a read drawable.
|
* supports setting a read drawable.
|
||||||
*/
|
*/
|
||||||
const __DRIextension driReadDrawableExtension = {
|
const __DRIextension driReadDrawableExtension = {
|
||||||
__DRI_READ_DRAWABLE
|
__DRI_READ_DRAWABLE, __DRI_READ_DRAWABLE_VERSION
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -393,7 +393,7 @@ static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = {
|
const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = {
|
||||||
{ __DRI_MEDIA_STREAM_COUNTER },
|
{ __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION },
|
||||||
driGetMSC,
|
driGetMSC,
|
||||||
driWaitForMSC,
|
driWaitForMSC,
|
||||||
};
|
};
|
||||||
@@ -406,7 +406,8 @@ static void driCopySubBuffer(__DRIdrawable *drawable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const __DRIcopySubBufferExtension driCopySubBufferExtension = {
|
const __DRIcopySubBufferExtension driCopySubBufferExtension = {
|
||||||
{ __DRI_COPY_SUB_BUFFER }, driCopySubBuffer
|
{ __DRI_COPY_SUB_BUFFER, __DRI_COPY_SUB_BUFFER_VERSION },
|
||||||
|
driCopySubBuffer
|
||||||
};
|
};
|
||||||
|
|
||||||
static void driSetSwapInterval(__DRIdrawable *drawable, unsigned int interval)
|
static void driSetSwapInterval(__DRIdrawable *drawable, unsigned int interval)
|
||||||
@@ -424,7 +425,7 @@ static unsigned int driGetSwapInterval(__DRIdrawable *drawable)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const __DRIswapControlExtension driSwapControlExtension = {
|
const __DRIswapControlExtension driSwapControlExtension = {
|
||||||
{ __DRI_SWAP_CONTROL },
|
{ __DRI_SWAP_CONTROL, __DRI_SWAP_CONTROL_VERSION },
|
||||||
driSetSwapInterval,
|
driSetSwapInterval,
|
||||||
driGetSwapInterval
|
driGetSwapInterval
|
||||||
};
|
};
|
||||||
@@ -819,7 +820,7 @@ driQueryFrameTracking(__DRIdrawable *drawable,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const __DRIframeTrackingExtension driFrameTrackingExtension = {
|
const __DRIframeTrackingExtension driFrameTrackingExtension = {
|
||||||
{ __DRI_FRAME_TRACKING },
|
{ __DRI_FRAME_TRACKING, __DRI_FRAME_TRACKING_VERSION },
|
||||||
driFrameTracking,
|
driFrameTracking,
|
||||||
driQueryFrameTracking
|
driQueryFrameTracking
|
||||||
};
|
};
|
||||||
|
@@ -420,7 +420,7 @@ intelUpdateScreenFromSAREA(intelScreenPrivate * intelScreen,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const __DRIallocateExtension intelAllocateExtension = {
|
static const __DRIallocateExtension intelAllocateExtension = {
|
||||||
{ __DRI_ALLOCATE },
|
{ __DRI_ALLOCATE, __DRI_ALLOCATE_VERSION },
|
||||||
intelAllocateMemoryMESA,
|
intelAllocateMemoryMESA,
|
||||||
intelFreeMemoryMESA,
|
intelFreeMemoryMESA,
|
||||||
intelGetMemoryOffsetMESA
|
intelGetMemoryOffsetMESA
|
||||||
|
@@ -334,7 +334,7 @@ radeonFillInModes( unsigned pixel_bits, unsigned depth_bits,
|
|||||||
|
|
||||||
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
|
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R200)
|
||||||
static const __DRIallocateExtension r200AllocateExtension = {
|
static const __DRIallocateExtension r200AllocateExtension = {
|
||||||
{ __DRI_ALLOCATE },
|
{ __DRI_ALLOCATE, __DRI_ALLOCATE_VERSION },
|
||||||
r200AllocateMemoryMESA,
|
r200AllocateMemoryMESA,
|
||||||
r200FreeMemoryMESA,
|
r200FreeMemoryMESA,
|
||||||
r200GetMemoryOffsetMESA
|
r200GetMemoryOffsetMESA
|
||||||
@@ -343,7 +343,7 @@ static const __DRIallocateExtension r200AllocateExtension = {
|
|||||||
|
|
||||||
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
|
#if RADEON_COMMON && defined(RADEON_COMMON_FOR_R300)
|
||||||
static const __DRItexOffsetExtension r300texOffsetExtension = {
|
static const __DRItexOffsetExtension r300texOffsetExtension = {
|
||||||
{ __DRI_TEX_OFFSET },
|
{ __DRI_TEX_OFFSET, __DRI_TEX_OFFSET_VERSION },
|
||||||
r300SetTexOffset,
|
r300SetTexOffset,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user