summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-02-25 16:14:37 -0500
committerKristian Høgsberg <krh@redhat.com>2008-02-25 19:02:06 -0500
commit6e8d21d72f35767e07081a8bee4323aaaf5e2aae (patch)
treea4c11d15ae2e951364d29a915b006348e01c1d0b /src/mesa/drivers/dri/common
parentb49a8f805aec057d9d0b039531b373b6bd8330e2 (diff)
Remove GetMSC DriverAPI function.
The DriverAPI is internal to the DRI drivers and GetDrawableMSC obsoletes GetMSC. Also, since the DRI driver interface has not yet been released, just drop the getMSC function from the DRI interface instead using the ABI preserving version mechanism. Finally, using void pointer privates in the DRI interface is not allowed, always pass the actual types around (__DRIdrawable in this case) to enhance type safety and readability of the code.
Diffstat (limited to 'src/mesa/drivers/dri/common')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c16
-rw-r--r--src/mesa/drivers/dri/common/dri_util.h11
-rw-r--r--src/mesa/drivers/dri/common/vblank.c26
3 files changed, 6 insertions, 47 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index 01751582fa..9928a0f031 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -450,22 +450,13 @@ static void driSwapBuffers(__DRIdrawable *drawable)
&rect, 1, GL_TRUE);
}
-static int driDrawableGetMSC( __DRIscreen *screen, void *drawablePrivate,
+static int driDrawableGetMSC( __DRIscreen *screen, __DRIdrawable *drawable,
int64_t *msc )
{
__DRIscreenPrivate *sPriv = screen->private;
+ __DRIdrawablePrivate *dPriv = drawable->private;
- return sPriv->DriverAPI.GetDrawableMSC( sPriv, drawablePrivate, msc );
-}
-
-/**
- * Called directly from a number of higher-level GLX functions.
- */
-static int driGetMSC( __DRIscreen *screen, void *drawablePrivate, int64_t *msc )
-{
- __DRIscreenPrivate *sPriv = screen->private;
-
- return sPriv->DriverAPI.GetMSC( sPriv, msc );
+ return sPriv->DriverAPI.GetDrawableMSC(sPriv, dPriv, msc);
}
static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc,
@@ -496,7 +487,6 @@ static int driWaitForMSC(__DRIdrawable *drawable, int64_t target_msc,
const __DRImediaStreamCounterExtension driMediaStreamCounterExtension = {
{ __DRI_MEDIA_STREAM_COUNTER, __DRI_MEDIA_STREAM_COUNTER_VERSION },
- driGetMSC,
driWaitForMSC,
driDrawableGetMSC,
};
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index fb2081412a..cb9e8909b7 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -184,12 +184,6 @@ struct __DriverAPIRec {
/**
- * Required if GLX_SGI_video_sync or GLX_OML_sync_control is
- * supported.
- */
- int (*GetMSC)( __DRIscreenPrivate * priv, int64_t * count );
-
- /**
* These are required if GLX_OML_sync_control is supported.
*/
/*@{*/
@@ -206,8 +200,9 @@ struct __DriverAPIRec {
int x, int y, int w, int h);
/**
- * New version of GetMSC so we can pass drawable data to the low level
- * DRM driver (e.g. pipe info).
+ * New version of GetMSC so we can pass drawable data to the low
+ * level DRM driver (e.g. pipe info). Required if
+ * GLX_SGI_video_sync or GLX_OML_sync_control is supported.
*/
int (*GetDrawableMSC) ( __DRIscreenPrivate * priv,
__DRIdrawablePrivate *drawablePrivate,
diff --git a/src/mesa/drivers/dri/common/vblank.c b/src/mesa/drivers/dri/common/vblank.c
index 8f8d94853e..e81cc6886f 100644
--- a/src/mesa/drivers/dri/common/vblank.c
+++ b/src/mesa/drivers/dri/common/vblank.c
@@ -91,32 +91,6 @@ int driDrawableGetMSC32( __DRIscreenPrivate * priv,
return ret;
}
-/**
- * Get the current MSC refresh counter.
- *
- * Stores the 64-bit count of vertical refreshes since some (arbitrary)
- * point in time in \c count. Unless the value wraps around, which it
- * may, it will never decrease.
- *
- * \warning This function is called from \c glXGetVideoSyncSGI, which expects
- * a \c count of type \c unsigned (32-bit), and \c glXGetSyncValuesOML, which
- * expects a \c count of type \c int64_t (signed 64-bit). The kernel ioctl
- * currently always returns a \c sequence of type \c unsigned.
- *
- * Since this function doesn't take a drawable, it may end up getting the MSC
- * value from a pipe not associated with the caller's context, resuling in
- * undesired behavior.
- *
- * \param priv Pointer to the DRI screen private struct.
- * \param count Storage to hold MSC counter.
- * \return Zero is returned on success. A negative errno value
- * is returned on failure.
- */
-int driGetMSC32( __DRIscreenPrivate * priv, int64_t * count )
-{
- return driDrawableGetMSC32(priv, NULL, count);
-}
-
/****************************************************************************/
/**
* Wait for a specified refresh count. This implements most of the