1. 05 8月, 2015 14 次提交
  2. 12 3月, 2015 1 次提交
  3. 19 1月, 2015 1 次提交
    • T
      drm/vmwgfx: Replace the hw mutex with a hw spinlock · 496eb6fd
      Thomas Hellstrom 提交于
      Fixes a case where we call vmw_fifo_idle() from within a wait function with
      task state !TASK_RUNNING, which is illegal.
      
      In addition, make the locking fine-grained, so that it is performed once
      for every read- and write operation. This is of course more costly, but we
      don't perform much register access in the timing critical paths anyway. Instead
      we have the extra benefit of being sure that we don't forget the hw lock around
      register accesses. I think currently the kms code was quite buggy w r t this.
      
      This fixes Red Hat Bugzilla Bug 1180796
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      Reviewed-by: NJakob Bornecrantz <jakob@vmware.com>
      496eb6fd
  4. 12 11月, 2014 1 次提交
    • D
      drm: Per-plane locking · 4d02e2de
      Daniel Vetter 提交于
      Turned out to be much simpler on top of my latest atomic stuff than
      what I've feared. Some details:
      
      - Drop the modeset_lock_all snakeoil in drm_plane_init. Same
        justification as for the equivalent change in drm_crtc_init done in
      
      	commit d0fa1af4
      	Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      	Date:   Mon Sep 8 09:02:49 2014 +0200
      
      	    drm: Drop modeset locking from crtc init function
      
        Without these the drm_modeset_lock_init would fall over the exact
        same way.
      
      - Since the atomic core code wraps the locking switching it to
        per-plane locks was a one-line change.
      
      - For the legacy ioctls add a plane argument to the locking helper so
        that we can grab the right plane lock (cursor or primary). Since the
        universal cursor plane might not be there, or someone really crazy
        might forgoe the primary plane even accept NULL.
      
      - Add some locking WARN_ON to the atomic helpers for good paranoid
        measure and to check that it all works out.
      
      Tested on my exynos atomic hackfest with full lockdep checks and ww
      backoff injection.
      
      v2: I've forgotten about the load-detect code in i915.
      
      v3: Thierry reported that in latest 3.18-rc vmwgfx doesn't compile any
      more due to
      
      commit 21e88620
      Author: Rob Clark <robdclark@gmail.com>
      Date:   Thu Oct 30 13:39:04 2014 -0400
      
          drm/vmwgfx: fix lock breakage
      
      Rebased and fix this up.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4d02e2de
  5. 31 10月, 2014 2 次提交
  6. 22 7月, 2014 1 次提交
  7. 18 7月, 2014 1 次提交
  8. 19 6月, 2014 1 次提交
  9. 05 6月, 2014 1 次提交
    • R
      drm: convert crtc and connection_mutex to ww_mutex (v5) · 51fd371b
      Rob Clark 提交于
      For atomic, it will be quite necessary to not need to care so much
      about locking order.  And 'state' gives us a convenient place to stash a
      ww_ctx for any sort of update that needs to grab multiple crtc locks.
      
      Because we will want to eventually make locking even more fine grained
      (giving locks to planes, connectors, etc), split out drm_modeset_lock
      and drm_modeset_acquire_ctx to track acquired locks.
      
      Atomic will use this to keep track of which locks have been acquired
      in a transaction.
      
      v1: original
      v2: remove a few things not needed until atomic, for now
      v3: update for v3 of connection_mutex patch..
      v4: squash in docbook
      v5: doc tweaks/fixes
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      51fd371b
  10. 01 5月, 2014 1 次提交
  11. 02 4月, 2014 1 次提交
    • M
      drm: Replace crtc fb with primary plane fb (v3) · f4510a27
      Matt Roper 提交于
      Now that CRTC's have a primary plane, there's no need to track the
      framebuffer in the CRTC.  Replace all references to the CRTC fb with the
      primary plane's fb.
      
      This patch was generated by the Coccinelle semantic patching tool using
      the following rules:
      
              @@ struct drm_crtc C; @@
              -   (C).fb
              +   C.primary->fb
      
              @@ struct drm_crtc *C; @@
              -   (C)->fb
              +   C->primary->fb
      
      v3: Generate patch via coccinelle.  Actual removal of crtc->fb has been
          moved to a subsequent patch.
      
      v2: Fixup several lingering crtc->fb instances that were missed in the
          first patch iteration.  [Rob Clark]
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      f4510a27
  12. 28 3月, 2014 1 次提交
  13. 17 1月, 2014 2 次提交
  14. 08 1月, 2014 1 次提交
    • R
      drivers: gpu: Mark functions as static in vmwgfx_kms.c · 847c5964
      Rashika Kheria 提交于
      Mark functions as static because they are not used outside the file
      drm/vmwgfx/vmwgfx_kms.c.
      
      This eliminates the following warnings in drm/vmwgfx/vmwgfx_kms.c:
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:43:6: warning: no previous prototype for ‘vmw_clip_cliprects’ [-Wmissing-prototypes]
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:426:6: warning: no previous prototype for ‘vmw_framebuffer_surface_destroy’ [-Wmissing-prototypes]
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:592:5: warning: no previous prototype for ‘vmw_framebuffer_surface_dirty’ [-Wmissing-prototypes]
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:757:6: warning: no previous prototype for ‘vmw_framebuffer_dmabuf_destroy’ [-Wmissing-prototypes]
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:943:5: warning: no previous prototype for ‘vmw_framebuffer_dmabuf_dirty’ [-Wmissing-prototypes]
      drivers/gpu/drm/vmwgfx/vmwgfx_kms.c:1666:5: warning: no previous prototype for ‘vmw_du_update_layout’ [-Wmissing-prototypes]
      Signed-off-by: NRashika Kheria <rashika.kheria@gmail.com>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Reviewed-by: NJakob Bornecrantz <jakob@vmware.com>
      847c5964
  15. 18 12月, 2013 1 次提交
  16. 05 12月, 2013 1 次提交
  17. 06 11月, 2013 1 次提交
  18. 30 8月, 2013 1 次提交
  19. 11 6月, 2013 1 次提交
  20. 21 1月, 2013 2 次提交
    • D
      drm: only take the crtc lock for ->cursor_move · dac35663
      Daniel Vetter 提交于
      ->cursor_move uses mostly the same facilities in drivers as
      ->cursor_set, so pretty much nothing to fix up:
      
      - ast/gma500/i915: They all use per-crtc registers to update the
        cursor position. ast again touches the global cursor cache, but
        that's ok since there's only one crtc.
      
      - nouveau: nv50+ is again special, updates happen through the per-crtc
        channel (without pushbufs), so it's not protected by the new evo
        lock introduced earlier. But since this channel is per-crtc, we
        should be fine anyway.
      
      - radeon: A bit a mess: avivo asics need a workaround when both output
        pipes are enabled, which means it'll access the crtc list. Just
        reading that flag is ok though as long as radeon _always_ grabs all
        locks when changing the crtc configuration. Which means with the
        current scheme it cannot do an optimized modeset which only locks
        the relevant crtcs. This can be fixed though by introducing a bit of
        global state with separate locks and ensure in the modeset code that
        the cursor will be updated appropriately when enabling the 2nd pipe
        (on affected asics).
      
      - vmwgfx: I still don't understand what it's doing exactly, so apply
        the same trick for now.
      
      v2: Fixup unlocking for the error cases, spotted by Richard Wilbur.
      
      v3: Another error-case fixup.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      dac35663
    • D
      drm: only take the crtc lock for ->cursor_set · bfb89928
      Daniel Vetter 提交于
      First convert ->cursor_set to only take the crtc lock, since that
      seems to be the function with the least amount of state - the core
      ioctl function doesn't check anything which can change at runtime, so
      we don't have any object lifetime issues to contend.
      
      The only thing which is important is that the driver's implementation
      doesn't touch any state outside of that single crtc which is not yet
      properly protected by other locking:
      
      - ast: access the global ast->cache_kmap. Luckily we only have on crtc
        on this driver, so this is fine. Add a comment.
      
      - gma500: calls gma_power_begin|and and psb_gtt_pin|unpin, both which
        have their own locking to protect their state. Everything else is
        crtc-local.
      
      - i915: touches a bit of global gem state, all protected by the One
        Lock to Rule Them All (dev->struct_mutex).
      
      - nouveau: Pre-nv50 is all nice, nv50+ uses the evo channels to queue
        up all display changes. And some of these channels are device
        global. But this is fine now since the previous patch introduced an
        evo channel mutex.
      
      - radeon: Uses some indirect register access for cursor updates, but
        with the previous patches to protect these indirect 2-register
        access patterns with a spinlock, this should be fine now, too.
      
      - vmwgfx: I have no idea how that works - update_cursor_position
        doesn't take any per-crtc argument and I haven't figured out any
        other place where this could be set in some form of a side-channel.
        But vmwgfx definitely has more than one crtc (or at least can
        register more than one), so I have no idea how this is supposed to
        not fail with the current code already. Hence take the easy way out
        and simply acquire all locks (which requires dropping the crtc lock
        the core acquired for us). That way it's not worse off for
        consistency than the old code.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      bfb89928
  21. 20 1月, 2013 2 次提交
    • D
      drm/<drivers>: Unified handling of unimplemented fb->create_handle · af26ef3b
      Daniel Vetter 提交于
      Some drivers don't have real ->create_handle callbacks.
      
      - cirrus/ast/mga200: Returns either 0 or -EINVAL.
      
      - udl: Didn't even bother with a callback, leading to a nice
        userspace-triggerable OOPS.
      
      - vmwgfx: This driver bothered with an implementation to return 0 as
        the handle (which is the canonical no-obj gem handle).
      
      All have in common that ->create_handle doesn't really make too much
      sense for them - that ioctl is used only for seamless fb takeover in
      the radeon/nouveau/i915 ddx drivers. So allow drivers to not implement
      this and return a consistent -ENODEV.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      af26ef3b
    • D
      drm/vmwgfx: reorder framebuffer init sequence · 80f0b5af
      Daniel Vetter 提交于
      vmwgfx has an oddity, when failing to reference the surface it'll
      return 0, since that's what the successfull drm_framebuffer_init will
      leave behind in ret. Fix this up by returning -EINVAL.
      
      Split out from all the other driver updates due to the above tiny
      semantic change. Shouldn't matter though since the reference grabbing
      seemingly can't fail.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      80f0b5af
  22. 13 9月, 2012 1 次提交
  23. 22 8月, 2012 1 次提交