Commit 32c04f16 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Rename residual ringbuf parameters

Now that we have a clear ring/engine split and a struct intel_ring, we
no longer need the stopgap ringbuf names.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1469432687-22756-16-git-send-email-chris@chris-wilson.co.ukReviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1470174640-18242-5-git-send-email-chris@chris-wilson.co.uk
parent 7e37f889
...@@ -47,15 +47,15 @@ int __intel_ring_space(int head, int tail, int size) ...@@ -47,15 +47,15 @@ int __intel_ring_space(int head, int tail, int size)
return space - I915_RING_FREE_SPACE; return space - I915_RING_FREE_SPACE;
} }
void intel_ring_update_space(struct intel_ring *ringbuf) void intel_ring_update_space(struct intel_ring *ring)
{ {
if (ringbuf->last_retired_head != -1) { if (ring->last_retired_head != -1) {
ringbuf->head = ringbuf->last_retired_head; ring->head = ring->last_retired_head;
ringbuf->last_retired_head = -1; ring->last_retired_head = -1;
} }
ringbuf->space = __intel_ring_space(ringbuf->head & HEAD_ADDR, ring->space = __intel_ring_space(ring->head & HEAD_ADDR,
ringbuf->tail, ringbuf->size); ring->tail, ring->size);
} }
static void __intel_engine_submit(struct intel_engine_cs *engine) static void __intel_engine_submit(struct intel_engine_cs *engine)
...@@ -1993,25 +1993,25 @@ static int init_phys_status_page(struct intel_engine_cs *engine) ...@@ -1993,25 +1993,25 @@ static int init_phys_status_page(struct intel_engine_cs *engine)
return 0; return 0;
} }
void intel_unpin_ring(struct intel_ring *ringbuf) void intel_unpin_ring(struct intel_ring *ring)
{ {
GEM_BUG_ON(!ringbuf->vma); GEM_BUG_ON(!ring->vma);
GEM_BUG_ON(!ringbuf->vaddr); GEM_BUG_ON(!ring->vaddr);
if (HAS_LLC(ringbuf->obj->base.dev) && !ringbuf->obj->stolen) if (HAS_LLC(ring->obj->base.dev) && !ring->obj->stolen)
i915_gem_object_unpin_map(ringbuf->obj); i915_gem_object_unpin_map(ring->obj);
else else
i915_vma_unpin_iomap(ringbuf->vma); i915_vma_unpin_iomap(ring->vma);
ringbuf->vaddr = NULL; ring->vaddr = NULL;
i915_gem_object_ggtt_unpin(ringbuf->obj); i915_gem_object_ggtt_unpin(ring->obj);
ringbuf->vma = NULL; ring->vma = NULL;
} }
int intel_pin_and_map_ring(struct drm_i915_private *dev_priv, int intel_pin_and_map_ring(struct drm_i915_private *dev_priv,
struct intel_ring *ringbuf) struct intel_ring *ring)
{ {
struct drm_i915_gem_object *obj = ringbuf->obj; struct drm_i915_gem_object *obj = ring->obj;
/* Ring wraparound at offset 0 sometimes hangs. No idea why. */ /* Ring wraparound at offset 0 sometimes hangs. No idea why. */
unsigned flags = PIN_OFFSET_BIAS | 4096; unsigned flags = PIN_OFFSET_BIAS | 4096;
void *addr; void *addr;
...@@ -2052,8 +2052,8 @@ int intel_pin_and_map_ring(struct drm_i915_private *dev_priv, ...@@ -2052,8 +2052,8 @@ int intel_pin_and_map_ring(struct drm_i915_private *dev_priv,
} }
} }
ringbuf->vaddr = addr; ring->vaddr = addr;
ringbuf->vma = i915_gem_obj_to_ggtt(obj); ring->vma = i915_gem_obj_to_ggtt(obj);
return 0; return 0;
err_unpin: err_unpin:
...@@ -2061,29 +2061,29 @@ int intel_pin_and_map_ring(struct drm_i915_private *dev_priv, ...@@ -2061,29 +2061,29 @@ int intel_pin_and_map_ring(struct drm_i915_private *dev_priv,
return ret; return ret;
} }
static void intel_destroy_ringbuffer_obj(struct intel_ring *ringbuf) static void intel_destroy_ringbuffer_obj(struct intel_ring *ring)
{ {
i915_gem_object_put(ringbuf->obj); i915_gem_object_put(ring->obj);
ringbuf->obj = NULL; ring->obj = NULL;
} }
static int intel_alloc_ringbuffer_obj(struct drm_device *dev, static int intel_alloc_ringbuffer_obj(struct drm_device *dev,
struct intel_ring *ringbuf) struct intel_ring *ring)
{ {
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
obj = NULL; obj = NULL;
if (!HAS_LLC(dev)) if (!HAS_LLC(dev))
obj = i915_gem_object_create_stolen(dev, ringbuf->size); obj = i915_gem_object_create_stolen(dev, ring->size);
if (obj == NULL) if (obj == NULL)
obj = i915_gem_object_create(dev, ringbuf->size); obj = i915_gem_object_create(dev, ring->size);
if (IS_ERR(obj)) if (IS_ERR(obj))
return PTR_ERR(obj); return PTR_ERR(obj);
/* mark ring buffers as read-only from GPU side by default */ /* mark ring buffers as read-only from GPU side by default */
obj->gt_ro = 1; obj->gt_ro = 1;
ringbuf->obj = obj; ring->obj = obj;
return 0; return 0;
} }
...@@ -2190,7 +2190,7 @@ static void intel_ring_context_unpin(struct i915_gem_context *ctx, ...@@ -2190,7 +2190,7 @@ static void intel_ring_context_unpin(struct i915_gem_context *ctx,
static int intel_init_ring_buffer(struct intel_engine_cs *engine) static int intel_init_ring_buffer(struct intel_engine_cs *engine)
{ {
struct drm_i915_private *dev_priv = engine->i915; struct drm_i915_private *dev_priv = engine->i915;
struct intel_ring *ringbuf; struct intel_ring *ring;
int ret; int ret;
WARN_ON(engine->buffer); WARN_ON(engine->buffer);
...@@ -2215,12 +2215,12 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine) ...@@ -2215,12 +2215,12 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine)
if (ret) if (ret)
goto error; goto error;
ringbuf = intel_engine_create_ring(engine, 32 * PAGE_SIZE); ring = intel_engine_create_ring(engine, 32 * PAGE_SIZE);
if (IS_ERR(ringbuf)) { if (IS_ERR(ring)) {
ret = PTR_ERR(ringbuf); ret = PTR_ERR(ring);
goto error; goto error;
} }
engine->buffer = ringbuf; engine->buffer = ring;
if (I915_NEED_GFX_HWS(dev_priv)) { if (I915_NEED_GFX_HWS(dev_priv)) {
ret = init_status_page(engine); ret = init_status_page(engine);
...@@ -2233,11 +2233,11 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine) ...@@ -2233,11 +2233,11 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine)
goto error; goto error;
} }
ret = intel_pin_and_map_ring(dev_priv, ringbuf); ret = intel_pin_and_map_ring(dev_priv, ring);
if (ret) { if (ret) {
DRM_ERROR("Failed to pin and map ringbuffer %s: %d\n", DRM_ERROR("Failed to pin and map ringbuffer %s: %d\n",
engine->name, ret); engine->name, ret);
intel_destroy_ringbuffer_obj(ringbuf); intel_destroy_ringbuffer_obj(ring);
goto error; goto error;
} }
......
...@@ -471,7 +471,7 @@ static inline void intel_ring_advance(struct intel_ring *ring) ...@@ -471,7 +471,7 @@ static inline void intel_ring_advance(struct intel_ring *ring)
} }
int __intel_ring_space(int head, int tail, int size); int __intel_ring_space(int head, int tail, int size);
void intel_ring_update_space(struct intel_ring *ringbuf); void intel_ring_update_space(struct intel_ring *ring);
int __must_check intel_engine_idle(struct intel_engine_cs *engine); int __must_check intel_engine_idle(struct intel_engine_cs *engine);
void intel_engine_init_seqno(struct intel_engine_cs *engine, u32 seqno); void intel_engine_init_seqno(struct intel_engine_cs *engine, u32 seqno);
...@@ -498,9 +498,9 @@ static inline u32 intel_engine_get_seqno(struct intel_engine_cs *engine) ...@@ -498,9 +498,9 @@ static inline u32 intel_engine_get_seqno(struct intel_engine_cs *engine)
int init_workarounds_ring(struct intel_engine_cs *engine); int init_workarounds_ring(struct intel_engine_cs *engine);
static inline u32 intel_ring_get_tail(struct intel_ring *ringbuf) static inline u32 intel_ring_get_tail(struct intel_ring *ring)
{ {
return ringbuf->tail; return ring->tail;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment