Remove signals for vblank events code.
authorHasso Tepper <hasso@estpak.ee>
Tue, 23 Jun 2009 22:05:47 +0000 (01:05 +0300)
committerHasso Tepper <hasso@estpak.ee>
Wed, 24 Jun 2009 20:04:49 +0000 (23:04 +0300)
Using signals for vblank events is prone to issues.  There have never
been any consumers and likely will never be.  Furthermore, we have
never enabled the code for it, so just get rid of it.

Obtained-from: FreeBSD

sys/dev/drm/drmP.h
sys/dev/drm/drm_irq.c

index 109ac64..92eb9c1 100644 (file)
@@ -513,19 +513,10 @@ typedef struct drm_local_map {
        TAILQ_ENTRY(drm_local_map) link;
 } drm_local_map_t;
 
-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;
-
 struct drm_vblank_info {
        wait_queue_head_t queue;        /* vblank wait queue */
        atomic_t count;                 /* number of VBLANK interrupts */
                                        /* (driver must alloc the right number of counters) */
-       struct drm_vbl_sig_list sigs;   /* signal list to send on VBLANK */
        atomic_t refcount;              /* number of users of vblank interrupts */
        u32 last;                       /* protected by dev->vbl_lock, used */
                                        /* for wraparound handling */
@@ -695,7 +686,6 @@ struct drm_device {
        int               last_context; /* Last current context            */
 
        int               vblank_disable_allowed;
-       atomic_t          vbl_signal_pending;   /* number of signals pending on all crtcs */
        struct callout    vblank_disable_timer;
        u32               max_vblank_count;     /* size of vblank counter register */
        struct drm_vblank_info *vblank;         /* per crtc vblank info */
@@ -814,7 +804,6 @@ void        drm_vblank_put(struct drm_device *dev, int crtc);
 void   drm_vblank_cleanup(struct drm_device *dev);
 int    drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq);
 int    drm_vblank_init(struct drm_device *dev, int num_crtcs);
-void   drm_vbl_send_signals(struct drm_device *dev, int crtc);
 int    drm_modeset_ctl(struct drm_device *dev, void *data,
                        struct drm_file *file_priv);
 
index 659e342..1c5d633 100644 (file)
@@ -106,7 +106,6 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
        int i, ret = ENOMEM;
 
        callout_init(&dev->vblank_disable_timer);
-       atomic_set(&dev->vbl_signal_pending, 0);
        dev->num_crtcs = num_crtcs;
 
        dev->vblank = malloc(sizeof(struct drm_vblank_info) * num_crtcs,
@@ -119,7 +118,6 @@ int drm_vblank_init(struct drm_device *dev, int num_crtcs)
        /* Zero per-crtc vblank stuff */
        for (i = 0; i < num_crtcs; i++) {
                DRM_INIT_WAITQUEUE(&dev->vblank[i].queue);
-               TAILQ_INIT(&dev->vblank[i].sigs);
                atomic_set(&dev->vblank[i].count, 0);
                atomic_set(&dev->vblank[i].refcount, 0);
        }
@@ -421,23 +419,7 @@ int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *file_pr
        }
 
        if (flags & _DRM_VBLANK_SIGNAL) {
-#if 0 /* disabled */
-               drm_vbl_sig_t *vbl_sig = malloc(sizeof(drm_vbl_sig_t),
-                   DRM_MEM_DRIVER, M_NOWAIT | M_ZERO);
-               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
+               /* There have never been any consumers */
                ret = EINVAL;
        } else {
                DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
@@ -474,38 +456,9 @@ done:
        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));
-               }
-               vbl_sig = next;
-       }
-}
-#endif
-
 void drm_handle_vblank(struct drm_device *dev, int crtc)
 {
        atomic_inc(&dev->vblank[crtc].count);
        DRM_WAKEUP(&dev->vblank[crtc].queue);
-       drm_vbl_send_signals(dev, crtc);
 }