summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorMichel Daenzer <michel@daenzer.net>2002-11-30 14:24:07 +0000
committerMichel Daenzer <michel@daenzer.net>2002-11-30 14:24:07 +0000
commit40891ac190fb74f389ea1a9758249a2f642fd99b (patch)
tree00acdea17e37ac7578a68bba12b739d1366f6637 /shared
parentc869f4a1e59c4fa0bed5681cad5ad49e685603eb (diff)
vertical blank ioctl can send signal instead of blocking
Diffstat (limited to 'shared')
-rw-r--r--shared/drm.h21
-rw-r--r--shared/mga_irq.c4
-rw-r--r--shared/r128_irq.c4
-rw-r--r--shared/radeon_irq.c8
4 files changed, 29 insertions, 8 deletions
diff --git a/shared/drm.h b/shared/drm.h
index f26d4442..d3c9f158 100644
--- a/shared/drm.h
+++ b/shared/drm.h
@@ -346,17 +346,30 @@ typedef struct drm_irq_busid {
} drm_irq_busid_t;
typedef enum {
- _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
- _DRM_VBLANK_RELATIVE = 0x1 /* Wait for given number of vblanks */
+ _DRM_VBLANK_ABSOLUTE = 0x0, /* Wait for specific vblank sequence number */
+ _DRM_VBLANK_RELATIVE = 0x1, /* Wait for given number of vblanks */
+ _DRM_VBLANK_SIGNAL = 0x80000000 /* Send signal instead of blocking */
} drm_vblank_seq_type_t;
-typedef struct drm_radeon_vbl_wait {
+#define _DRM_VBLANK_FLAGS_MASK _DRM_VBLANK_SIGNAL
+
+struct drm_wait_vblank_request {
+ drm_vblank_seq_type_t type;
+ unsigned int sequence;
+ unsigned long signal;
+};
+
+struct drm_wait_vblank_reply {
drm_vblank_seq_type_t type;
unsigned int sequence;
long tval_sec;
long tval_usec;
-} drm_wait_vblank_t;
+};
+typedef union drm_wait_vblank {
+ struct drm_wait_vblank_request request;
+ struct drm_wait_vblank_reply reply;
+} drm_wait_vblank_t;
typedef struct drm_agp_mode {
unsigned long mode;
diff --git a/shared/mga_irq.c b/shared/mga_irq.c
index 568d193f..30ee7834 100644
--- a/shared/mga_irq.c
+++ b/shared/mga_irq.c
@@ -50,6 +50,10 @@ void mga_dma_service( DRM_IRQ_ARGS )
MGA_WRITE( MGA_ICLEAR, MGA_VLINEICLR );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+
+ /* kick off bottom half for signals */
+ queue_task(&dev->vbl_tq, &tq_immediate);
+ mark_bh(IMMEDIATE_BH);
}
}
diff --git a/shared/r128_irq.c b/shared/r128_irq.c
index a29a81b5..722f2362 100644
--- a/shared/r128_irq.c
+++ b/shared/r128_irq.c
@@ -50,6 +50,10 @@ void r128_dma_service( DRM_IRQ_ARGS )
R128_WRITE( R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK );
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+
+ /* kick off bottom half for signals */
+ queue_task(&dev->vbl_tq, &tq_immediate);
+ mark_bh(IMMEDIATE_BH);
}
}
diff --git a/shared/radeon_irq.c b/shared/radeon_irq.c
index 54702bee..b8f33f95 100644
--- a/shared/radeon_irq.c
+++ b/shared/radeon_irq.c
@@ -70,13 +70,15 @@ void DRM(dma_service)( DRM_IRQ_ARGS )
DRM_WAKEUP( &dev_priv->swi_queue );
}
-#if __HAVE_VBL_IRQ
/* VBLANK interrupt */
if (stat & RADEON_CRTC_VBLANK_STAT) {
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);
+
+ /* kick off bottom half for signals */
+ queue_task(&dev->vbl_tq, &tq_immediate);
+ mark_bh(IMMEDIATE_BH);
}
-#endif
/* Acknowledge all the bits in GEN_INT_STATUS -- seem to get
* more than we asked for...
@@ -138,7 +140,6 @@ int radeon_emit_and_wait_irq(drm_device_t *dev)
}
-#if __HAVE_VBL_IRQ
int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
{
drm_radeon_private_t *dev_priv =
@@ -167,7 +168,6 @@ int DRM(vblank_wait)(drm_device_t *dev, unsigned int *sequence)
return ret;
}
-#endif
/* Needs the lock as it touches the ring.