diff mbox

[2/3] drm/i915: Move the irq wait queue initialisation into the ring init

Message ID 1302683305-19417-3-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson April 13, 2011, 8:28 a.m. UTC
Required so that we don't obliterate the queue if initialising the
rings after the global IRQ handler is installed.

[Jesse, you recently looked at refactoring the IRQ installation
routines, does moving the initialisation of ring buffer data structures away
from that routine make sense in your grand scheme?]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_irq.c         |    6 ------
 drivers/gpu/drm/i915/intel_ringbuffer.c |    1 +
 2 files changed, 1 insertions(+), 6 deletions(-)

Comments

Ben Widawsky April 14, 2011, 6:20 a.m. UTC | #1
On Wed, Apr 13, 2011 at 09:28:24AM +0100, Chris Wilson wrote:
> Required so that we don't obliterate the queue if initialising the
> rings after the global IRQ handler is installed.
> 
> [Jesse, you recently looked at refactoring the IRQ installation
> routines, does moving the initialisation of ring buffer data structures away
> from that routine make sense in your grand scheme?]
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_irq.c         |    6 ------
>  drivers/gpu/drm/i915/intel_ringbuffer.c |    1 +
>  2 files changed, 1 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 188b497..46ccfc8 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1688,12 +1688,6 @@ int i915_driver_irq_postinstall(struct drm_device *dev)
>  	u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR;
>  	u32 error_mask;
>  
> -	DRM_INIT_WAITQUEUE(&dev_priv->ring[RCS].irq_queue);
> -	if (HAS_BSD(dev))
> -		DRM_INIT_WAITQUEUE(&dev_priv->ring[VCS].irq_queue);
> -	if (HAS_BLT(dev))
> -		DRM_INIT_WAITQUEUE(&dev_priv->ring[BCS].irq_queue);
> -
>  	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
>  
>  	if (HAS_PCH_SPLIT(dev))
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index e9e6f71..884556d 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -800,6 +800,7 @@ int intel_init_ring_buffer(struct drm_device *dev,
>  	INIT_LIST_HEAD(&ring->request_list);
>  	INIT_LIST_HEAD(&ring->gpu_write_list);
>  
> +	init_waitqueue_head(&ring->irq_queue);
>  	spin_lock_init(&ring->irq_lock);
>  	ring->irq_mask = ~0;
>  

I don't really understand why we went from DRM_INIT_WAITQUEUE to
init_waitqueue_head, but I'm okay with it.

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Chris Wilson April 14, 2011, 6:58 a.m. UTC | #2
On Wed, 13 Apr 2011 23:20:19 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> I don't really understand why we went from DRM_INIT_WAITQUEUE to
> init_waitqueue_head, but I'm okay with it.

Because I share upstream's opinion that we really should not have an OS
agnostic middlelayer (that is nothing more than SHOUTING at times like
this), and gradually wean ourselves off it whenever I get the chance.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 188b497..46ccfc8 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1688,12 +1688,6 @@  int i915_driver_irq_postinstall(struct drm_device *dev)
 	u32 enable_mask = I915_INTERRUPT_ENABLE_FIX | I915_INTERRUPT_ENABLE_VAR;
 	u32 error_mask;
 
-	DRM_INIT_WAITQUEUE(&dev_priv->ring[RCS].irq_queue);
-	if (HAS_BSD(dev))
-		DRM_INIT_WAITQUEUE(&dev_priv->ring[VCS].irq_queue);
-	if (HAS_BLT(dev))
-		DRM_INIT_WAITQUEUE(&dev_priv->ring[BCS].irq_queue);
-
 	dev_priv->vblank_pipe = DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B;
 
 	if (HAS_PCH_SPLIT(dev))
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index e9e6f71..884556d 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -800,6 +800,7 @@  int intel_init_ring_buffer(struct drm_device *dev,
 	INIT_LIST_HEAD(&ring->request_list);
 	INIT_LIST_HEAD(&ring->gpu_write_list);
 
+	init_waitqueue_head(&ring->irq_queue);
 	spin_lock_init(&ring->irq_lock);
 	ring->irq_mask = ~0;