1. 29 11月, 2012 6 次提交
    • D
      drm/i915: simplify shmem pwrite/pread slowpath handling · a39a6805
      Daniel Vetter 提交于
      The shmem paths for pwrite/pread used a clever trick to hold onto a
      single page when dropping the big dev->struct_mutex for the slowpath.
      But this ran the risk of reinstating (or not completely purging) the
      backing storage when dropping purgeable objects.
      
      Hence the code needed to keep track of whether it ever dropped the
      lock, and if it did, manually check whether it needs to re-purge the
      backing storage. But thanks to the pages pin count introduced in
      
      commit a5570178
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Sep 4 21:02:54 2012 +0100
      
          drm/i915: Pin backing pages whilst exporting through a dmabuf vmap
      
      which allowed us to pin the backing storage and remove that page
      reference trick from shmem_pwrite/read in
      
      commit f60d7f0c
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Sep 4 21:02:56 2012 +0100
      
          drm/i915: Pin backing pages for pread
      
      and
      
      commit 755d2218
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Sep 4 21:02:55 2012 +0100
      
          drm/i915: Pin backing pages for pwrite
      
      we can now abolish this check. The slowpath cleanup completely
      disappears from pread, and for pwrite we're only left with the domain
      fixup in case someone moved the object out of the cpu domain from
      under us. A follow-on patch will optimize that a notch more.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a39a6805
    • M
      drm/i915: Set sync_seqno properly after seqno wrap · 7b01e260
      Mika Kuoppala 提交于
      i915_gem_handle_seqno_wrap() will zero all sync_seqnos but as the
      wrap can happen inside ring->sync_to(), pre wrap seqno was
      carried over and overwrote the zeroed sync_seqno.
      
      When wrap is handled, all outstanding requests will be retired and
      objects moved to inactive queue, causing their last_read_seqno to be zero.
      Use this to update the sync_seqno correctly.
      
      RING_SYNC registers after wrap will contain pre wrap values which
      are >= seqno. So injecting the semaphore wait into ring completes
      immediately.
      
      Original idea for using last_read_seqno from Chris Wilson.
      Signed-off-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7b01e260
    • C
      drm/i915: Rearrange code to only have a single method for waiting upon the ring · 3e960501
      Chris Wilson 提交于
      Replace the wait for the ring to be clear with the more common wait for
      the ring to be idle. The principle advantage is one less exported
      intel_ring_wait function, and the removal of a hardcoded value.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3e960501
    • C
      drm/i915: Simplify flushing activity on the ring · b662a066
      Chris Wilson 提交于
      As we now always preallocate the seqno before writing to the ring, we
      can trivially test if we have any pending activity on the ring by
      inspecting the olr. This makes it then possible to flush operations that
      are not normally associated with a request, like power-management.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b662a066
    • C
      drm/i915: Preallocate next seqno before touching the ring · 9d773091
      Chris Wilson 提交于
      Based on the work by Mika Kuoppala, we realised that we need to handle
      seqno wraparound prior to committing our changes to the ring. The most
      obvious point then is to grab the seqno inside intel_ring_begin(), and
      then to reuse that seqno for all ring operations until the next request.
      As intel_ring_begin() can fail, the callers must already be prepared to
      handle such failure and so we can safely add further checks.
      
      This patch looks like it should be split up into the interface
      changes and the tweaks to move seqno wrapping from the execbuffer into
      the core seqno increment. However, I found no easy way to break it into
      incremental steps without introducing further broken behaviour.
      
      v2: Mika found a silly mistake and a subtle error in the existing code;
      inside i915_gem_retire_requests() we were resetting the sync_seqno of
      the target ring based on the seqno from this ring - which are only
      related by the order of their allocation, not retirement. Hence we were
      applying the optimisation that the rings were synchronised too early,
      fortunately the only real casualty there is the handling of seqno
      wrapping.
      
      v3: Do not forget to reset the sync_seqno upon module reinitialisation,
      ala resume.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=863861
      Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> [v2]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9d773091
    • C
      drm/i915: Wait upon the last request seqno, rather than a future seqno · b5d17794
      Chris Wilson 提交于
      In commit 69c2fc89
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Fri Jul 20 12:41:03 2012 +0100
      
          drm/i915: Remove the per-ring write list
      
      the explicit flush was removed from i915_ring_idle(). However, we
      continued to wait upon the next seqno which now did not correspond to
      any request (except for the unusual condition of a failure to queue a
      request after execbuffer) and so would wait indefinitely.
      
      This has an important side-effect that i915_gpu_idle() does not cause
      the seqno to be incremented. This is vital if we are to be able to idle
      the GPU to handle seqno wraparound, as in subsequent patches.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b5d17794
  2. 22 11月, 2012 4 次提交
  3. 12 11月, 2012 3 次提交
    • B
      drm/i915: Move the remaining gtt code · 26b1ff35
      Ben Widawsky 提交于
      It's pretty much all consolidated now that we've killed AGP. We can move
      the one outlier, and defines too.
      
      (Kill some unused defines in the process)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      26b1ff35
    • B
      drm/i915: Stop using AGP layer for GEN6+ · e76e9aeb
      Ben Widawsky 提交于
      As a quick hack we make the old intel_gtt structure mutable so we can
      fool a bunch of the existing code which depends on elements in that data
      structure. We can/should try to remove this in a subsequent patch.
      
      This should preserve the old gtt init behavior which upon writing these
      patches seems incorrect. The next patch will fix these things.
      
      The one exception is VLV which doesn't have the preserved flush control
      write behavior. Since we want to do that for all GEN6+ stuff, we'll
      handle that in a later patch. Mainstream VLV support doesn't actually
      exist yet anyway.
      
      v2: Update the comment to remove the "voodoo"
      Check that the last pte written matches what we readback
      
      v3: actually kill cache_level_to_agp_type since most of the flags will
      disappear in an upcoming patch
      
      v4: v3 was actually not what we wanted (Daniel)
      Make the ggtt bind assertions better and stricter (Chris)
      Fix some uncaught errors at gtt init (Chris)
      Some other random stuff that Chris wanted
      
      v5: check for i==0 in gen6_ggtt_bind_object to shut up gcc (Ben)
      Signed-off-by: NBen Widawsky <ben@bwidawsk.net>
      Reviewed-by [v4]: Chris Wilson <chris@chris-wilson.co.uk>
      [danvet: Make the cache_level -> agp_flags conversion for pre-gen6 a
      tad more robust by mapping everything != CACHE_NONE to the cached agp
      flag - we have a 1:1 uncached mapping, but different modes of
      cacheable (at least on later generations). Suggested by Chris Wilson.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e76e9aeb
    • D
      drm/i915: extract l3_parity substruct from dev_priv · a4da4fa4
      Daniel Vetter 提交于
      Pretty astonishing how far apart these two members landed ... Especially since
      I've already removed almost 200 lines in between.
      Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a4da4fa4
  4. 20 10月, 2012 1 次提交
  5. 17 10月, 2012 1 次提交
  6. 12 10月, 2012 2 次提交
  7. 09 10月, 2012 2 次提交
  8. 08 10月, 2012 1 次提交
    • W
      drm/i915: remove useless BUG_ON which caused a regression in 3.5. · c77d7162
      Willy Tarreau 提交于
      starting an old X server causes a kernel BUG since commit 1b50247a:
      
      ------------[ cut here ]------------
      kernel BUG at drivers/gpu/drm/i915/i915_gem.c:3661!
      invalid opcode: 0000 [#1] SMP
      Modules linked in: snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss uvcvideo
      +videobuf2_core videodev videobuf2_vmalloc videobuf2_memops uhci_hcd ath9k mac80211 snd_hda_codec_realtek ath9k_common microcode
      +ath9k_hw psmouse serio_raw sg ath cfg80211 atl1c lpc_ich mfd_core ehci_hcd snd_hda_intel snd_hda_codec snd_hwdep snd_pcm rtc_cmos
      +snd_timer snd evdev eeepc_laptop snd_page_alloc sparse_keymap
      
      Pid: 2866, comm: X Not tainted 3.5.6-rc1-eeepc #1 ASUSTeK Computer INC. 1005HA/1005HA
      EIP: 0060:[<c12dc291>] EFLAGS: 00013297 CPU: 0
      EIP is at i915_gem_entervt_ioctl+0xf1/0x110
      EAX: f5941df4 EBX: f5940000 ECX: 00000000 EDX: 00020000
      ESI: f5835400 EDI: 00000000 EBP: f51d7e38 ESP: f51d7e20
       DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
      CR0: 8005003b CR2: b760e0a0 CR3: 351b6000 CR4: 000007d0
      DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
      DR6: ffff0ff0 DR7: 00000400
      Process X (pid: 2866, ti=f51d6000 task=f61af8d0 task.ti=f51d6000)
      Stack:
       00000001 00000000 f5835414 f51d7e84 f5835400 f54f85c0 f51d7f10 c12b530b
       00000001 c151b139 c14751b6 c152e030 00000b32 00006459 00000059 0000e200
       00000001 00000000 00006459 c159ddd0 c12dc1a0 ffffffea 00000000 00000000
      Call Trace:
       [<c12b530b>] drm_ioctl+0x2eb/0x440
       [<c12dc1a0>] ? i915_gem_init+0xe0/0xe0
       [<c1052b2b>] ? enqueue_hrtimer+0x1b/0x50
       [<c1053321>] ? __hrtimer_start_range_ns+0x161/0x330
       [<c10530b3>] ? lock_hrtimer_base+0x23/0x50
       [<c1053163>] ? hrtimer_try_to_cancel+0x33/0x70
       [<c12b5020>] ? drm_version+0x90/0x90
       [<c10ca171>] vfs_ioctl+0x31/0x50
       [<c10ca2e4>] do_vfs_ioctl+0x64/0x510
       [<c10535de>] ? hrtimer_nanosleep+0x8e/0x100
       [<c1052c20>] ? update_rmtp+0x80/0x80
       [<c10ca7c9>] sys_ioctl+0x39/0x60
       [<c1433949>] syscall_call+0x7/0xb
      Code: 83 c4 0c 5b 5e 5f 5d c3 c7 44 24 04 2c 05 53 c1 c7 04 24 6f ef 47 c1 e8 6e e0 fd ff c7 83 38 1e 00 00 00 00 00 00 e9 3f ff ff
      +ff <0f> 0b eb fe 0f 0b eb fe 8d b4 26 00 00 00 00 0f 0b eb fe 8d b6
      EIP: [<c12dc291>] i915_gem_entervt_ioctl+0xf1/0x110 SS:ESP 0068:f51d7e20
      ---[ end trace dd332ec083cbd513 ]---
      
      The crash happens here in i915_gem_entervt_ioctl() :
      
          3659          BUG_ON(!list_empty(&dev_priv->mm.active_list));
          3660          BUG_ON(!list_empty(&dev_priv->mm.flushing_list));
       -> 3661          BUG_ON(!list_empty(&dev_priv->mm.inactive_list));
          3662          mutex_unlock(&dev->struct_mutex);
      
      Quoting Chris :
        "That BUG_ON there is silly and can simply be removed. The check is to
         verify that no batches were submitted to the kernel whilst the UMS/GEM
         client was suspended - to which the BUG_ONs are a crude approximation.
         Furthermore, the checks are too late, since it means we attempted to
         program the hardware whilst it was in an invalid state, the BUG_ONs are
         the least of your concerns at that point."
      
      Note that this regression has been introduced in
      
      commit 1b50247a
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Apr 24 15:47:30 2012 +0100
      
          drm/i915: Remove the list of pinned inactive objects
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NWilly Tarreau <w@1wt.eu>
      [danvet: Added note about the regressing commit and cc: stable.]
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      c77d7162
  9. 04 10月, 2012 2 次提交
  10. 03 10月, 2012 2 次提交
  11. 27 9月, 2012 1 次提交
  12. 26 9月, 2012 1 次提交
  13. 20 9月, 2012 6 次提交
  14. 17 9月, 2012 1 次提交
  15. 27 8月, 2012 1 次提交
    • S
      drm/i915: Remove __GFP_NO_KSWAPD · d7c3b937
      Sedat Dilek 提交于
      When I pulled-in today's drm-intel-next into linux-next (next-20120824)
      I saw this build-breakage:
      
      drivers/gpu/drm/i915/i915_gem.c: In function 'i915_gem_object_get_pages_gtt':
      drivers/gpu/drm/i915/i915_gem.c:1778:40: error: '__GFP_NO_KSWAPD' undeclared (first use in this function)
      drivers/gpu/drm/i915/i915_gem.c:1778:40: note: each undeclared identifier is reported only once for each function it appears in
      
      This is caused by commit ba099ef165f8 ("mm: remove __GFP_NO_KSWAPD")
      and commit b6beae2c2014 ("mm: remove __GFP_NO_KSWAPD fixes") in
      linux-next (next-20120824).
      
      Fix this by removing __GFP_NO_KSWAPD from drm/i915 driver.
      Signed-off-by: NSedat Dilek <sedat.dilek@gmail.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d7c3b937
  16. 24 8月, 2012 5 次提交
  17. 21 8月, 2012 1 次提交