[Intel-gfx] [PATCH 1/2] drm/i915: ringbuffer: use defined get_head/tail method
Chris Wilson
chris at chris-wilson.co.uk
Mon Aug 23 13:16:51 CEST 2010
On Tue, 24 Aug 2010 18:27:32 +0800, Yuanhan Liu <yuanhan.liu at intel.com> wrote:
> Use defined get_head/tail method to get the vaule of head/tail. Since each
> ring buffer has it's own get_head/tail method defined, use it.
>
> Signed-off-by: Yuanhan Liu <yuanhan.liu at intel.com>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 5 +++--
> drivers/gpu/drm/i915/i915_dma.c | 4 ++--
> drivers/gpu/drm/i915/i915_irq.c | 2 +-
> drivers/gpu/drm/i915/intel_ringbuffer.c | 2 +-
> 4 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 92d5605..068e3fa 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -339,10 +339,11 @@ static int i915_ringbuffer_info(struct seq_file *m, void *data)
> struct drm_info_node *node = (struct drm_info_node *) m->private;
> struct drm_device *dev = node->minor->dev;
> drm_i915_private_t *dev_priv = dev->dev_private;
> + struct intel_ring_buffer *ring = &dev_priv->render_ring;
> unsigned int head, tail;
>
> - head = I915_READ(PRB0_HEAD) & HEAD_ADDR;
> - tail = I915_READ(PRB0_TAIL) & TAIL_ADDR;
> + head = ring->get_head(dev, ring);
> + tail = ring->get_tail(dev, ring);
Now that you've converted i915_ringbuffer_info to use the abstract
interface, can you also extend the debugfs to dump all ringbuffers.
--
Chris Wilson, Intel Open Source Technology Centre
More information about the Intel-gfx
mailing list