[Intel-gfx] [PATCH 10/53] drm/i915/bdw: A bit more advanced context init/fini

Daniel Vetter daniel at ffwll.ch
Thu Jun 19 08:13:20 CEST 2014


On Thu, Jun 19, 2014 at 12:13 AM, Volkin, Bradley D
<bradley.d.volkin at intel.com> wrote:
>> +void intel_lr_context_free(struct intel_context *ctx)
>> +{
>> +     int i;
>> +
>> +     for (i = 0; i < I915_NUM_RINGS; i++) {
>> +             struct drm_i915_gem_object *ctx_obj = ctx->engine[i].obj;
>> +             if (ctx_obj) {
>> +                     i915_gem_object_ggtt_unpin(ctx_obj);
>
> I suspect that leaving the backing objects pinned in ggtt for their entire
> lifetimes is going to eventually cause memory related issues. We might need
> to look at managing the binding more dynamically - similar to what the
> legacy context code already does.

Oh, I didin't spot this. We definitely need the same handling as for
legacy ring handling, so:
- Only pin while a ctx is used, shoveling the old context through the
active list for timeline unbinding.
- Last-ditch effort in evict_something to switch to the default context.

Without that we'll fragment the global gtt badly even before we
exhaust it, and that means we can't pin scanout buffers any more and
can't handle gtt mmap faults any more. There should be a nasty
testcase somewhere even to exercise the last-ditch context evict code.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list