Commit f8291952 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Stop mapping the scratch page into CPU space

After the elimination of using the scratch page for Ironlake's
breadcrumb, we no longer need to kmap the object. We therefore can move
it into the high unmappable space and do not need to force the object to
be coherent (i.e. snooped on !llc platforms).
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1467390209-3576-9-git-send-email-chris@chris-wilson.co.uk
parent 1b7744e7
...@@ -648,58 +648,40 @@ static int init_ring_common(struct intel_engine_cs *engine) ...@@ -648,58 +648,40 @@ static int init_ring_common(struct intel_engine_cs *engine)
return ret; return ret;
} }
void void intel_fini_pipe_control(struct intel_engine_cs *engine)
intel_fini_pipe_control(struct intel_engine_cs *engine)
{ {
if (engine->scratch.obj == NULL) if (engine->scratch.obj == NULL)
return; return;
if (INTEL_GEN(engine->i915) >= 5) {
kunmap(sg_page(engine->scratch.obj->pages->sgl));
i915_gem_object_ggtt_unpin(engine->scratch.obj); i915_gem_object_ggtt_unpin(engine->scratch.obj);
}
drm_gem_object_unreference(&engine->scratch.obj->base); drm_gem_object_unreference(&engine->scratch.obj->base);
engine->scratch.obj = NULL; engine->scratch.obj = NULL;
} }
int int intel_init_pipe_control(struct intel_engine_cs *engine)
intel_init_pipe_control(struct intel_engine_cs *engine)
{ {
struct drm_i915_gem_object *obj;
int ret; int ret;
WARN_ON(engine->scratch.obj); WARN_ON(engine->scratch.obj);
engine->scratch.obj = i915_gem_object_create(engine->i915->dev, 4096); obj = i915_gem_object_create(engine->i915->dev, 4096);
if (IS_ERR(engine->scratch.obj)) { if (IS_ERR(obj)) {
DRM_ERROR("Failed to allocate seqno page\n"); DRM_ERROR("Failed to allocate scratch page\n");
ret = PTR_ERR(engine->scratch.obj); ret = PTR_ERR(obj);
engine->scratch.obj = NULL;
goto err; goto err;
} }
ret = i915_gem_object_set_cache_level(engine->scratch.obj, ret = i915_gem_obj_ggtt_pin(obj, 4096, PIN_HIGH);
I915_CACHE_LLC);
if (ret)
goto err_unref;
ret = i915_gem_obj_ggtt_pin(engine->scratch.obj, 4096, 0);
if (ret) if (ret)
goto err_unref; goto err_unref;
engine->scratch.gtt_offset = i915_gem_obj_ggtt_offset(engine->scratch.obj); engine->scratch.obj = obj;
engine->scratch.cpu_page = kmap(sg_page(engine->scratch.obj->pages->sgl)); engine->scratch.gtt_offset = i915_gem_obj_ggtt_offset(obj);
if (engine->scratch.cpu_page == NULL) {
ret = -ENOMEM;
goto err_unpin;
}
DRM_DEBUG_DRIVER("%s pipe control offset: 0x%08x\n", DRM_DEBUG_DRIVER("%s pipe control offset: 0x%08x\n",
engine->name, engine->scratch.gtt_offset); engine->name, engine->scratch.gtt_offset);
return 0; return 0;
err_unpin:
i915_gem_object_ggtt_unpin(engine->scratch.obj);
err_unref: err_unref:
drm_gem_object_unreference(&engine->scratch.obj->base); drm_gem_object_unreference(&engine->scratch.obj->base);
err: err:
......
...@@ -326,7 +326,6 @@ struct intel_engine_cs { ...@@ -326,7 +326,6 @@ struct intel_engine_cs {
struct { struct {
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
u32 gtt_offset; u32 gtt_offset;
volatile u32 *cpu_page;
} scratch; } scratch;
bool needs_cmd_parser; bool needs_cmd_parser;
......
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