1. 13 5月, 2015 2 次提交
  2. 04 5月, 2015 1 次提交
  3. 16 4月, 2015 1 次提交
  4. 12 4月, 2015 1 次提交
  5. 03 4月, 2015 1 次提交
    • T
      drm/atomic: Add helpers for state-subclassing drivers · f5e7840b
      Thierry Reding 提交于
      Drivers that subclass CRTC, plane or connector state need to carefully
      duplicate the code that the atomic helpers have. This is bound to cause
      breakage eventually because it requires auditing all drivers and update
      them when code is added to the helpers.
      
      In order to avoid that, implement new helpers that perform the required
      steps when copying and destroying state. These new helpers are exported
      so that state-subclassing drivers can use them. The default helpers are
      implemented using them as well, providing a single location that needs
      to be changed when adding to base atomic states.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NEric Anholt <eric@anholt.net>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      f5e7840b
  6. 27 3月, 2015 1 次提交
    • D
      drm/atomic-helpers: Properly avoid full modeset dance · 4218a32f
      Daniel Vetter 提交于
      Legacy setCrtc has a nice fastpath for just updating the frontbuffer
      when the output routing doesn't change. Which I of course tried to
      keep working, except that I fumbled the job: The helpers correctly
      compute ->mode_changed, CRTC updates get correctly skipped but
      connector functions are called unconditionally.
      
      Fix this.
      
      v2: For the disable sided connector->state->crtc might be NULL.
      Instead look at the old_connector_state->crtc, but still use the new
      crtc state for that old crtc. Reported by Thierry.
      Reported-and-Tested-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      4218a32f
  7. 17 3月, 2015 2 次提交
  8. 11 3月, 2015 1 次提交
  9. 10 3月, 2015 1 次提交
  10. 05 3月, 2015 1 次提交
  11. 24 2月, 2015 2 次提交
  12. 23 2月, 2015 3 次提交
  13. 27 1月, 2015 8 次提交
    • T
      drm/atomic: Add ->atomic_check() to encoder helpers · 4cd4df80
      Thierry Reding 提交于
      This callback can be used instead of the legacy ->mode_fixup() and is
      passed the CRTC and connector states. It can thus use these states to
      validate the modeset and cache values in the state to be used during
      the actual modeset.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      4cd4df80
    • T
      drm/plane: Add optional ->atomic_disable() callback · 407b8bd9
      Thierry Reding 提交于
      In order to prevent drivers from having to perform the same checks over
      and over again, add an optional ->atomic_disable callback which the core
      calls under the right circumstances.
      
      v2: pass old state and detect edges to avoid calling ->atomic_disable on
      already disabled planes, remove redundant comment (Daniel Vetter)
      
      v3: rename helper to drm_atomic_plane_disabling() to clarify that it is
      checking for transitions, move helper to drm_atomic_helper.h, clarify
      check for !old_state and its relation to transitional helpers
      
      Here's an extract from some discussion rationalizing the behaviour (for
      a full version, see the reference below):
      
          > > Hm, thinking about this some more this will result in a slight difference
          > > in behaviour, at least when drivers just use the helper ->reset functions
          > > but don't disable everything:
          > > - With transitional helpers we assume we know nothing and call
          > >   ->atomic_disable.
          > > - With atomic old_state->crtc == NULL in the same situation right after
          > >   boot-up, but we asssume the plane is really off and _dont_ call
          > >   ->atomic_disable.
          > >
          > > Should we instead check for (old_state && old_state->crtc) and state that
          > > drivers need to make sure they don't have stuff hanging around?
          >
          > I don't think we can check for old_state because otherwise this will
          > always return false, whereas we really want it to force-disable planes
          > that could be on (lacking any more accurate information). For
          > transitional helpers anyway.
          >
          > For the atomic helpers, old_state will never be NULL, but I'd assume
          > that the driver would reconstruct the current state in ->reset().
      
          By the way, the reason for why old_state can be NULL with transitional
          helpers is the ordering of the steps in the atomic transition. Currently
          the Tegra patches do this (based on your blog post and the Exynos proto-
          type):
      
              1) atomic conversion, phase 1:
                 - implement ->atomic_{check,update,disable}()
                 - use drm_plane_helper_{update,disable}()
      
              2) atomic conversion, phase 2:
                 - call drm_mode_config_reset() from ->load()
                 - implement ->reset()
      
          That's only a partial list of what's done in these steps, but that's the
          only relevant pieces for why old_state is NULL.
      
          What happens is that without ->reset() implemented there won't be any
          initial state, hence plane->state (the old_state here) will be NULL the
          first time atomic state is applied.
      
          We could of course reorder the sequence such that drivers are required
          to hook up ->reset() before they can (or at the same as they) hook up
          the transitional helpers. We could add an appropriate WARN_ON to this
          helper to make that more obvious.
      
          However, that will not solve the problem because it only gets rid of the
          special case. We still don't know whether old_state->crtc == NULL is the
          current state or just the initial default.
      
          So no matter which way we do this, I don't see a way to get away without
          requiring specific semantics from drivers. They would be that:
      
              - drivers recreate the correct state in ->reset() so that
                old_state->crtc != NULL if the plane is really enabled
      
          or
      
              - drivers have to ensure that the real state in fact mirrors the
                initial default as encoded in the state (plane disabled)
      
      References: http://lists.freedesktop.org/archives/dri-devel/2015-January/075578.htmlReviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NGustavo Padovan <gustavo.padovan@collabora.co.uk>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      407b8bd9
    • T
      drm/plane: Make ->atomic_update() mandatory · 3cad4b68
      Thierry Reding 提交于
      There is no use-case where it would be useful for drivers not to
      implement this function and the transitional plane helpers already
      require drivers to provide an implementation.
      
      v2: add new requirement to kerneldoc
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      3cad4b68
    • D
      drm/atomic-helper: debug output for modesets · 95d6eb3b
      Daniel Vetter 提交于
      With the combination of ->enable and ->active it's a bit complicated
      to follow what exactly is going on sometimes within a full modeset.
      Add debug output to make this all traceable.
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      95d6eb3b
    • D
      drm/atomic-helpers: Saner encoder/crtc callbacks · ee0a89cf
      Daniel Vetter 提交于
      For historical reasons going all the way back to how the Xrandr code
      was implemented the semantics of the callbacks used to enable/disable
      crtcs and encoders are ... interesting.
      
      But with atomic helpers all that complexity has been binned, with only
      a well-defined on/off action left. Unfortunately the names stuck.
      
      Let's fix that by adding enable/disable hooks every, make them the
      preferred variant for atomic and update documentations.
      
      Later on we add debug warnings when drivers have deprecated hooks. But
      while everything is in-flight with lots of drivers converting to
      atomic that's a bit too much - better wait for things to settle a bit
      first.
      
      v2: Fix kerneldoc, reported by Wu Fengguang.
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      ee0a89cf
    • D
      drm/atomic-helpers: Recover full cursor plane behaviour · f02ad907
      Daniel Vetter 提交于
      Cursor plane updates have historically been fully async and mutliple
      updates batched together for the next vsync. And userspace relies upon
      that. Since implementing a full queue of async atomic updates is a bit
      of work lets just recover the cursor specific behaviour with a hint
      flag and some hacks to drop the vblank wait.
      
      v2: Fix kerneldoc, reported by Wu Fengguang.
      Reviewed-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      f02ad907
    • D
      drm/atomic-helper: add connector->dpms() implementation · b486e0e6
      Daniel Vetter 提交于
      This builds on top of the crtc->active infrastructure to implement
      legacy DPMS. My choice of semantics is somewhat arbitrary, but the
      entire pipe is enabled as along as one output is still enabled.
      
      Of course it also clamps everything that's not ON to OFF.
      
      v2: Fix spelling in one comment.
      
      v3: Don't do an async commit (Thierry)
      
      v4: Dan Carpenter noticed missing error case handling.
      
      Cc: Thierry Reding <thierry.reding@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>
      b486e0e6
    • 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
  14. 05 1月, 2015 1 次提交
  15. 19 12月, 2014 1 次提交
  16. 18 12月, 2014 4 次提交
    • 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
    • D
      drm/atomic-helper: Again check modeset *before* plane states · b4274fbe
      Daniel Vetter 提交于
      This essentially reverts
      
      commit 934ce1c2
      Author: Rob Clark <robdclark@gmail.com>
      Date:   Wed Nov 19 16:41:33 2014 -0500
      
          drm/atomic: check mode_changed *after* atomic_check
      
      Depending upon the driver both orders (or maybe even interleaving) is
      required:
      - If ->atomic_check updates ->mode_changed then helper_check_modeset
        must be run afters.
      - If ->atomic_check depends upon accurate adjusted dotclock values for
        e.g. watermarks, then helper_check_modeset must be run first.
      
      The failure mode in the first case is usually a totally angry hw
      because the pixel format switching doesn't happen. The failure mode in
      the later case is usually nothing, since in most cases the old
      adjusted mode from the previous modeset wont be too far off to be a
      problem. So just underruns and perhaps even just suboptimal (from a
      power consumption) watermarks.
      
      Furthermore in the transitional helpers we only call ->atomic_check
      after the new modeset state has been fully set up (and hence
      computed).
      
      Given that asymmetry in expected failure modes I think it's safer to
      go back to the older order. So do that and give msm a special check
      function to compensate.
      
      Also update kerneldoc to explain this a bit.
      
      v2: Actually add the missing hunk Rob spotted.
      
      v3: Move msm_atomic_check into msm_atomic.c, requested by Rob.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Tested-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      b4274fbe
    • D
      drm/atomic-helper: Export both plane and modeset check helpers · d9b13620
      Daniel Vetter 提交于
      The default call sequence for these two parts won't fit for all
      drivers. So export the two pieces and explain with a bit of kerneldoc
      when each should be called.
      
      v2: Squash in fixup from Rob to actually add the newly exported
      functions to headers
      
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      d9b13620
    • R
      drm/atomic: fix potential null ptr on plane enable · 4b08eae5
      Rob Clark 提交于
      When a plane is being enabled, plane->crtc has not been set yet.  Use
      plane->state->crtc.
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NSean Paul <seanpaul@chromium.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      4b08eae5
  17. 27 11月, 2014 2 次提交
    • R
      drm/atomic: clear plane's CRTC and FB when shutting down · e5b5341c
      Rob Clark 提交于
      Otherwise we'd still end up w/ the plane attached to the CRTC, and
      seemingly active, but without an FB.  Which ends up going *boom*
      in the drivers.
      
      Slightly modified version of Daniel's irc suggestion.
      
      Note that the big problem isn't drivers going *boom* here (since we
      already have the situation of planes being left enabled when the crtc
      goes down). The real issue is that the core assumes the primary plane
      always goes down when calling ->set_config with a NULL mode. Ignoring
      that assumption leads to the legacy state pointers plane->fb/crtc
      getting out of sync with atomic, and that then leads to the subsequent
      *boom* all over the place.
      
      CC: Daniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NRob Clark <robdclark@gmail.com>
      [danvet: Drop my opinion of what's going sidewides here into the
      commit message as a note.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      e5b5341c
    • 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 3 次提交
    • T
      drm/plane: Pass old state to ->atomic_update() · f1c37e1a
      Thierry Reding 提交于
      In most situations it will be useful to have the old state passed to the
      ->atomic_update() callback. For example if a plane is being disabled the
      new state's .crtc field will be NULL, but some drivers may rely on this
      field to program the CRTCs registers.
      
      v2: rename variable to old_plane_state and remove redundant comment as
      suggested by Daniel Vetter, remove an Exynos hunk that doesn't apply to
      drm-next and add a hunk for pending MSM mdp5 changes
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f1c37e1a
    • J
      drm/atomic_helper: Cope with plane->crtc == NULL in disable helper · aa54e2ee
      Jasper St. Pierre 提交于
      The drm core can call the plane disable hook multiple times, which
      means it can get called when plane->crtc is already NULL. That in turn
      means we can't get at the implicit acquire ctx we use in the atomic
      helpers for legacy entries points.
      
      We could try to pass drm_modeset_legacy_acquire_ctx a drm_device
      pointer so that it can cope with a NULL crtc. But that still doesn't
      work since the cursor ioctls (remapped with the universal cursor plane
      support code) only grabs the crtc locks. So the global acquire context
      isn't set eitehr.
      
      The real solution here would be to bite the bullet and wire up
      explicit acquire context parameters to all relevant functions. We need
      to do that anyway (to be able to get rid of some small allocations
      which we can't cope with failing). But that's a lot of work and better
      done once atomic has settled a bit.
      
      So meanwhile just catch this case in the helper and bail out.
      Signed-off-by: NJasper St. Pierre <jstpierre@mecheye.net>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      [danvet: Completely rewrite commit message and comment but keep
      Jasper's logic and author credits since his patch is the only
      short-term solution that works.]
      Tested-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      aa54e2ee
    • D
      drm/atomic-helper: Skip vblank waits for unchanged fbs · ab58e338
      Daniel Vetter 提交于
      Especially with legacy cursor ioctls existing userspace assumes that
      you can pile up lots of updates in one go. The super-proper way to
      support this would be a special commit mode which overwrites the last
      update. But getting there will be quite a bit of work.
      
      Meanwhile do what pretty much all the drivers have done for the plane
      update functions: Simply skip the vblank wait for the buffer cleanup
      if the buffer is the same. Since the universal cursor plane code will
      not recreate framebuffers needlessly this allows us to not slow down
      legacy pageflip events while someone moves the cursor around.
      
      v2: Drop the async plane update hunk from a previous attempt at this
      issue.
      
      v3: Fix up kerneldoc.
      
      v4: Don't oops so badly. Reported by Jasper.
      
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: "Jasper St. Pierre" <jstpierre@mecheye.net>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NJasper St. Pierre <jstpierre@mecheye.net>
      Tested-by: NJasper St. Pierre <jstpierre@mecheye.net>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      ab58e338
  19. 22 11月, 2014 2 次提交
  20. 20 11月, 2014 2 次提交