1. 19 6月, 2015 1 次提交
  2. 26 5月, 2015 3 次提交
  3. 21 5月, 2015 1 次提交
  4. 18 5月, 2015 1 次提交
  5. 13 5月, 2015 1 次提交
  6. 12 4月, 2015 1 次提交
  7. 07 4月, 2015 1 次提交
  8. 30 3月, 2015 2 次提交
  9. 23 3月, 2015 2 次提交
  10. 10 3月, 2015 2 次提交
  11. 23 2月, 2015 1 次提交
    • D
      drm: Add DRM_DEBUG_ATOMIC · 17a38d9c
      Daniel Vetter 提交于
      Atomic state handling adds a lot of indirection and complexity between
      simple updates and drivers. For easier debugging the diagnostic output
      is therefore rather chatty. Which is great for tracking down atomic
      issues, but really annoying otherwise.
      
      Add a new DRM_DEBUG_ATOMIC to be able to filter this out.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      17a38d9c
  12. 27 1月, 2015 3 次提交
    • A
      drm/atomic: Fix potential use of state after free · 9469244d
      Ander Conselvan de Oliveira 提交于
      The atomic helpers rely on drm_atomic_state_clear() to reset an atomic
      state if a retry is needed due to the w/w mutexes. The subsequent calls
      to drm_atomic_get_{crtc,plane,...}_state() would then return the stale
      pointers in state->{crtc,plane,...}_states.
      Signed-off-by: NAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      9469244d
    • D
      drm/atomic: Add drm_crtc_state->active · eab3bbef
      Daniel Vetter 提交于
      This is the infrastructure for DPMS ported to the atomic world.
      Fundamental changes compare to legacy DPMS are:
      
      - No more per-connector dpms state, instead there's just one per each
        display pipeline. So if you clone either you have to unclone first
        if you only want to switch off one screen, or you just switch of
        everything (like all desktops do). This massively reduces complexity
        for cloning since now there's no more half-enabled cloned configs to
        consider.
      
      - Only on/off, dpms standby/suspend are as dead as real CRTs. Again
        reduces complexity a lot.
      
      Now especially for backwards compat the really important part for dpms
      support is that dpms on always succeeds (except for hw death and
      unplugged cables ofc). Which means everything that could fail (like
      configuration checking, resources assignments and buffer management)
      must be done irrespective from ->active. ->active is really only a
      toggle to change the hardware state. More precisely:
      
      - Drivers MUST NOT look at ->active in their ->atomic_check callbacks.
        Changes to ->active MUST always suceed if nothing else changes.
      
      - Drivers using the atomic helpers MUST NOT look at ->active anywhere,
        period. The helpers will take care of calling the respective
        enable/modeset/disable hooks as necessary. As before the helpers
        will carefully keep track of the state and not call any hooks
        unecessarily, so still no double-disables or enables like with crtc
        helpers.
      
      - ->mode_set hooks are only called when the mode or output
        configuration changes, not for changes in ->active state.
      
      - Drivers which reconstruct the state objects in their ->reset hooks
        or through some other hw state readout infrastructure must ensure
        that ->active reflects actual hw state.
      
      This just implements the core bits and helper logic, a subsequent
      patch will implement the helper code to implement legacy dpms with
      this.
      
      v2: Rebase on top of the drm ioctl work:
      - Move crtc checks to the core check function.
      - Also check for ->active_changed when deciding whether a modeset
        might happen (for the ALLOW_MODESET mode).
      - Expose the ->active state with an atomic prop.
      
      v3: Review from Rob
      - Spelling fix in comment.
      - Extract needs_modeset helper to consolidate the ->mode_changed ||
        ->active_changed checks.
      
      v4: Fixup fumble between crtc->state and crtc_state.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Tested-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      eab3bbef
    • M
      drm: Add rotation value to plane state · 1da30627
      Matt Roper 提交于
      The rotation property is shared by multiple drivers, so it makes sense
      to store the rotation value (for atomic-converted drivers) in the common
      plane state so that core code can eventually access it as well.
      
      Cc: dri-devel@lists.freedesktop.org
      Suggested-by: NDaniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      1da30627
  13. 21 1月, 2015 1 次提交
  14. 05 1月, 2015 6 次提交
  15. 19 12月, 2014 2 次提交
  16. 18 12月, 2014 1 次提交
    • D
      drm/atomic: Introduce state->obj backpointers · 07cc0ef6
      Daniel Vetter 提交于
      Useful since this way we can pass around just the state objects and
      will get ther real object, too.
      
      Specifically this allows us to again simplify the parameters for
      set_crtc_for_plane.
      
      v2: msm already has it's own specific plane_reset hook, don't forget
      that one!
      
      v3: Fixup kerneldoc, reported by 0-day builder.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: Rob Clark <robdclark@gmail.com> (v2)
      Tested-by: Rob Clark <robdclark@gmail.com> (v2)
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      07cc0ef6
  17. 27 11月, 2014 1 次提交
    • R
      drm/atomic: track bitmask of planes attached to crtc · 6ddd388a
      Rob Clark 提交于
      Chasing plane->state->crtc of planes that are *not* part of the same
      atomic update is racy, making it incredibly awkward (or impossible) to
      do something simple like iterate over all planes and figure out which
      ones are attached to a crtc.
      
      Solve this by adding a bitmask of currently attached planes in the
      crtc-state.
      
      Note that the transitional helpers do not maintain the plane_mask.  But
      they only support the legacy ioctls, which have sufficient brute-force
      locking around plane updates that they can continue to loop over all
      planes to see what is attached to a crtc the old way.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      [danvet:
      - Drop comments about locking in set_crtc_for_plane since they're a
        bit misleading - we already should hold lock for the current crtc.
      - Also WARN_ON if get_state on the old crtc fails since that should
        have been done already.
      - Squash in fixup to check get_plane_state return value, reported by
        Dan Carpenter and acked by Rob Clark.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      6ddd388a
  18. 25 11月, 2014 1 次提交
  19. 21 11月, 2014 1 次提交
  20. 20 11月, 2014 3 次提交
  21. 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
  22. 07 11月, 2014 1 次提交
    • D
      drm/atomic: Refcounting for plane_state->fb · 321ebf04
      Daniel Vetter 提交于
      So my original plan was that the drm core refcounts framebuffers like
      with the legacy ioctls. But that doesn't work for a bunch of reasons:
      
      - State objects might live longer than until the next fb change
        happens for a plane. For example delayed cleanup work only happens
        _after_ the pageflip ioctl has completed. So this definitely doesn't
        work without the plane state holding its own references.
      
      - The other issue is transition from legacy to atomic implementations,
        where the driver works under a mix of both worlds. Which means
        legacy paths might not properly update the ->fb pointer under
        plane->state->fb. Which is a bit a problem when then someone comes
        around and _does_ try to clean it up when it's long gone.
      
      The second issue is just a bit a transition bug, since drivers should
      update plane->state->fb in all the paths that aren't converted yet.
      But a bit more robustness for the transition can't hurt - we pull
      similar tricks with cleaning up the old fb in the transitional helpers
      already.
      
      The pattern for drivers that transition is
      
      	if (plane->state)
      		drm_atomic_set_fb_for_plane(plane->state, plane->fb);
      
      inserted after the fb update has logically completed at the end of
      ->set_config (or ->set_base/mode_set if using the crtc helpers),
      ->page_flip, ->update_plane or any other entry point which updates
      plane->fb.
      
      v2: Update kerneldoc - copypasta fail.
      
      v3: Fix spelling in the commit message (Sean).
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      321ebf04
  23. 06 11月, 2014 1 次提交
    • D
      drm: Global atomic state handling · cc4ceb48
      Daniel Vetter 提交于
      Some differences compared to Rob's patches again:
      - Dropped the committed and checked booleans. Checking will be
        internally enforced by always calling ->atomic_check before
        ->atomic_commit. And async handling needs to be solved differently
        because the current scheme completely side-steps ww mutex deadlock
        avoidance (and so either reinvents a new deadlock avoidance wheel or
        like the current code just deadlocks).
      
      - State for connectors needed to be added, since now they have a
        full-blown drm_connector_state (so that drivers have something to
        attach their own stuff to).
      
      - Refcounting is gone. I plane to solve async updates differently,
        since the lock-passing scheme doesn't cut it (since it abuses ww
        mutexes). Essentially what we need for async is a simple ownership
        transfer from the caller to the driver. That doesn't need full-blown
        refcounting.
      
      - The acquire ctx is a pointer. Real atomic callers should have that
        on their stack, legacy entry points need to put the right one
        (obtained by drm_modeset_legacy_acuire_ctx) in there.
      
      - I've dropped all hooks except check/commit. All the begin/end
        handling is done by core functions and is the same.
      
      - commit/check are just thin wrappers that ensure that ->check is
        always called.
      
      - To help out with locking in the legacy implementations I've added a
        helper to just grab all locks in the backoff case.
      
      v2: Add notices that check/commit can fail with EDEADLK.
      
      v3:
      - More consistent naming for state_alloc.
      - Add state_clear which is needed for backoff and retry.
      
      v4: Planes/connectors can switch between crtcs, and we need to be
      careful that we grab the state (and locks) for both the old and new
      crtc. Improve the interface functions to ensure this.
      
      v5: Add functions to grab affected connectors for a crtc and to recompute
      the crtc->enable state. This is useful for both helper and atomic ioctl
      code when e.g. removing a connector.
      
      v6: Squash in fixup from Fengguang to use ERR_CAST.
      
      v7: Add debug output.
      
      v8: Make checkpatch happy about kcalloc argument ordering.
      
      v9: Improve kerneldoc in drm_crtc.h
      
      v10:
      - Fix another kcalloc argument misorder I've missed.
      - More polish for kerneldoc.
      
      v11: Clarify the ownership rules for the state object. The new rule is
      that a successful drm_atomic_commit (whether synchronous or asnyc)
      always inherits the state and is responsible for the clean-up. That
      way async and sync ->commit functions are more similar.
      
      v12: A few bugfixes:
      - Assign state->state pointers correctly when grabbing state objects -
        we need to link them up with the global state.
      - Handle a NULL crtc in set_crtc_for_plane to simplify code flow a bit
        for the callers of this function.
      
      v13: Review from Sean:
      - kerneldoc spelling fixes
      - Don't overallocate states->planes.
      - Handle NULL crtc in set_crtc_for_connector.
      
      v14: Sprinkle __must_check over all functions which do wait/wound
      locking to make sure callers don't forget this. Since I have ;-)
      
      v15: Be more explicit in the kerneldoc when functions can return
      -EDEADLK what to do. And that every other -errno is fatal.
      
      v16: Indent with tabs instead of space, spotted by Ander.
      
      v17: Review from Thierry, small kerneldoc and other naming polish.
      
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Ander Conselvan de Oliveira <conselvan2@gmail.com>
      Cc: Daniel Thompson <daniel.thompson@linaro.org>
      Cc: Fengguang Wu <fengguang.wu@intel.com>
      Cc: Sean Paul <seanpaul@chromium.org>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      cc4ceb48