1. 04 8月, 2015 1 次提交
  2. 03 8月, 2015 1 次提交
    • L
      i915: temporary fix for DP MST docking station NULL pointer dereference · 27667f47
      Linus Torvalds 提交于
      Ted Ts'o reports that his Lenovo T540p ThinkPad crashes at boot if
      attached to the docking station.  This is a regression that he was able
      to bisect to commit 8c7b5ccb: "drm/i915: Use atomic helpers for
      computing changed flags:"
      
      The reason seems to be the new call to drm_atomic_helper_check_modeset()
      added to intel_modeset_compute_config(), which in turn calls
      update_connector_routing(), and somehow ends up picking a NULL crtc for
      the connector state, causing the subsequent drm_crtc_index() to OOPS.
      
      Daniel Vetter says that the fundamental issue seems to be confusion in
      the encoder selection, and this isn't the right fix, but while he chases
      down the proper fix, this at least avoids the NULL pointer dereference
      and makes Ted's docking station work again.
      Reported-bisected-and-tested-by: NTheodore Ts'o <tytso@mit.edu>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Mani Nikula <jani.nikula@linux.intel.com>
      Cc: Dave Airlie <airlied@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      27667f47
  3. 22 6月, 2015 1 次提交
  4. 19 6月, 2015 1 次提交
  5. 04 6月, 2015 1 次提交
  6. 26 5月, 2015 2 次提交
  7. 21 5月, 2015 3 次提交
    • A
      drm: bridge: Allow daisy chaining of bridges · 862e686c
      Archit Taneja 提交于
      Allow drm_bridge objects to link to each other in order to form an encoder
      chain. The requirement for creating a chain of bridges comes because the
      MSM drm driver uses up its encoder and bridge objects for blocks within
      the SoC itself. There isn't anything left to use if the SoC display output
      is connected to an external encoder IC. Having an additional bridge
      connected to the existing bridge helps here. In general, it is possible for
      platforms to have  multiple devices between the encoder and the
      connector/panel that require some sort of configuration.
      
      We create drm bridge helper functions corresponding to each op in
      'drm_bridge_funcs'. These helpers call the corresponding
      'drm_bridge_funcs' op for the entire chain of bridges. These helpers are
      used internally by drm_atomic_helper.c and drm_crtc_helper.c.
      
      The drm_bridge_enable/pre_enable helpers execute enable/pre_enable ops of
      the bridge closet to the encoder, and proceed until the last bridge in the
      chain is enabled. The same holds for drm_bridge_mode_set/mode_fixup
      helpers. The drm_bridge_disable/post_disable helpers disable the last
      bridge in the chain first, and proceed until the first bridge in the chain
      is disabled.
      
      drm_bridge_attach() remains the same. As before, the driver calling this
      function should make sure it has set the links correctly. The order in
      which the bridges are connected to each other determines the order in which
      the calls are made. One requirement is that every bridge in the chain
      should point the parent encoder object. This is required since bridge
      drivers expect a valid encoder pointer in drm_bridge. For example, consider
      a chain where an encoder's output is connected to bridge1, and bridge1's
      output is connected to bridge2:
      
      	/* Like before, attach bridge to an encoder */
      	bridge1->encoder = encoder;
      	ret = drm_bridge_attach(dev, bridge1);
      	..
      
      	/*
      	 * set the first bridge's 'next' bridge to bridge2, set its encoder
      	 * as bridge1's encoder
      	 */
      	bridge1->next = bridge2
      	bridge2->encoder = bridge1->encoder;
      	ret = drm_bridge_attach(dev, bridge2);
      
      	...
      	...
      
      This method of bridge chaining isn't intrusive and existing drivers that
      use drm_bridge will behave the same way as before. The bridge helpers also
      cleans up the atomic and crtc helper files a bit.
      Reviewed-by: NJani Nikula <jani.nikula@linux.intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel@ffwll.ch>
      Signed-off-by: NArchit Taneja <architt@codeaurora.org>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      862e686c
    • M
      drm/atomic: add all affected planes in drm_atomic_helper_check_modeset · 57744aa7
      Maarten Lankhorst 提交于
      Drivers may need to recalculate plane state when a modeset occurs,
      not reliably adding them might cause hard to debug bugs.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      57744aa7
    • M
      drm/atomic: add commit_planes_on_crtc helper · de28d021
      Maarten Lankhorst 提交于
      drm_atomic_helper_commit_planes calls all atomic_begin's first,
      then updates all planes, finally calling atomic_flush.
      
      Some drivers may want to things like disabling irq's
      from their atomic_begin, in which case a second call to atomic_begin
      will splat. By using commit_planes_on_crtc on each crtc in the
      atomic state they'll evade that issue.
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      [danvet: Extend kerneldoc a bit as discussed with Maarten on irc.]
      [danvet: Squash in fixup to check for crtc_funcs in all places.
      Reported by Dan Carpenter.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      de28d021
  8. 18 5月, 2015 1 次提交
  9. 13 5月, 2015 2 次提交
  10. 08 5月, 2015 1 次提交
  11. 04 5月, 2015 1 次提交
  12. 16 4月, 2015 1 次提交
  13. 12 4月, 2015 1 次提交
  14. 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
  15. 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
  16. 17 3月, 2015 2 次提交
  17. 11 3月, 2015 1 次提交
  18. 10 3月, 2015 1 次提交
  19. 05 3月, 2015 1 次提交
  20. 24 2月, 2015 2 次提交
  21. 23 2月, 2015 3 次提交
  22. 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
  23. 05 1月, 2015 1 次提交
  24. 19 12月, 2014 1 次提交
  25. 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