1. 18 12月, 2014 1 次提交
  2. 10 12月, 2014 1 次提交
  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 次提交
  20. 20 8月, 2014 1 次提交
    • T
      drm: fix plane rotation when restoring fbdev configuration · 3a5f87c2
      Thomas Wood 提交于
      Make sure plane rotation is reset correctly when restoring the fbdev
      configuration by using drm_mode_plane_set_obj_prop which calls the
      driver's set_property callback.
      
      The rotation reset feature was introduced in commit 9783de20 (drm:
      Resetting rotation property) and the callback issue was originally
      addressed in a previous version of the patch, but the fix was not
      present in the final version.
      
      v2: Fix documentation warning
          Add some more details to the commit message (Daniel Vetter)
      
      Testcase: igt/kms_rotation_crc
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82236
      Cc: Sonika Jindal <sonika.jindal@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThomas Wood <thomas.wood@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3a5f87c2
  21. 15 8月, 2014 1 次提交
    • D
      drm: Docbook fixes · 295ee853
      Daniel Vetter 提交于
      Bunch of small leftovers spotted by looking at the make htmldocs output.
      
      I've left out dp mst, there's too much amiss there.
      
      v2: Also add the missing parameter docbook in the dp mst code - Dave
      Airlie correctly pointed out that we don't actually want kerneldoc for
      the missing structure members in header files.
      
      Cc: Dave Airlie <airlied@gmail.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      295ee853
  22. 11 8月, 2014 1 次提交
    • D
      drm: Add a plane->reset hook · 2a0d7cfd
      Daniel Vetter 提交于
      In general having this can't hurt, and the atomic helpers will need
      it to be able to reset the state objects properly. The overall idea
      is to reset in the order pixels flow, so planes -> crtcs ->
      encoders -> connectors.
      
      v2: Squash in fixup from Ville to correctly deference struct drm_plane
      instead of drm_crtc when walking the plane list. Fixes an oops in
      driver init and resume.
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2a0d7cfd
  23. 08 8月, 2014 5 次提交
    • D
      drm: Move ->old_fb from crtc to plane · 3d30a59b
      Daniel Vetter 提交于
      Atomic implemenations for legacy ioctls must be able to drop locks.
      Which doesn't cause havoc since we only do that while constructing
      the new state, so no driver or hardware state change has happened.
      
      The only troubling bit is the fb refcounting the core does - if
      someone else has snuck in then it might potentially unref an
      outdated framebuffer. To fix that move the old_fb temporary storage
      into struct drm_plane for all ioctls, so that the atomic helpers can
      update it.
      
      v2: Fix up the error case handling as suggested by Matt Roper and just
      grab locks uncoditionally - there's no point in optimizing the locking
      for when userspace gets it wrong.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      3d30a59b
    • D
      drm: Handle legacy per-crtc locking with full acquire ctx · d059f652
      Daniel Vetter 提交于
      So drivers using the atomic interfaces expect that they can acquire
      additional locks internal to the driver as-needed. Examples would be
      locks to protect shared state like shared display PLLs.
      
      Unfortunately the legacy ioctls assume that all locking is fully done
      by the drm core. Now for those paths which grab all locks we already
      have to keep around an acquire context in dev->mode_config. Helper
      functions that implement legacy interfaces in terms of atomic support
      can therefore grab this acquire contexts and reuse it.
      
      The only interfaces left are the cursor and pageflip ioctls. So add
      functions to grab the crtc lock these need using an acquire context
      and preserve it for atomic drivers to reuse.
      
      v2:
      - Fixup comments&kerneldoc.
      - Drop the WARNING from modeset_lock_all_crtcs since that can be used
        in legacy paths with crtc locking.
      
      v3: Fix a type on the kerneldoc Dave spotted.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      d059f652
    • D
      drm: Move modeset_lock_all helpers to drm_modeset_lock.[hc] · a6a8bb84
      Daniel Vetter 提交于
      Somehow we've forgotten about this little bit of OCD.
      Reviewed-by: NDave Airlie <airlied@redhat.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      a6a8bb84
    • D
      drm: Add drm_plane/connector_index · 10f637bf
      Daniel Vetter 提交于
      In the atomic state we'll have an array of states for crtcs, planes
      and connectors and need to be able to at them by their index. We
      already have a drm_crtc_index function so add the missing ones for
      planes and connectors.
      
      If it later on turns out that the list walking is too expensive we can
      add the index to the relevant modeset objects.
      
      Rob Clark doesn't like the loops too much, but we can always add an
      obj->idx parameter later on. And for now reiterating is actually safer
      since nowadays we have hotpluggable connectors (thanks to DP MST).
      
      v2: Fix embarrassing copypasta fail in kerneldoc and header
      declarations, spotted by Matt Roper.
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      10f637bf
    • D
      Revert "drm: drop redundant drm_file->is_master" · 7963e9db
      Dave Airlie 提交于
      This reverts commit 48ba8137.
      
      Thanks to Chris:
      "drm_file->is_master is not synomous with having drm_file->master ==
      drm_file->minor->master. This is because drm_file->master is the same
      for all drm_files of the same generation and so when there is a master,
      every drm_file believes itself to be the master. Confusion ensues and
      things go pear shaped when one file is closed and there is no master
      anymore."
      
      Conflicts:
      	drivers/gpu/drm/drm_drv.c
      	drivers/gpu/drm/drm_stub.c
      7963e9db
  24. 06 8月, 2014 1 次提交
    • C
      drm: Perform cmdline mode parsing during connector initialisation · eaf99c74
      Chris Wilson 提交于
      i915.ko has a custom fbdev initialisation routine that aims to preserve
      the current mode set by the BIOS, unless overruled by the user. The
      user's wishes are determined by what, if any, mode is specified on the
      command line (via the video= parameter). However, that command line mode
      is first parsed by drm_fb_helper_initial_config() which is called after
      i915.ko's custom initial_config() as a fallback method. So in order for
      us to honour it, we need to move the cmdline parser earlier. If we
      perform the connector cmdline parsing as soon as we initialise the
      connector, that cmdline mode and forced status is then available even if
      the fbdev helper is not compiled in or never called.
      
      We also then expose the cmdline user mode in the connector mode lists.
      
      v2: Rebase after connector->name upheaval.
      
      v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely
      simplifies things while at that.
      
      v4: Fix checkpatch.
      
      v5: Select FB_CMDLINE to adapt to the changed fbdev patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eaf99c74