drm/i915: enable vblank interrupt on ironlake
so far vblank interrupt on ironlake is disabled, this would cause bad gfx performance if userspace calls drm_wait_vblank. This patch enables vblank interrupt on ironlake and follows vblank get/put model. Signed-off-by: Li Peng <peng.li@intel.com> Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
0ce907f891
commit
c062df6196
|
@ -309,6 +309,12 @@ irqreturn_t ironlake_irq_handler(struct drm_device *dev)
|
||||||
if (de_iir & DE_GSE)
|
if (de_iir & DE_GSE)
|
||||||
ironlake_opregion_gse_intr(dev);
|
ironlake_opregion_gse_intr(dev);
|
||||||
|
|
||||||
|
if (de_iir & DE_PIPEA_VBLANK)
|
||||||
|
drm_handle_vblank(dev, 0);
|
||||||
|
|
||||||
|
if (de_iir & DE_PIPEB_VBLANK)
|
||||||
|
drm_handle_vblank(dev, 1);
|
||||||
|
|
||||||
/* check event from PCH */
|
/* check event from PCH */
|
||||||
if ((de_iir & DE_PCH_EVENT) &&
|
if ((de_iir & DE_PCH_EVENT) &&
|
||||||
(pch_iir & SDE_HOTPLUG_MASK)) {
|
(pch_iir & SDE_HOTPLUG_MASK)) {
|
||||||
|
@ -844,11 +850,11 @@ int i915_enable_vblank(struct drm_device *dev, int pipe)
|
||||||
if (!(pipeconf & PIPEACONF_ENABLE))
|
if (!(pipeconf & PIPEACONF_ENABLE))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (IS_IRONLAKE(dev))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
|
spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
|
||||||
if (IS_I965G(dev))
|
if (IS_IRONLAKE(dev))
|
||||||
|
ironlake_enable_display_irq(dev_priv, (pipe == 0) ?
|
||||||
|
DE_PIPEA_VBLANK: DE_PIPEB_VBLANK);
|
||||||
|
else if (IS_I965G(dev))
|
||||||
i915_enable_pipestat(dev_priv, pipe,
|
i915_enable_pipestat(dev_priv, pipe,
|
||||||
PIPE_START_VBLANK_INTERRUPT_ENABLE);
|
PIPE_START_VBLANK_INTERRUPT_ENABLE);
|
||||||
else
|
else
|
||||||
|
@ -866,10 +872,11 @@ void i915_disable_vblank(struct drm_device *dev, int pipe)
|
||||||
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
|
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
|
||||||
unsigned long irqflags;
|
unsigned long irqflags;
|
||||||
|
|
||||||
if (IS_IRONLAKE(dev))
|
|
||||||
return;
|
|
||||||
|
|
||||||
spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
|
spin_lock_irqsave(&dev_priv->user_irq_lock, irqflags);
|
||||||
|
if (IS_IRONLAKE(dev))
|
||||||
|
ironlake_disable_display_irq(dev_priv, (pipe == 0) ?
|
||||||
|
DE_PIPEA_VBLANK: DE_PIPEB_VBLANK);
|
||||||
|
else
|
||||||
i915_disable_pipestat(dev_priv, pipe,
|
i915_disable_pipestat(dev_priv, pipe,
|
||||||
PIPE_VBLANK_INTERRUPT_ENABLE |
|
PIPE_VBLANK_INTERRUPT_ENABLE |
|
||||||
PIPE_START_VBLANK_INTERRUPT_ENABLE);
|
PIPE_START_VBLANK_INTERRUPT_ENABLE);
|
||||||
|
@ -1015,7 +1022,8 @@ static int ironlake_irq_postinstall(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
|
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
|
||||||
/* enable kind of interrupts always enabled */
|
/* enable kind of interrupts always enabled */
|
||||||
u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT;
|
u32 display_mask = DE_MASTER_IRQ_CONTROL | DE_GSE | DE_PCH_EVENT |
|
||||||
|
DE_PIPEA_VBLANK | DE_PIPEB_VBLANK;
|
||||||
u32 render_mask = GT_USER_INTERRUPT;
|
u32 render_mask = GT_USER_INTERRUPT;
|
||||||
u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG |
|
u32 hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG |
|
||||||
SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG;
|
SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG;
|
||||||
|
|
|
@ -1638,6 +1638,7 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode)
|
||||||
case DRM_MODE_DPMS_OFF:
|
case DRM_MODE_DPMS_OFF:
|
||||||
DRM_DEBUG_KMS("crtc %d dpms off\n", pipe);
|
DRM_DEBUG_KMS("crtc %d dpms off\n", pipe);
|
||||||
|
|
||||||
|
drm_vblank_off(dev, pipe);
|
||||||
/* Disable display plane */
|
/* Disable display plane */
|
||||||
temp = I915_READ(dspcntr_reg);
|
temp = I915_READ(dspcntr_reg);
|
||||||
if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
|
if ((temp & DISPLAY_PLANE_ENABLE) != 0) {
|
||||||
|
|
Loading…
Reference in New Issue