1. 12 8月, 2014 1 次提交
  2. 11 8月, 2014 9 次提交
    • 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: 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
    • O
      drm/i915/bdw: A bit more advanced LR context alloc/free · 8c857917
      Oscar Mateo 提交于
      Now that we have the ability to allocate our own context backing objects
      and we have multiplexed one of them per engine inside the context structs,
      we can finally allocate and free them correctly.
      
      Regarding the context size, reading the register to calculate the sizes
      can work, I think, however the docs are very clear about the actual
      context sizes on GEN8, so just hardcode that and use it.
      
      v2: Rebased on top of the Full PPGTT series. It is important to notice
      that at this point we have one global default context per engine, all
      of them using the aliasing PPGTT (as opposed to the single global
      default context we have with legacy HW contexts).
      
      v3:
      - Go back to one single global default context, this time with multiple
        backing objects inside.
      - Use different context sizes for non-render engines, as suggested by
        Damien (still hardcoded, since the information about the context size
        registers in the BSpec is, well, *lacking*).
      - Render ctx size is 20 (or 19) pages, but not 21 (caught by Damien).
      - Move default context backing object creation to intel_init_ring (so
        that we don't waste memory in rings that might not get initialized).
      
      v4:
      - Reuse the HW legacy context init/fini.
      - Create a separate free function.
      - Rename the functions with an intel_ preffix.
      
      v5: Several rebases to account for the changes in the previous patches.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      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>
      8c857917
    • O
      drm/i915/bdw: Introduce one context backing object per engine · c9e003af
      Oscar Mateo 提交于
      A context backing object only makes sense for a given engine (because
      it holds state data specific to that engine).
      
      In legacy ringbuffer sumission mode, the only MI_SET_CONTEXT we really
      perform is for the render engine, so one backing object is all we nee.
      
      With Execlists, however, we need backing objects for every engine, as
      contexts become the only way to submit workloads to the GPU. To tackle
      this problem, we multiplex the context struct to contain <no-of-engines>
      objects.
      
      Originally, I colored this code by instantiating one new context for
      every engine I wanted to use, but this change suggested by Brad Volkin
      makes it more elegant.
      
      v2: Leave the old backing object pointer behind. Daniel Vetter suggested
      using a union, but it makes more sense to keep rcs_state as a NULL
      pointer behind, to make sure no one uses it incorrectly when Execlists
      are enabled, similar to what he suggested for ring->buffer (Rusty's API
      level 5).
      
      v3: Use the name "state" instead of the too-generic "obj", so that it
      mirrors the name choice for the legacy rcs_state.
      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>
      c9e003af
    • O
      drm/i915/bdw: Macro for LRCs and module option for Execlists · 127f1003
      Oscar Mateo 提交于
      GEN8 brings an expansion of the HW contexts: "Logical Ring Contexts".
      These expanded contexts enable a number of new abilities, especially
      "Execlists".
      
      The macro is defined to off until we have things in place to hope to
      work.
      
      v2: Rename "advanced contexts" to the more correct "logical ring
      contexts".
      
      v3: Add a module parameter to enable execlists. Execlist are relatively
      new, and so it'd be wise to be able to switch back to ring submission
      to debug subtle problems that will inevitably arise.
      
      v4: Add an intel_enable_execlists function.
      
      v5: Sanitize early, as suggested by Daniel. Remove lrc_enabled.
      
      Signed-off-by: Ben Widawsky <ben@bwidawsk.net> (v1)
      Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> (v3)
      Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> (v2, v4 & v5)
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      127f1003
    • O
      drm/i915/bdw: New source and header file for LRs, LRCs and Execlists · b20385f1
      Oscar Mateo 提交于
      Some legacy HW context code assumptions don't make sense for this new
      submission method, so we will place this stuff in a separate file.
      
      Note for reviewers: I've carefully considered the best name for this file
      and this was my best option (other possibilities were intel_lr_context.c
      or intel_execlist.c). I am open to a certain bikeshedding on this matter,
      anyway.
      
      And some point in time, it would be a good idea to split intel_lrc.c/.h
      even further, but for the moment just shove everything together.
      
      v2: Change to intel_lrc.c
      
      v3: Squash together with the header file addition
      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>
      b20385f1
    • C
      drm/i915: Agnostic INTEL_INFO · dbbe9127
      Chris Wilson 提交于
      Adapt the macro so that we can pass either the struct drm_device or the
      struct drm_i915_private pointers and get the answer we want. Over time,
      my plan is to convert all users over to using drm_i915_private and so
      trimming down the pointer dance. Having spent a few hours chasing that
      goal and achieved over 8k of object code saving, it appears to be a
      worthwhile target. This interim macro allows us to slowly convert over.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      [danvet: Drop the (struct drm_device *) cast per the m-l discussion.
      Also explain the seemingly unecessary first cast.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dbbe9127
    • C
      drm/i915: Copy PCI device id into the device info block · 87f1f465
      Chris Wilson 提交于
      This is so that we can make the drm_i915_private->info always the
      preferred source for chipset type and feature queries.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      87f1f465
    • C
      drm/i915: Remove fenced_gpu_access and pending_fenced_gpu_access · 82b6b6d7
      Chris Wilson 提交于
      This migrates the fence tracking onto the existing seqno
      infrastructure so that the later conversion to tracking via requests is
      simplified.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      82b6b6d7
  3. 09 8月, 2014 1 次提交
  4. 08 8月, 2014 5 次提交
  5. 07 8月, 2014 2 次提交
    • R
      drm/i915: Fix DEIER and GTIER collecting for BDW. · 885ea5a8
      Rodrigo Vivi 提交于
      BDW has many other Display Engine interrupts and GT interrupts registers.
      Collecting it properly on gpu_error_state.
      
      On debugfs all was properly listed already but besides we were also listing old
      DEIER and GTIER that doesn't exist on BDW anymore. This was causing
      unclaimed register messages
      
      v2: Fix small issues of first version and don't read DEIER regs when pipe's
          power well is disabled
      v3: bikeshed accepted: use enum pipe pipe instead of int i for pipe interection
      v4: Ben notice previous version was checking for display_power_enabled without
          using propper locks. Using _unlocked version isn't reliable and we cannot
          get this registers when power well is off. So let's avoid getting all DE_IER
          per pipe for now. If someone think this is an useful information it can be
          added later.
      v5: Ben: put back debugfs stuff that might be coverred by pm_get and use
          	 gen >= 8 trying to predict future.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81701
      Cc: Ben Widawsky <ben@bwidawsk.net>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: N(v3) Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      885ea5a8
    • R
      drm/i915: Collect gtier properly on HSW. · 843db716
      Rodrigo Vivi 提交于
      GTIER and DEIER doesn't have same interface on HSW so this "or" operation
      makes the information provided useless.
      
      v2: since we have gtier variable already let's split for everybody
      and avoid the strange | op.
          Also avoid overriding the value that was set for vlv. In this case I
          believe that we should reorganize the whole function, but I'll respect
          the comment that ask to not touch the order and let this organization
          work to be done later.
      v3: moving VLV check to the right place.
      
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      843db716
  6. 05 8月, 2014 1 次提交
  7. 23 7月, 2014 11 次提交
    • J
    • S
    • S
      5fafe292
    • P
      drm/i915: reorganize the unclaimed register detection code · 5978118c
      Paulo Zanoni 提交于
      The current code only runs when we do an I915_WRITE operation. It
      checks if the unclaimed register flag is set before we do the
      operation, and then it checks it again after we do the operation. This
      double check allows us to find out if the I915_WRITE operation in
      question is the bad one, or if some previous code is the bad one. When
      it finds a problem, our code uses DRM_ERROR to signal it.
      
      The good thing about the current code is that it detects the problem,
      so at least we can know we did something wrong. The problem is that
      even though we find the problem, we don't really have much information
      to actually debug it. So whenever I see one of these DRM_ERROR
      messages on my systems, the first thing I do is apply a patch to
      change the DRM_ERROR to a WARN and also check for unclaimed registers
      on I915_READ operations. This local patch makes things even slower,
      but it usually helps a lot in finding the bad code.
      
      The first point here is that since the current code is only useful to
      detect whether we have a problem or not, but it is not really good to
      find the cause of the problem, I don't think we should be checking
      both before and after every I915_WRITE operation: just doing the check
      once should be enough for us to quickly detect problems. With this
      change, the code that runs by default for every single user will only
      do 1 read operation for every single I915_WRITE, instead of 2. This
      patch does this change.
      
      The second point is that the local patch I have should be upstream,
      but since it makes things slower it should be disabled by default. So
      I added the i915.mmio_debug option to enable it.
      
      So after this patch, this is what will happen:
       - By default, we will try to detect unclaimed registers once after
         every I915_WRITE operation. Previously we tried twice for every
         I915_WRITE.
       - When we find an unclaimed register we will still print a DRM_ERROR
         message, but we will now tell the user to try again with
         i915.mmio_debug=1.
       - When we use i915.mmio_debug=1 we will try to find unclaimed
         registers both before and after every I915_READ and I915_WRITE
         operation, and we will print stack traces in case we find them.
         This should really help locating the exact point of the bad code
         (or at least finding out that i915.ko is not the problem).
      
      This commit also opens space for really-slow register debugging
      operations on other platforms. In theory we can now add lots and lots
      of debug code behind i915.mmio_debug, enable this option on our tests,
      and catch more problems.
      
      v2: - Remove not-so-useful comments (Daniel)
          - Fix the param definition macros (Rodrigo)
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@gmail.com>
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      5978118c
    • J
      drm/i915: add helper for checking whether IRQs are enabled · 9df7575f
      Jesse Barnes 提交于
      Now that we use the runtime IRQ enable/disable functions in our suspend
      path, we can simply check the pm._irqs_disabled flag everywhere.  So
      rename it to catch the users, and add an inline for it to make the
      checks clear everywhere.
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Reviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9df7575f
    • D
      drm/i915: Also give the sprite width for WM computation · ed57cb8a
      Damien Lespiau 提交于
      In the future, we'll need the height of the fb to fetch from memory for
      WM computation.
      Signed-off-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ed57cb8a
    • D
      drm/i915: Fix up PSR frontbuffer tracking · 9ca15301
      Daniel Vetter 提交于
      I've tried to split this up, but all the changes are so tightly
      related that I didn't find a good way to do this without breaking
      bisecting. Essentially this completely changes how psr is glued into
      the overall driver, and there's not much you can do to soften such a
      paradigm change.
      
      - Use frontbuffer tracking bits stuff to separate disable and
        re-enable.
      
      - Don't re-check everything in the psr work. We have now accurate
        tracking for everything, so no need to check for sprites or tiling
        really. Allows us to ditch tons of locks.
      
      - That in turn allows us to properly cancel the work in the disable
        function - no more deadlocks.
      
      - Add a check for HSW sprites and force a flush. Apparently the
        hardware doesn't forward the flushing when updating the sprite base
        address. We can do the same trick everywhere else we have such
        issues, e.g. on baytrail with ... everything.
      
      - Don't re-enable psr with a delay in psr_exit. It really must be
        turned off forever if we detect a gtt write. At least with the
        current frontbuffer render tracking. Userspace can do a busy ioctl
        call or no-op pageflip to re-enable psr.
      
      - Drop redundant checks for crtc and crtc->active - now that they're
        only called from enable this is guaranteed.
      
      - Fix up the hsw port check. eDP can also happen on port D, but the
        issue is exactly that it doesn't work there. So an || check is
        wrong.
      
      - We still schedule the psr work with a delay. The frontbuffer
        flushing interface mandates that we upload the next full frame, so
        need to wait a bit. Once we have single-shot frame uploads we can do
        better here.
      
      v2: Don't enable psr initially, rely upon the fb flush of the initial
      plane setup for that. Gives us more unified code flow and makes the
      crtc enable sequence less a special case.
      
      v3: s/psr_exit/psr_invalidate/ for consistency
      
      v4: Fixup whitespace.
      
      v5: Correctly bail out of psr_invalidate/flush when
      dev_priv->psr.enabled is NULL. Spotted by Rodrigo.
      
      v6:
      - Only schedule work when there's work to do. Fixes WARNINGs reported
        by Rodrigo.
      - Comments Chris requested to clarify the code.
      
      v7: Fix conflict on rebase (Rodrigo)
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v6)
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9ca15301
    • D
      drm/i915: Add locking to psr code · f0355c4a
      Daniel Vetter 提交于
      It's not really optional to have locking ...
      
      The ugly part is how much locking the psr work needs since it has to
      recheck everything. Which is way too much. But we need to ditch the
      psr work in it's current form anyway and implement proper frontbuffer
      tracking.
      
      The other nasty bit that had to go was the delayed work cancle in
      psr_exit. Which means a bunch of races just became a bit more likely,
      but mea culpa.
      
      v2: Fixup HAS_PSR checks, resulting in uninitialized mutex issues.
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f0355c4a
    • D
      drm/i915: Track the psr dp connector in dev_priv->psr.enabled · 2807cf69
      Daniel Vetter 提交于
      Trying to fish that one out through looping is a bit a locking
      nightmare. So just set it and use it in the work struct.
      
      v2:
      - Don't Oops in psr_work, spotted by Rodrigo.
      - Fix compile warning.
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2807cf69
    • D
      drm/i915: Run psr_setup unconditionally · 9a603f48
      Daniel Vetter 提交于
      Due to runtime pm and system s/r we need to restore hw state every
      time we enable a pipe again. Hence trying to avoid that is just
      pointless book-keeping which Rodrigo then tried to work around by
      manually adding psr_setup calls to our resume code.
      
      Much simpler to just remove code instead.
      
      v2: Properly bail out of psr exit if psr isn't enabled. Spotted by
      Rodrigo.
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9a603f48
    • B
      drm/i915: Power gating display wells during i915_pm_suspend · b04c5bd6
      Borun Fu 提交于
      On VLV, after i915_pm_suspend display power wells are staying
      power ungated. So, after initiating mem sleep "echo mem > /sys/power/state"
      Display is staing D0 State. There might be better way/place to power gate
      these wells. Also, we need to make sure that if wells are power gated due to
      DPMS OFF sequence, they need not be turned off by i915_pm_suspend again.
      
      v2: Extracted helper for intel_crtc_disable and power gating CRTC power wells.
      [Daniel]
      
      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>
      Change-Id: I34c80da66aa24c423a5576c68aa1f3a8d0f43848
      Signed-off-by: NBorun Fu <borun.fu@intel.com>
      Signed-off-by: NSagar Kamble <sagar.a.kamble@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b04c5bd6
  8. 22 7月, 2014 1 次提交
    • D
      drm/i915: add DP 1.2 MST support (v0.7) · 0e32b39c
      Dave Airlie 提交于
      This adds DP 1.2 MST support on Haswell systems.
      
      Notes:
      a) this reworks irq handling for DP MST ports, so that we can
      avoid the mode config locking in the current hpd handlers, as
      we need to process up/down msgs at a better time.
      
      Changes since v0.1:
      use PORT_PCH_HOTPLUG to detect short vs long pulses
      add a workqueue to deal with digital events as they can get blocked on the
      main workqueue beyong mode_config mutex
      fix a bunch of modeset checker warnings
      acks irqs in the driver
      cleanup the MST encoders
      
      Changes since v0.2:
      check irq status again in work handler
      move around bring up and tear down to fix DPMS on/off
      use path properties.
      
      Changes since v0.3:
      updates for mst apis
      more state checker fixes
      irq handling improvements
      fbcon handling support
      improved reference counting of link - fixes redocking.
      
      Changes since v0.4:
      handle gpu reset hpd reinit without oopsing
      check link status on HPD irqs
      fix suspend/resume
      
      Changes since v0.5:
      use proper functions to get max link/lane counts
      fix another checker backtrace - due to connectors disappearing.
      set output type in more places fro, unknown->displayport
      don't talk to devices if no HPD asserted
      check mst on short irqs only
      check link status properly
      rebase onto prepping irq changes.
      drop unsued force_act
      
      Changes since v0.6:
      cleanup unused struct entry.
      
      [airlied: fix some sparse warnings].
      Reviewed-by: NTodd Previte <tprevite@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      0e32b39c
  9. 12 7月, 2014 1 次提交
  10. 11 7月, 2014 8 次提交