1. 03 12月, 2014 7 次提交
    • J
      drm/i915: Remove the now redundant 'obj->ring' · 41c52415
      John Harrison 提交于
      The ring member of the object structure was always updated with the
      last_read_seqno member. Thus with the conversion to last_read_req, obj->ring is
      now a direct copy of obj->last_read_req->ring. This makes it somewhat redundant
      and potentially misleading (especially as there was no comment to explain its
      purpose).
      
      This checkin removes the redundant field. Many uses were simply testing for
      non-null to see if the object is active on the GPU. Some of these have been
      converted to check 'obj->active' instead. Others (where the last_read_req is
      about to be used anyway) have been changed to check obj->last_read_req. The rest
      simply pull the ring out from the request structure and proceed as before.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      41c52415
    • J
      drm/i915: Convert 'i915_seqno_passed' calls into 'i915_gem_request_completed' · 1b5a433a
      John Harrison 提交于
      Almost everywhere that caled i915_seqno_passed() was really asking 'has the
      given seqno popped out of the hardware yet?'. Thus it had to query the current
      hardware seqno and then do a signed delta comparison (which copes with wrapping
      around zero but not with seqno values more than 2GB apart, although the latter
      is unlikely!).
      
      Now that the majority of seqno instances have been replaced with request
      structures, it is possible to convert this test to be request based as well.
      There is now a 'i915_gem_request_completed()' function which takes a request and
      returns true or false as appropriate. Note that this currently just wraps up the
      original _passed() test but a later patch in the series will reduce this to
      simply returning a cached internal value, i.e.:
        _completed(req) { return req->completed; }'
      
      This checkin converts almost all _seqno_passed() calls. The only one left is in
      the semaphore code which still requires seqnos not request structures.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      [danvet: Drop hunk touching the trace_irq code since I've dropped the
      patch which converts that, and resolve resulting conflict.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      1b5a433a
    • J
      drm/i915: Convert 'flip_queued_seqno' into 'flip_queued_request' · f06cc1b9
      John Harrison 提交于
      Converted the flip_queued_seqno value to be a request structure as part of the
      on going seqno to request changes. This includes reference counting the request
      being saved away to ensure it can not be retired and freed while the flip code
      is still waiting on it.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      [danvet: Again get rid of the _irq request unref by simply moving that
      into the unpin worker. Doesn't matter when we hang onto the request
      for a bit longer, and in the unpin worker we already grab the
      dev->struct_mutex anyway.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f06cc1b9
    • J
      drm/i915: Replace last_[rwf]_seqno with last_[rwf]_req · 97b2a6a1
      John Harrison 提交于
      The object structure contains the last read, write and fenced seqno values for
      use in syncrhonisation operations. These have now been replaced with their
      request structure counterparts.
      
      Note that to ensure that objects do not end up with dangling pointers, the
      assignments of last_*_req include reference count updates. Thus a request cannot
      be freed if an object is still hanging on to it for any reason.
      
      v2: Corrected 'last_rendering_' to 'last_read_' in a number of comments that did
      not get updated when 'last_rendering_seqno' became 'last_read|write_seqno'
      several millenia ago.
      
      For: VIZ-4377
      Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
      Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      97b2a6a1
    • D
      drm/i915: Remove user pinning code · 4feb7659
      Daniel Vetter 提交于
      Now unused.
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      4feb7659
    • R
      drm/i915: VLV/CHV PSR debugfs. · a6cbdb8e
      Rodrigo Vivi 提交于
      Add debugfs support for Valleyview and Cherryview considering that
      we have PSR per pipe and  we don't have any kind of
      performance counter as we have on other platforms that support PSR.
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Reviewed-by: NDurgadoss R <durgadoss.r@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a6cbdb8e
    • D
      drm/i915: Handle runtime pm in the CRC setup code · 9d8b0588
      Daniel Vetter 提交于
      The crc code doesn't handle anything really that could drop the
      register state (by design so that we have less complexity). Which
      means userspace may only start crc capture once the pipe is fully set
      up.
      
      With an i-g-t patch this will be the case, but there's still the
      problem that this results in obscure unclaimed register write
      failures. Which is a pain to debug.
      
      So instead make sure we don't have the basic unclaimed register write
      failure by grabbing runtime pm references. And reject completely
      invalid requests with -EIO. This is still racy of course, but for a
      test library we don't really care - if userspace shuts down the pipe
      right afterwards the entire setup will be lost anyway.
      
      v2: Put instead of get, spotted by Damien. Also explain the runtime pm
      dance.
      
      v3: There's really no need for rpm get/put since power_is_enabled only
      checks software state (Damien).
      
      References: https://bugs.freedesktop.org/show_bug.cgi?id=86092
      Cc: Damien Lespiau <damien.lespiau@intel.com> (v2)
      Tested-by: Nlu hua <huax.lu@intel.com>
      Reviewed-by: NDamien Lespiau <damien.lespiau@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      9d8b0588
  2. 02 12月, 2014 1 次提交
    • T
      drm/i915: Don't pin LRC in GGTT when dumping in debugfs · 064ca1d2
      Thomas Daniel 提交于
      LRC object does not need to be mapped into the GGTT when dumping. A side-effect
      of this patch is that a compiler warning goes away (not checking return value
      of i915_gem_obj_ggtt_pin).
      
      v2: Broke out individual context dumping into a new function as the indentation
      was getting a bit crazy.  Added notification of contexts with no gem object for
      debugging purposes.  Removed unnecessary pin_pages and unpin_pages, replaced
      with explicit get_pages for the context object as there may be no backing store
      allocated at this time (Comment for get_pages says "Ensure that the associated
      pages are gathered from the backing storage and pinned into our object").
      Improved error checking - get_pages and get_page are checked for failure.
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      [danvet: Align paramter continuation lines properly. Also add some
      braces to the nested loops again for readability.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      064ca1d2
  3. 20 11月, 2014 3 次提交
    • V
      drm/i915: Read power well status before other registers for drpc info · 6b312cd3
      Ville Syrjälä 提交于
      Trying to read the status of the power wells right after taking forcewake
      for the other register reads makes little sense. Most of the time the
      power wells will still be up due to the recent forcewake. Instead do the
      power well status read first, and only then read the register needing
      forcewake. This way the reported power well status can actually reflect
      what's going on in the system.
      
      Cc: Deepak S <deepak.s@intel.com>
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NDeepak S <deepak.s@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6b312cd3
    • D
      drm/i915: Pin tiled objects for L-shaped configs · 656bfa3a
      Daniel Vetter 提交于
      Let's just throw in the towel on this one and take the cheap way out.
      
      Based on a patch from Chris Wilson, but checking for a different bit.
      Chris' patch checked for even bank layout, this one here for a magic
      bit. Given the evidence we've gathered (not much) both work I think,
      but checking for the magic bit might be more accurate.
      
      Anyway, works on my gm45 here.
      
      For paranoi restrict to gen4 (and mobile), since we've only ever seen
      this on gm45 and i965gm.
      
      Also add some debugfs output so that we can skip the tiled swapping
      tests properly in these cases.
      
      v2: Clean up the quirk'ed pin count in free_object to avoid upsetting
      the WARN_ON. Spotted by Chris.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=28813
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45092Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      656bfa3a
    • O
      drm/i915/bdw: Pin the context backing objects to GGTT on-demand · dcb4c12a
      Oscar Mateo 提交于
      Up until now, we have pinned every logical ring context backing object
      during creation, and left it pinned until destruction. This made my life
      easier, but it's a harmful thing to do, because we cause fragmentation
      of the GGTT (and, eventually, we would run out of space).
      
      This patch makes the pinning on-demand: the backing objects of the two
      contexts that are written to the ELSP are pinned right before submission
      and unpinned once the hardware is done with them. The only context that
      is still pinned regardless is the global default one, so that the HWS can
      still be accessed in the same way (ring->status_page).
      
      v2: In the early version of this patch, we were pinning the context as
      we put it into the ELSP: on the one hand, this is very efficient because
      only a maximum two contexts are pinned at any given time, but on the other
      hand, we cannot really pin in interrupt time :(
      
      v3: Use a mutex rather than atomic_t to protect pin count to avoid races.
      Do not unpin default context in free_request.
      
      v4: Break out pin and unpin into functions.  Fix style problems reported
      by checkpatch
      
      v5: Remove unpin_lock as all pinning and unpinning is done with the struct
      mutex already locked.  Add WARN_ONs to make sure this is the case in future.
      
      Issue: VIZ-4277
      Signed-off-by: NOscar Mateo <oscar.mateo@intel.com>
      Signed-off-by: NThomas Daniel <thomas.daniel@intel.com>
      Reviewed-by: NAkash Goel <akash.goels@gmail.com>
      Reviewed-by: Deepak S<deepak.s@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dcb4c12a
  4. 08 11月, 2014 4 次提交
  5. 05 11月, 2014 1 次提交
    • P
      drm/i915: transform INTEL_OUTPUT_* into an enum · 6847d71b
      Paulo Zanoni 提交于
      Because I got annoyed that I had to document what values "int
      ddi_personality" is supposed to hold.
      
      A good side-effect of this change is that now the compilers can do
      some additional checks on our code, which may prevent some bugs in the
      future. A bad side-effect of this change is that now the compilers do
      some additional checks on our code and complain when a switch
      statement doesn't check for all possible values, so we need to add
      "default" cases to all those switches. Hopefully, this may help
      preventing confusions against DRM_MODE_CONNECTOR_* and
      DRM_MODE_ENCODER_*.
      
      I guess that just by looking at the patch, some people will think this
      change is not worth its benefits. In this case, I don't really mind
      dropping the patch.
      
      Also, there's probably still a few more places where we can
      s/int/enum intel_output_type/, but we can change that later, when we
      spot the places.
      Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      [danvet: Resolve conflict due to reordered patches.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6847d71b
  6. 04 11月, 2014 1 次提交
  7. 24 10月, 2014 4 次提交
  8. 01 10月, 2014 1 次提交
  9. 24 9月, 2014 1 次提交
  10. 19 9月, 2014 2 次提交
  11. 05 9月, 2014 1 次提交
    • C
      drm/i915: Check for a stalled page flip after each vblank · d6bbafa1
      Chris Wilson 提交于
      Long ago, back in the racy haydays of 915gm interrupt handling, page
      flips would occasionally go astray and leave the hardware stuck, and the
      display not updating. This annoyed people who relied on their systems
      being able to display continuously updating information 24/7, and so
      some code to detect when the driver missed the page flip completion
      signal was added. Until recently, it was presumed that the interrupt
      handling was now flawless, but once again Simon Farnsworth has found a
      system whose display will stall. Reinstate the pageflip stall detection,
      which works by checking to see if the hardware has been updated to the
      new framebuffer address following each vblank. If the hardware is
      scanning out from the new framebuffer, but we still think the flip is
      pending, then we kick our driver into submision.
      
      This is a continuation of the effort started with
      commit 4e5359cd
      Author: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
      Date:   Wed Sep 1 17:47:52 2010 +0100
      
          drm/i915: Avoid pageflipping freeze when we miss the flip prepare interrupt
      
      This now includes a belt-and-braces approach to make sure the driver
      (or the hardware) doesn't miss an interrupt and cause us to stop
      updating the display should the unthinkable happen and the pageflip fail - i.e.
      that the user is able to continue submitting flips.
      
      v2: Cleanup, refactor, and rename
      v3: Only start counting vblanks after the flip command has been seen by
          the hardware.
      v4: Record the seqno after we touch the ring, or else there may be no
          seqno allocated yet.
      v5: Rebase on mmio-flip.
      v6: Rebase, rebase.
      Reported-by: NSimon Farnsworth <simon@farnz.org.uk>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75502Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [v4]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d6bbafa1
  12. 04 9月, 2014 1 次提交
  13. 03 9月, 2014 8 次提交
  14. 20 8月, 2014 3 次提交
  15. 13 8月, 2014 2 次提交
    • D
      drm/i915: Only track real ppgtt for a context · ae6c4806
      Daniel Vetter 提交于
      There's a bit a confusion since we track the global gtt,
      the aliasing and real ppgtt in the ctx->vm pointer. And not
      all callers really bother to check for the different cases and just
      presume that it points to a real ppgtt.
      
      Now looking closely we don't actually need ->vm to always point at an
      address space - the only place that cares actually has fixup code
      already to decide whether to look at the per-proces or the global
      address space.
      
      So switch to just tracking the ppgtt directly and ditch all the
      extraneous code.
      
      v2: Fixup the ppgtt debugfs file to not oops on a NULL ctx->ppgtt.
      Also drop the early exit - without aliasing ppgtt we want to dump all
      the ppgtts of the contexts if we have full ppgtt.
      
      v3: Actually git add the compile fix.
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Cc: "Thierry, Michel" <michel.thierry@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      OTC-Jira: VIZ-3724
      [danvet: Resolve conflicts with execlist patches while applying.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      ae6c4806
    • D
      drm/i915: Track file_priv, not ctx in the ppgtt structure · 4d884705
      Daniel Vetter 提交于
      Hardware contexts reference a ppgtt, not the other way round. And the
      only user of this (in debugfs) actually only cares about which file
      the ppgtt is associated with. So give it what it wants.
      
      While at it give the ppgtt create function a proper name&place.
      Reviewed-by: NMichel Thierry <michel.thierry@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4d884705