diff options
-rw-r--r-- | linux-core/drm_irq.c | 17 | ||||
-rw-r--r-- | shared-core/drm.h | 2 | ||||
-rw-r--r-- | shared-core/radeon_irq.c | 19 |
3 files changed, 19 insertions, 19 deletions
diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 1e1b7f4d..eea00ac8 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -117,18 +117,18 @@ int drm_vblank_init(drm_device_t *dev, int num_crtcs) if (!dev->vblank_refcount) goto err; - dev->last_vblank = drm_alloc(sizeof(u32) * num_crtcs, - DRM_MEM_DRIVER); + dev->last_vblank = drm_calloc(1, sizeof(u32) * num_crtcs, + DRM_MEM_DRIVER); if (!dev->last_vblank) goto err; - dev->vblank_premodeset = drm_alloc(sizeof(u32) * num_crtcs, - DRM_MEM_DRIVER); + dev->vblank_premodeset = drm_calloc(1, sizeof(u32) * num_crtcs, + DRM_MEM_DRIVER); if (!dev->vblank_premodeset) goto err; - dev->vblank_offset = drm_alloc(sizeof(u32) * num_crtcs, - DRM_MEM_DRIVER); + dev->vblank_offset = drm_calloc(1, sizeof(u32) * num_crtcs, + DRM_MEM_DRIVER); if (!dev->vblank_offset) goto err; @@ -138,9 +138,6 @@ int drm_vblank_init(drm_device_t *dev, int num_crtcs) INIT_LIST_HEAD(&dev->vbl_sigs[i]); atomic_set(&dev->_vblank_count[i], 0); atomic_set(&dev->vblank_refcount[i], 0); - dev->last_vblank[i] = 0; - dev->vblank_premodeset[i] = 0; - dev->vblank_offset[i] = 0; } return 0; @@ -570,7 +567,7 @@ int drm_wait_vblank(DRM_IOCTL_ARGS) return ret; DRM_WAIT_ON(ret, dev->vbl_queue[crtc], 3 * DRM_HZ, (((cur_vblank = drm_vblank_count(dev, crtc)) - - seq) <= (1 << 23))); + - vblwait.request.sequence) <= (1 << 23))); drm_vblank_put(dev, crtc); do_gettimeofday(&now); vblwait.reply.tval_sec = now.tv_sec; diff --git a/shared-core/drm.h b/shared-core/drm.h index 3cd6d500..eae25c64 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -598,8 +598,8 @@ typedef enum { * \sa drmModesetCtl(). */ typedef struct drm_modeset_ctl { + drm_u64_t arg; drm_modeset_ctl_cmd_t cmd; - u64 arg; } drm_modeset_ctl_t; /** diff --git a/shared-core/radeon_irq.c b/shared-core/radeon_irq.c index cf72fc5b..d7f10f93 100644 --- a/shared-core/radeon_irq.c +++ b/shared-core/radeon_irq.c @@ -37,7 +37,7 @@ static void radeon_irq_set_state(drm_device_t *dev, u32 mask, int state) { - drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; + drm_radeon_private_t *dev_priv = dev->dev_private; if (state) dev_priv->irq_enable_reg |= mask; @@ -81,12 +81,15 @@ void radeon_disable_vblank(drm_device_t *dev, int crtc) } } -static __inline__ u32 radeon_acknowledge_irqs(drm_radeon_private_t * dev_priv, - u32 mask) +static __inline__ u32 radeon_acknowledge_irqs(drm_radeon_private_t * dev_priv) { - u32 irqs = RADEON_READ(RADEON_GEN_INT_STATUS) & mask; + u32 irqs = RADEON_READ(RADEON_GEN_INT_STATUS) & + (RADEON_SW_INT_TEST | RADEON_CRTC_VBLANK_STAT | + RADEON_CRTC2_VBLANK_STAT); + if (irqs) RADEON_WRITE(RADEON_GEN_INT_STATUS, irqs); + return irqs; } @@ -118,10 +121,12 @@ irqreturn_t radeon_driver_irq_handler(DRM_IRQ_ARGS) /* Only consider the bits we're interested in - others could be used * outside the DRM */ - stat = radeon_acknowledge_irqs(dev_priv, dev_priv->irq_enable_reg); + stat = radeon_acknowledge_irqs(dev_priv); if (!stat) return IRQ_NONE; + stat &= dev_priv->irq_enable_reg; + /* SW interrupt */ if (stat & RADEON_SW_INT_TEST) DRM_WAKEUP(&dev_priv->swi_queue); @@ -246,9 +251,7 @@ void radeon_driver_irq_preinstall(drm_device_t * dev) RADEON_WRITE(RADEON_GEN_INT_CNTL, 0); /* Clear bits if they're already high */ - radeon_acknowledge_irqs(dev_priv, (RADEON_SW_INT_TEST_ACK | - RADEON_CRTC_VBLANK_STAT | - RADEON_CRTC2_VBLANK_STAT)); + radeon_acknowledge_irqs(dev_priv); } int radeon_driver_irq_postinstall(drm_device_t * dev) |