1. 18 12月, 2014 3 次提交
  2. 10 12月, 2014 8 次提交
  3. 09 12月, 2014 4 次提交
  4. 27 11月, 2014 2 次提交
    • D
      drm: Handle atomic state properly in kms getfoo ioctl · abd69c55
      Daniel Vetter 提交于
      So the problem with async commit (especially async modeset commit) is
      that the legacy pointers only get updated after the point of no
      return, in the async part of the modeset sequence. At least as
      implemented by the current helper functions. This is done in the
      set_routing_links function in drm_atomic_helper.c.
      
      Which also means that access isn't protected by locks but only
      coordinated by synchronizing with async workers. No problem thus far,
      until we lock at the getconnector/encoder ioctls.
      
      So fix this up by adding special cases for atomic drivers: For those
      we need to look at state objects. Unfortunately digging out the
      correct encoder->crtc link is a bit of work, so wrap this up in a
      helper function.
      
      Moving the assignments of connector->encoder and encoder->crtc earlier
      isn't a good idea because the point of the atomic helpers is that we
      stage the state updates. That way the disable functions can still
      inspect the links and rely upon them.
      
      v2: Extract full encoder->crtc lookup into helper (Rob).
      
      v3: Extract drm_connector_get_encoder too since - we need to always
      return state->best_encoder when there is a state otherwise we might
      return stale data if there's a pending async disable (and chase
      unlocked pointers, too). Same issue with encoder_get_crtc but there
      it's a bit more tricky to handle.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Lightly-Tested-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      abd69c55
    • R
      drm: use mode_object_find helpers · 933f622f
      Rob Clark 提交于
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      933f622f
  5. 25 11月, 2014 1 次提交
  6. 20 11月, 2014 3 次提交
    • D
      drm: s/enum_blob_list/enum_list/ in drm_property · 3758b341
      Daniel Vetter 提交于
      I guess for hysterical raisins this was meant to be the way to read
      blob properties. But that's done with the two-stage approach which
      uses separate blob kms object and the special-purpose get_blob ioctl.
      
      Shipping userspace seems to have never relied on this, and the kernel
      also never put any blob thing onto that property. And nowadays it
      would blow up, e.g. in drm_property_destroy. Also it makes no sense to
      return values in an ioctl that only returns metadata about everything.
      
      So let's ditch all the internal code for the blob list, rename the
      list to be unambiguous and sprinkle comments all over the place to
      explain this peculiar piece of api.
      
      v2: Squash in fixup from Rob to remove now unused variables.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3758b341
    • D
      drm/crtc: Polish kerneldoc · 1a498633
      Daniel Vetter 提交于
      - Make it clear that it's a negative errno (more in line with
        everything else).
      - Clean up the confusion around get_properties vs. getproperty ioctls:
        One reads per-obj property values, the other reads property
        metadata.
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1a498633
    • D
      drm/atomic: Ensure that drm_connector_index is stable · c7eb76f4
      Daniel Vetter 提交于
      I've totally forgotten that with DP MST connectors can now be
      hotplugged. And failed to adapt Rob's drm_atomic_state code (which
      predates connector hotplugging) to the new realities.
      
      The first step is to make sure that the connector indices used to
      access the arrays of pointers are stable. The connection mutex gives
      us enough guarantees for that, which means we won't unecessarily block
      on concurrent modesets or background probing.
      
      So add a locking WARN_ON and shuffle the code slightly to make sure we
      always hold the right lock.
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      c7eb76f4
  7. 15 11月, 2014 2 次提交
  8. 13 11月, 2014 4 次提交
  9. 12 11月, 2014 2 次提交
    • D
      drm: More specific locking for get* ioctls · fcf93f69
      Daniel Vetter 提交于
      Motivated by the per-plane locking I've gone through all the get*
      ioctls and reduced the locking to the bare minimum required.
      
      v2: Rebase and make it compile ...
      
      v3: Review from Sean:
      - Simplify return handling in getplane_res.
      - Add a comment to getplane_res that the plane list is invariant and
        can be walked locklessly.
      
      v4: Actually git add.
      
      Cc: Sean Paul <seanpaul@chromium.org>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      fcf93f69
    • 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
  10. 10 11月, 2014 1 次提交
  11. 01 11月, 2014 1 次提交
  12. 23 10月, 2014 1 次提交
  13. 22 10月, 2014 2 次提交
  14. 21 10月, 2014 1 次提交
  15. 25 9月, 2014 1 次提交
    • D
      drm: Drop grab fpriv->fbs_lock in drm_fb_release · 1b116297
      Daniel Vetter 提交于
      Paulo Zanoni reported a lockdep splat with a locking inversion between
      fpriv->fbs_lock and the modeset locks. This issue was introduced in
      
      commit f2b50c11
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Sep 12 17:07:32 2014 +0200
      
          drm: Fixup locking for universal cursor planes
      
      This here is actually one of the rare cases where lockdep hits a false
      positive: The deadlock only happens in drm_fb_release, which cleans up
      the file private structure when all the references are gone. So the
      locking is the very last one and no one else can deadlock. It also
      doesn't protect anything at all, since all ioctls are guaranteed to
      have returned at this point - otherwise they'd still hold a reference
      on the file.
      
      So let's just drop it and replace it with a big comment.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Paulo Zanoni <przanoni@gmail.com>
      Reported-and-Tested-by: NPaulo Zanoni <przanoni@gmail.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      1b116297
  16. 24 9月, 2014 1 次提交
    • D
      drm: Fixup locking for universal cursor planes · f2b50c11
      Daniel Vetter 提交于
      Bunch of things amiss:
      - Updating crtc->cursor_x/y was done without any locking. Spotted by
        David Herrmann.
      - Dereferencing crtc->cursor->fb was using the wrong lock, should take
        the crtc lock.
      - Grabbing _all_ modeset locks torpedoes the reason why we added
        fine-grained locks originally: Cursor updates shouldn't stall on
        background stuff like probing outputs.
      
      Best is to just grab the crtc lock around everything and drop all the
      other locking. The only issue is that we can't switch planes between
      crtcs with that, so make sure that never happens when someone uses
      universal plane helpers. This shouldn't be a possible regression ever
      since legacy ioctls also only grabbed the crtc lock, so switching
      crtcs was never possible for the underlying plane object. And i915
      (the only user of universal cursors thus far) has fixed cursor->crtc
      links.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Pallavi G<pallavi.g@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Tested-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      f2b50c11
  17. 15 9月, 2014 1 次提交
    • D
      drm: Drop modeset locking from crtc init function · d0fa1af4
      Daniel Vetter 提交于
      At driver init no one can access modeset objects and we're
      single-threaded. So locking is just cargo-culting here. Worse, with
      the new ww mutexes and ww mutex slowpath debugging the mutex_lock
      might actually fail, and we don't have the full-blown ww recovery
      dance.
      
      Which then leads to fireworks when we try to unlock the not-locked
      crtc lock.
      
      An audit of all the functions called from here shows that none of them
      contain locking checks, so there's also no reason to keep the locking
      around just for consistency of caller contexts. Besides that I have
      the rule (at least in i915) that such places where we take locks just
      to simplify locking checks and not for correctness always require a
      comment.
      
      This regression was introduced in
      
      commit 51fd371b
      Author: Rob Clark <robdclark@gmail.com>
      Date:   Tue Nov 19 12:10:12 2013 -0500
      
          drm: convert crtc and connection_mutex to ww_mutex (v5)
      
      v2: Don't drop the lock_init call, spotted by the 0day builder.
      
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=83341
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: thellstrom@vmware.com
      Cc: maarten.lankhorst@canonical.com
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      d0fa1af4
  18. 12 9月, 2014 1 次提交
  19. 28 8月, 2014 1 次提交