• Ben Widawsky's avatar
    drm/i915: Split context enabling from init · 2fa48d8d
    Ben Widawsky authored
    We **need** to do this for exactly 1 reason, because we want to embed a
    PPGTT into the context, but we don't want to special case the default
    context.
    
    To achieve that, we must be able to initialize contexts after the GTT is
    setup (so we can allocate and pin the default context's BO), but before
    the PPGTT and rings are initialized. This is because, currently, context
    initialization requires ring usage. We don't have rings until after the
    GTT is setup. If we split the enabling part of context initialization,
    the part requiring the ringbuffer, we can untangle this, and then later
    embed the PPGTT
    
    Incidentally this allows us to also adhere to the original design of
    context init/fini in future patches: they were only ever meant to be
    called at driver load and unload.
    
    v2: Move hw_contexts_disabled test in i915_gem_context_enable() (Chris)
    
    v3: BUG_ON after checking for disabled contexts. Or else it blows up pre
    gen6 (Ben)
    
    v4: Forward port
    Modified enable for each ring, since that patch is earlier in the series
    Dropped ring arg from create_default_context so it can be used by others
    Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    2fa48d8d
i915_gem.c 127 KB