aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i915/intel_ioctl.c
diff options
context:
space:
mode:
authorDave Airlie <airliedfreedesktop.org>2006-02-06 00:09:58 +0000
committerDave Airlie <airliedfreedesktop.org>2006-02-06 00:09:58 +0000
commit4cd0e24f86a5e3fa67774be546f922ca241cb0ea (patch)
treef1136bdc585fae8b4510d5383835a4ea5d1be079 /src/mesa/drivers/dri/i915/intel_ioctl.c
parent640ef7f8908a3c25390125f5727d154ca66c9505 (diff)
add vblank support to i915 driver
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_ioctl.c')
-rw-r--r--src/mesa/drivers/dri/i915/intel_ioctl.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_ioctl.c b/src/mesa/drivers/dri/i915/intel_ioctl.c
index 8834f871ee6..82ad14ca114 100644
--- a/src/mesa/drivers/dri/i915/intel_ioctl.c
+++ b/src/mesa/drivers/dri/i915/intel_ioctl.c
@@ -40,9 +40,20 @@
#include "intel_batchbuffer.h"
#include "drm.h"
+u_int32_t intelGetLastFrame (intelContextPtr intel)
+{
+ int ret;
+ u_int32_t frame;
+ drm_i915_getparam_t gp;
+
+ gp.param = I915_PARAM_LAST_DISPATCH;
+ gp.value = (int *)&frame;
+ ret = drmCommandWriteRead( intel->driFd, DRM_I915_GETPARAM,
+ &gp, sizeof(gp) );
+ return frame;
+}
-
-static int intelEmitIrqLocked( intelContextPtr intel )
+int intelEmitIrqLocked( intelContextPtr intel )
{
drmI830IrqEmit ie;
int ret, seq;
@@ -65,18 +76,17 @@ static int intelEmitIrqLocked( intelContextPtr intel )
return seq;
}
-static void intelWaitIrq( intelContextPtr intel, int seq )
+void intelWaitIrq( intelContextPtr intel, int seq )
{
- drmI830IrqWait iw;
int ret;
if (0)
fprintf(stderr, "%s %d\n", __FUNCTION__, seq );
- iw.irq_seq = seq;
+ intel->iw.irq_seq = seq;
do {
- ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &iw, sizeof(iw) );
+ ret = drmCommandWrite( intel->driFd, DRM_I830_IRQ_WAIT, &intel->iw, sizeof(intel->iw) );
} while (ret == -EAGAIN || ret == -EINTR);
if ( ret ) {