summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2003-02-08 03:14:57 +0000
committerEric Anholt <anholt@freebsd.org>2003-02-08 03:14:57 +0000
commitf0dd998bb32876f6114e973a5567a529ec967bc4 (patch)
tree632efd5d27a6d5704ff3b81b8de5a7baedc08ffc
parentfa355132af00e25b20b2b3760f12ac2f168852df (diff)
Remove the untested vblank signal code from this branch.
-rw-r--r--bsd-core/drmP.h1
-rw-r--r--bsd-core/drm_dma.c75
-rw-r--r--bsd/drm.h20
-rw-r--r--bsd/drmP.h1
-rw-r--r--bsd/drm_dma.h75
5 files changed, 59 insertions, 113 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index b7b21da4..00c1a9ea 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -613,6 +613,7 @@ extern drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block);
#endif /* __HAVE_DMA */
#if __HAVE_VBL_IRQ
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __REALLY_HAVE_AGP
diff --git a/bsd-core/drm_dma.c b/bsd-core/drm_dma.c
index 0f0dd4fd..eb553984 100644
--- a/bsd-core/drm_dma.c
+++ b/bsd-core/drm_dma.c
@@ -524,11 +524,6 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
TASK_INIT(&dev->task, 0, DRM(dma_immediate_bh), dev);
#endif
-#if __HAVE_VBL_IRQ
- DRM_SPININIT( dev->vbl_lock, "vblsig" );
- TAILQ_INIT( &dev->vbl_sig_list );
-#endif
-
/* Before installing handler */
DRM(driver_irq_preinstall)( dev );
@@ -617,66 +612,36 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
sizeof(vblwait) );
- if (vblwait.request.type & _DRM_VBLANK_RELATIVE) {
- vblwait.request.sequence += atomic_read(&dev->vbl_received);
- vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
+ switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+ case _DRM_VBLANK_RELATIVE:
+ vblwait.request.sequence += atomic_read( &dev->vbl_received );
+ case _DRM_VBLANK_ABSOLUTE:
+ break;
+ default:
+ return EINVAL;
}
- flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
- if (flags & _DRM_VBLANK_SIGNAL) {
- drm_vbl_sig_t *vbl_sig = DRM_MALLOC(sizeof(drm_vbl_sig_t));
- if (vbl_sig == NULL)
- return ENOMEM;
- bzero(vbl_sig, sizeof(*vbl_sig));
-
- vbl_sig->sequence = vblwait.request.sequence;
- vbl_sig->signo = vblwait.request.signal;
- vbl_sig->pid = DRM_CURRENTPID;
-
- vblwait.reply.sequence = atomic_read(&dev->vbl_received);
-
- DRM_SPINLOCK(&dev->vbl_lock);
- TAILQ_INSERT_HEAD(&dev->vbl_sig_list, vbl_sig, link);
- DRM_SPINUNLOCK(&dev->vbl_lock);
- ret = 0;
- } else {
- ret = DRM(vblank_wait)(dev, &vblwait.request.sequence);
-
- microtime(&now);
- vblwait.reply.tval_sec = now.tv_sec;
- vblwait.reply.tval_usec = now.tv_usec;
+ if ( flags & _DRM_VBLANK_SIGNAL ) {
+ /* Signals from vblank not supported on BSD yet */
+ return EINVAL;
}
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+
+ ret = DRM(vblank_wait)(dev, &vblwait.request.sequence);
+
+ microtime(&now);
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+
DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
sizeof(vblwait) );
return ret;
}
-void DRM(vbl_send_signals)( drm_device_t *dev )
-{
- drm_vbl_sig_t *vbl_sig;
- unsigned int vbl_seq = atomic_read( &dev->vbl_received );
- struct proc *p;
-
- DRM_SPINLOCK(&dev->vbl_lock);
-
- vbl_sig = TAILQ_FIRST(&dev->vbl_sig_list);
- while (vbl_sig != NULL) {
- drm_vbl_sig_t *next = TAILQ_NEXT(vbl_sig, link);
-
- if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
- p = pfind(vbl_sig->pid);
- if (p != NULL)
- psignal(p, vbl_sig->signo);
-
- TAILQ_REMOVE(&dev->vbl_sig_list, vbl_sig, link);
- DRM_FREE(vbl_sig);
- }
- vbl_sig = next;
- }
-
- DRM_SPINUNLOCK(&dev->vbl_lock);
+void DRM(vbl_send_signals)( drm_device_t *dev ) {
+ /* Signals from vblank not supported on BSD yet */
}
#endif /* __HAVE_VBL_IRQ */
diff --git a/bsd/drm.h b/bsd/drm.h
index f45f088e..d1d66943 100644
--- a/bsd/drm.h
+++ b/bsd/drm.h
@@ -346,15 +346,29 @@ 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 = 0x40000000 /* 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;
+};
+
+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 {
diff --git a/bsd/drmP.h b/bsd/drmP.h
index b7b21da4..00c1a9ea 100644
--- a/bsd/drmP.h
+++ b/bsd/drmP.h
@@ -613,6 +613,7 @@ extern drm_buf_t *DRM(freelist_get)(drm_freelist_t *bl, int block);
#endif /* __HAVE_DMA */
#if __HAVE_VBL_IRQ
extern int DRM(vblank_wait)(drm_device_t *dev, unsigned int *vbl_seq);
+extern void DRM(vbl_send_signals)( drm_device_t *dev );
#endif
#if __REALLY_HAVE_AGP
diff --git a/bsd/drm_dma.h b/bsd/drm_dma.h
index 0f0dd4fd..eb553984 100644
--- a/bsd/drm_dma.h
+++ b/bsd/drm_dma.h
@@ -524,11 +524,6 @@ int DRM(irq_install)( drm_device_t *dev, int irq )
TASK_INIT(&dev->task, 0, DRM(dma_immediate_bh), dev);
#endif
-#if __HAVE_VBL_IRQ
- DRM_SPININIT( dev->vbl_lock, "vblsig" );
- TAILQ_INIT( &dev->vbl_sig_list );
-#endif
-
/* Before installing handler */
DRM(driver_irq_preinstall)( dev );
@@ -617,66 +612,36 @@ int DRM(wait_vblank)( DRM_IOCTL_ARGS )
DRM_COPY_FROM_USER_IOCTL( vblwait, (drm_wait_vblank_t *)data,
sizeof(vblwait) );
- if (vblwait.request.type & _DRM_VBLANK_RELATIVE) {
- vblwait.request.sequence += atomic_read(&dev->vbl_received);
- vblwait.request.type &= ~_DRM_VBLANK_RELATIVE;
+ switch ( vblwait.request.type & ~_DRM_VBLANK_FLAGS_MASK ) {
+ case _DRM_VBLANK_RELATIVE:
+ vblwait.request.sequence += atomic_read( &dev->vbl_received );
+ case _DRM_VBLANK_ABSOLUTE:
+ break;
+ default:
+ return EINVAL;
}
- flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
- if (flags & _DRM_VBLANK_SIGNAL) {
- drm_vbl_sig_t *vbl_sig = DRM_MALLOC(sizeof(drm_vbl_sig_t));
- if (vbl_sig == NULL)
- return ENOMEM;
- bzero(vbl_sig, sizeof(*vbl_sig));
-
- vbl_sig->sequence = vblwait.request.sequence;
- vbl_sig->signo = vblwait.request.signal;
- vbl_sig->pid = DRM_CURRENTPID;
-
- vblwait.reply.sequence = atomic_read(&dev->vbl_received);
-
- DRM_SPINLOCK(&dev->vbl_lock);
- TAILQ_INSERT_HEAD(&dev->vbl_sig_list, vbl_sig, link);
- DRM_SPINUNLOCK(&dev->vbl_lock);
- ret = 0;
- } else {
- ret = DRM(vblank_wait)(dev, &vblwait.request.sequence);
-
- microtime(&now);
- vblwait.reply.tval_sec = now.tv_sec;
- vblwait.reply.tval_usec = now.tv_usec;
+ if ( flags & _DRM_VBLANK_SIGNAL ) {
+ /* Signals from vblank not supported on BSD yet */
+ return EINVAL;
}
+ flags = vblwait.request.type & _DRM_VBLANK_FLAGS_MASK;
+
+ ret = DRM(vblank_wait)(dev, &vblwait.request.sequence);
+
+ microtime(&now);
+ vblwait.reply.tval_sec = now.tv_sec;
+ vblwait.reply.tval_usec = now.tv_usec;
+
DRM_COPY_TO_USER_IOCTL( (drm_wait_vblank_t *)data, vblwait,
sizeof(vblwait) );
return ret;
}
-void DRM(vbl_send_signals)( drm_device_t *dev )
-{
- drm_vbl_sig_t *vbl_sig;
- unsigned int vbl_seq = atomic_read( &dev->vbl_received );
- struct proc *p;
-
- DRM_SPINLOCK(&dev->vbl_lock);
-
- vbl_sig = TAILQ_FIRST(&dev->vbl_sig_list);
- while (vbl_sig != NULL) {
- drm_vbl_sig_t *next = TAILQ_NEXT(vbl_sig, link);
-
- if ( ( vbl_seq - vbl_sig->sequence ) <= (1<<23) ) {
- p = pfind(vbl_sig->pid);
- if (p != NULL)
- psignal(p, vbl_sig->signo);
-
- TAILQ_REMOVE(&dev->vbl_sig_list, vbl_sig, link);
- DRM_FREE(vbl_sig);
- }
- vbl_sig = next;
- }
-
- DRM_SPINUNLOCK(&dev->vbl_lock);
+void DRM(vbl_send_signals)( drm_device_t *dev ) {
+ /* Signals from vblank not supported on BSD yet */
}
#endif /* __HAVE_VBL_IRQ */