Commit a7cbedec authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Daniel Vetter

drm/i915: Rename unpin_count to pin_count

We increase it when we pin, so for the casual reader
rename it to cause less confusion.
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: default avatarThomas Daniel <thomas.daniel@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 1197b4f2
...@@ -765,7 +765,7 @@ struct intel_context { ...@@ -765,7 +765,7 @@ struct intel_context {
struct { struct {
struct drm_i915_gem_object *state; struct drm_i915_gem_object *state;
struct intel_ringbuffer *ringbuf; struct intel_ringbuffer *ringbuf;
int unpin_count; int pin_count;
} engine[I915_NUM_RINGS]; } engine[I915_NUM_RINGS];
struct list_head link; struct list_head link;
......
...@@ -807,11 +807,11 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring, ...@@ -807,11 +807,11 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring,
int ret = 0; int ret = 0;
WARN_ON(!mutex_is_locked(&ring->dev->struct_mutex)); WARN_ON(!mutex_is_locked(&ring->dev->struct_mutex));
if (ctx->engine[ring->id].unpin_count++ == 0) { if (ctx->engine[ring->id].pin_count++ == 0) {
ret = i915_gem_obj_ggtt_pin(ctx_obj, ret = i915_gem_obj_ggtt_pin(ctx_obj,
GEN8_LR_CONTEXT_ALIGN, 0); GEN8_LR_CONTEXT_ALIGN, 0);
if (ret) if (ret)
goto reset_unpin_count; goto reset_pin_count;
ret = intel_pin_and_map_ringbuffer_obj(ring->dev, ringbuf); ret = intel_pin_and_map_ringbuffer_obj(ring->dev, ringbuf);
if (ret) if (ret)
...@@ -822,8 +822,8 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring, ...@@ -822,8 +822,8 @@ static int intel_lr_context_pin(struct intel_engine_cs *ring,
unpin_ctx_obj: unpin_ctx_obj:
i915_gem_object_ggtt_unpin(ctx_obj); i915_gem_object_ggtt_unpin(ctx_obj);
reset_unpin_count: reset_pin_count:
ctx->engine[ring->id].unpin_count = 0; ctx->engine[ring->id].pin_count = 0;
return ret; return ret;
} }
...@@ -836,7 +836,7 @@ void intel_lr_context_unpin(struct intel_engine_cs *ring, ...@@ -836,7 +836,7 @@ void intel_lr_context_unpin(struct intel_engine_cs *ring,
if (ctx_obj) { if (ctx_obj) {
WARN_ON(!mutex_is_locked(&ring->dev->struct_mutex)); WARN_ON(!mutex_is_locked(&ring->dev->struct_mutex));
if (--ctx->engine[ring->id].unpin_count == 0) { if (--ctx->engine[ring->id].pin_count == 0) {
intel_unpin_ringbuffer_obj(ringbuf); intel_unpin_ringbuffer_obj(ringbuf);
i915_gem_object_ggtt_unpin(ctx_obj); i915_gem_object_ggtt_unpin(ctx_obj);
} }
...@@ -1751,7 +1751,7 @@ void intel_lr_context_free(struct intel_context *ctx) ...@@ -1751,7 +1751,7 @@ void intel_lr_context_free(struct intel_context *ctx)
intel_unpin_ringbuffer_obj(ringbuf); intel_unpin_ringbuffer_obj(ringbuf);
i915_gem_object_ggtt_unpin(ctx_obj); i915_gem_object_ggtt_unpin(ctx_obj);
} }
WARN_ON(ctx->engine[ring->id].unpin_count); WARN_ON(ctx->engine[ring->id].pin_count);
intel_destroy_ringbuffer_obj(ringbuf); intel_destroy_ringbuffer_obj(ringbuf);
kfree(ringbuf); kfree(ringbuf);
drm_gem_object_unreference(&ctx_obj->base); drm_gem_object_unreference(&ctx_obj->base);
......
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