1. 14 8月, 2014 2 次提交
    • S
      drm/i915: Sharing platform specific sequence between runtime and system suspend/ resume paths · 016970be
      Sagar Kamble 提交于
      On VLV, post S0i3 during i915_drm_thaw following issue is observed during ring
      initialization.
      
      [ 335.604039] [drm:stop_ring] ERROR render ring :timed out trying to stop ring
      [ 336.607340] [drm:stop_ring] ERROR render ring :timed out trying to stop ring
      [ 336.607345] [drm:init_ring_common] ERROR failed to set render ring head to zero ctl 00000000 head 00000000 tail 00000000 start 00000000
      [ 337.610645] [drm:stop_ring] ERROR bsd ring :timed out trying to stop ring
      [ 338.613952] [drm:stop_ring] ERROR bsd ring :timed out trying to stop ring
      [ 338.613956] [drm:init_ring_common] ERROR failed to set bsd ring head to zero ctl 00000000 head 00000000 tail 00000000 start 00000000
      [ 339.617256] [drm:stop_ring] ERROR render ring :timed out trying to stop ring
      [ 339.617258] -----------[ cut here ]-----------
      [ 339.617267] WARNING: CPU: 0 PID: 6 at drivers/gpu/drm/i915/intel_ringbuffer.c:1666 intel_cleanup_ring+0xe6/0xf0()
      [ 339.617396] --[ end trace 5ef5ed1a3c92e2a6 ]--
      [ 339.617428] [drm:__i915_drm_thaw] ERROR failed to re-initialize GPU, declaring wedged!
      
      This is happening since wake is not enabled and Gunit registers are not restored.
      For this system suspend/resume paths need to follow save/restore and additional
      platform specific setup in suspend_complete and resume_prepare.
      
      suspend_complete is shared unconditionaly for VLV, HSW, BDW. resume_prepare for
      HSW and BDW has pc8 disabling which is needed during thaw_early so sharing
      uncondtionally. For VLV and SNB runtime resume specific sequence exists.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Goel, Akash <akash.goel@intel.com>
      Signed-off-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      016970be
    • S
      drm/i915: Created common handler for platform specific suspend/resume · ebc32824
      Sagar Kamble 提交于
      With this change, intel_runtime_suspend and intel_runtime_resume functions
      become completely platform agnostic. Platform specific suspend/resume
      changes are moved to intel_suspend_complete and intel_resume_prepare.
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Goel, Akash <akash.goel@intel.com>
      Signed-off-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ebc32824
  2. 13 8月, 2014 18 次提交
  3. 12 8月, 2014 11 次提交
  4. 11 8月, 2014 9 次提交
    • O
      drm/i915/bdw: GEN-specific logical ring set/get seqno · e94e37ad
      Oscar Mateo 提交于
      No mistery here: the seqno is still retrieved from the engine's
      HW status page (the one in the default context. For the moment,
      I see no reason to worry about other context's HWS page).
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e94e37ad
    • O
      drm/i915/bdw: GEN-specific logical ring init · 9b1136d5
      Oscar Mateo 提交于
      Logical rings do not need most of the initialization their
      legacy ringbuffer counterparts do: we just need the pipe
      control object for the render ring, enable Execlists on the
      hardware and a few workarounds.
      
      v2: Squash with: "drm/i915: Extract pipe control fini & make
      init outside accesible".
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet: Make checkpatch happy.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9b1136d5
    • O
      drm/i915/bdw: Generic logical ring init and cleanup · 48d82387
      Oscar Mateo 提交于
      Allocate and populate the default LRC for every ring, call
      gen-specific init/cleanup, init/fini the command parser and
      set the status page (now inside the LRC object). These are
      things all engines/rings have in common.
      
      Stopping the ring before cleanup and initializing the seqnos
      is left as a TODO task (we need more infrastructure in place
      before we can achieve this).
      
      v2: Check the ringbuffer backing obj for ring_is_initialized,
      instead of the context backing obj (similar, but not exactly
      the same).
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      48d82387
    • O
      drm/i915/bdw: Skeleton for the new logical rings submission path · 454afebd
      Oscar Mateo 提交于
      Execlists are indeed a brave new world with respect to workload
      submission to the GPU.
      
      In previous version of these series, I have tried to impact the
      legacy ringbuffer submission path as little as possible (mostly,
      passing the context around and using the correct ringbuffer when I
      needed one) but Daniel is afraid (probably with a reason) that
      these changes and, especially, future ones, will end up breaking
      older gens.
      
      This commit and some others coming next will try to limit the
      damage by creating an alternative path for workload submission.
      The first step is here: laying out a new ring init/fini.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      454afebd
    • O
      drm/i915: Abstract the legacy workload submission mechanism away · a83014d3
      Oscar Mateo 提交于
      As suggested by Daniel Vetter. The idea, in subsequent patches, is to
      provide an alternative to these vfuncs for the Execlists submission
      mechanism.
      
      v2: Splitted into two and reordered to illustrate our intentions, instead
      of showing it off. Also, remove the add_request vfunc and added the
      stop_ring one.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      [danvet:
      - Make checkpatch happy.
      - Be grumpy about the excessive vtable.
      - Ditch gt->is_ring_initialized.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a83014d3
    • O
      drm/i915/bdw: Deferred creation of user-created LRCs · ec3e9963
      Oscar Mateo 提交于
      The backing objects and ringbuffers for contexts created via open
      fd are actually empty until the user starts sending execbuffers to
      them. At that point, we allocate & populate them. We do this because,
      at create time, we really don't know which engine is going to be used
      with the context later on (and we don't want to waste memory on
      objects that we might never use).
      
      v2: As contexts created via ioctl can only be used with the render
      ring, we have enough information to allocate & populate them right
      away.
      
      v3: Defer the creation always, even with ioctl-created contexts, as
      requested by Daniel Vetter.
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ec3e9963
    • O
      drm/i915/bdw: Populate LR contexts (somewhat) · 8670d6f9
      Oscar Mateo 提交于
      For the most part, logical ring context objects are similar to hardware
      contexts in that the backing object is meant to be opaque. There are
      some exceptions where we need to poke certain offsets of the object for
      initialization, updating the tail pointer or updating the PDPs.
      
      For our basic execlist implementation we'll only need our PPGTT PDs,
      and ringbuffer addresses in order to set up the context. With previous
      patches, we have both, so start prepping the context to be load.
      
      Before running a context for the first time you must populate some
      fields in the context object. These fields begin 1 PAGE + LRCA, ie. the
      first page (in 0 based counting) of the context  image. These same
      fields will be read and written to as contexts are saved and restored
      once the system is up and running.
      
      Many of these fields are completely reused from previous global
      registers: ringbuffer head/tail/control, context control matches some
      previous MI_SET_CONTEXT flags, and page directories. There are other
      fields which we don't touch which we may want in the future.
      
      v2: CTX_LRI_HEADER_0 is MI_LOAD_REGISTER_IMM(14) for render and (11)
      for other engines.
      
      v3: Several rebases and general changes to the code.
      
      v4: Squash with "Extract LR context object populating"
      Also, Damien's review comments:
      - Set the Force Posted bit on the LRI header, as the BSpec suggest we do.
      - Prevent warning when compiling a 32-bits kernel without HIGHMEM64.
      - Add a clarifying comment to the context population code.
      
      v5: Damien's review comments:
      - The third MI_LOAD_REGISTER_IMM in the context does not set Force Posted.
      - Remove dead code.
      
      v6: Add a note about the (presumed) differences between BDW and CHV state
      contexts. Also, Brad's review comments:
      - Use the _MASKED_BIT_ENABLE, upper_32_bits and lower_32_bits macros.
      - Be less magical about how we set the ring size in the context.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com> (v2)
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      8670d6f9
    • D
      drm/i915/bdw: Add a context and an engine pointers to the ringbuffer · 0c7dd53b
      Daniel Vetter 提交于
      Any given ringbuffer is unequivocally tied to one context and one engine.
      By setting the appropriate pointers to them, the ringbuffer struct holds
      all the infromation you might need to submit a workload for processing,
      Execlists style.
      
      v2: Drop ring->ctx since that looks terribly ill-defined for legacy
      ringbuffer submission.
      
      Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> (v1)
      Acked-by: Damien Lespiau <damien.lespiau@intel.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      0c7dd53b
    • O
      drm/i915/bdw: Allocate ringbuffers for Logical Ring Contexts · 84c2377f
      Oscar Mateo 提交于
      As we have said a couple of times by now, logical ring contexts have
      their own ringbuffers: not only the backing pages, but the whole
      management struct.
      
      In a previous version of the series, this was achieved with two separate
      patches:
      drm/i915/bdw: Allocate ringbuffer backing objects for default global LRC
      drm/i915/bdw: Allocate ringbuffer for user-created LRCs
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      84c2377f