} drm_local_map_t;
struct drm_vblank {
-#if 0 /* unneeded for now, signal support */
- TAILQ_HEAD(vbl_sigs);
-#endif
u_int32_t last_vblank; /* Last vblank we recieved */
atomic_t vbl_count; /* Number of interrupts */
int vbl_queue; /* sleep on this when waiting */
int vbl_inmodeset; /* is the DDX currently modesetting */
};
-TAILQ_HEAD(drm_vbl_sig_list, drm_vbl_sig);
-typedef struct drm_vbl_sig {
- TAILQ_ENTRY(drm_vbl_sig) link;
- unsigned int sequence;
- int signo;
- int pid;
-} drm_vbl_sig_t;
-
/* location of GART table */
#define DRM_ATI_GART_MAIN 1
#define DRM_ATI_GART_FB 2
int num_crtcs; /* number of crtcs */
u_int32_t max_vblank_count; /* size of counter reg*/
DRM_SPINTYPE vbl_lock; /* VBLANK data lock */
- atomic_t vbl_signal_pending; /* No. pending sigs */
int vblank_disable_allowed;
struct timeout vblank_disable_timer; /* timer for disable */
struct drm_vblank *vblank; /* One per ctrc */
void drm_driver_irq_preinstall(struct drm_device *);
void drm_driver_irq_postinstall(struct drm_device *);
void drm_driver_irq_uninstall(struct drm_device *);
-void drm_vbl_send_signals(struct drm_device *, int);
void drm_vblank_cleanup(struct drm_device *);
int drm_vblank_init(struct drm_device *, int);
u_int32_t drm_vblank_count(struct drm_device *, int);
{
timeout_set(&dev->vblank_disable_timer, vblank_disable, dev);
mtx_init(&dev->vbl_lock, IPL_BIO);
- atomic_set(&dev->vbl_signal_pending, 0);
dev->num_crtcs = num_crtcs;
dev->vblank = drm_calloc(num_crtcs, sizeof(*dev->vblank), M_DRM);
}
if (flags & _DRM_VBLANK_SIGNAL) {
-#if 0 /* disabled */
- drm_vbl_sig_t *vbl_sig = drm_calloc(1, sizeof(drm_vbl_sig_t),
- DRM_MEM_DRIVER);
- if (vbl_sig == NULL)
- return ENOMEM;
-
- 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;
-#endif
ret = EINVAL;
} else {
while (ret == 0) {
return (ret);
}
-void
-drm_vbl_send_signals(struct drm_device *dev, int crtc)
-{
-}
-
-#if 0 /* disabled */
-void
-drm_vbl_send_signals(struct drm_device *dev, int crtc)
-{
- drm_vbl_sig_t *vbl_sig;
- unsigned int vbl_seq = atomic_read(&dev->vbl_received);
- struct proc *p;
-
- 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, sizeof(*vbl_sig), DRM_MEM_DRIVER);
- }
- vbl_sig = next;
- }
-}
-#endif
-
void
drm_handle_vblank(struct drm_device *dev, int crtc)
{
atomic_inc(&dev->vblank[crtc].vbl_count);
DRM_WAKEUP(&dev->vblank[crtc].vbl_queue);
- drm_vbl_send_signals(dev, crtc);
}
void