1. 29 4月, 2014 1 次提交
  2. 22 4月, 2014 1 次提交
  3. 18 4月, 2014 1 次提交
    • D
      drm: Split out drm_probe_helper.c from drm_crtc_helper.c · 8d754544
      Daniel Vetter 提交于
      This is leftover stuff from my previous doc round which I kinda wanted
      to do but didn't yet due to rebase hell.
      
      The modeset helpers and the probing helpers a independent and e.g.
      i915 uses the probing stuff but has its own modeset infrastructure. It
      hence makes to split this up. While at it add a DOC: comment for the
      probing libraray.
      
      It would be rather neat to pull some of the DocBook documenting these
      two helpers into in-line DOC: comments. But unfortunately kerneldoc
      doesn't support markdown or something similar to make nice-looking
      documentation, so the current state is better.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      8d754544
  4. 02 4月, 2014 3 次提交
    • D
      drm/crtc-helper: don't disable disconnected outputs · e3d6ddb3
      Daniel Vetter 提交于
      This is the equivalent change in the crtc helpers as done to the i915
      modeset infrastructure in
      
      commit b0a2658a
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Tue Dec 18 09:37:54 2012 +0100
      
          drm/i915: don't disable disconnected outputs
      
      This was originally introduced to make encoder sharing on radone
      easier for userspace, but:
      
      - It is policy and as such belongs into userspace. E.g. personally I'm
        fairly annoyed that a flaky cable results in permanent changes of
        the desktop layout, so I'll kick out DEs which do this. Worse if the
        kernel also tries to be clever.
      
      - It's inconsistent: We only kill disconnected outputs on setCrtc
        (which userspace might also call when just changing the
        framebuffer), but not when e.g. we receive a hpd event or in the
        output poll worker.
      
      - It's unexpected behaviour for the userspace driver, at least in the
        intel ddx we've had tons of bugs where the driver fell over and
        killed the X session becuase pageflips/vblanks suddenly stopped
        working. We've had to fix this by wrapping every single setCrtc int
        a big "recover kms state from the kernel again" operation.
      
      - It's suprising for the kernel, too: It took a few mails between Rob,
        Matt and me for them to notice that little dragon wreaking havoc
        with the universal plane framebuffer refcounting.
      
      - Userspace can cope with it and e.g. Gnome already kills disconnected
        outputs and reconfigures the desktop automatically. And since there
        have been no regression reports for the i915 change from over 1 year
        ago I think all other DEs are also ready.
      
      Note that the lines removed in this patch go back to
      
      commit a3a0544b
      Author: Dave Airlie <airlied@redhat.com>
      Date:   Mon Aug 31 15:16:30 2009 +1000
      
          drm/kms: add explicit encoder disable function and detach harder.
      
      Unfortunately the patch itself doesn't explain a hole lot about why it
      was added ...
      
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e3d6ddb3
    • D
      drm/crtc-helpers: fix dpms on logic · 177cf92d
      Daniel Vetter 提交于
      This was introduced in
      
      commit 25f397a4
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Fri Jul 19 18:57:11 2013 +0200
      
          drm/crtc-helper: explicit DPMS on after modeset
      
      but due to a bit of rebase fail on my side the patch actually merged
      put one hunk on the wrong side of a break statement. Fix this up.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Cc: Alex Deucher <alexdeucher@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      177cf92d
    • M
      drm: Replace crtc fb with primary plane fb (v3) · f4510a27
      Matt Roper 提交于
      Now that CRTC's have a primary plane, there's no need to track the
      framebuffer in the CRTC.  Replace all references to the CRTC fb with the
      primary plane's fb.
      
      This patch was generated by the Coccinelle semantic patching tool using
      the following rules:
      
              @@ struct drm_crtc C; @@
              -   (C).fb
              +   C.primary->fb
      
              @@ struct drm_crtc *C; @@
              -   (C)->fb
              +   C->primary->fb
      
      v3: Generate patch via coccinelle.  Actual removal of crtc->fb has been
          moved to a subsequent patch.
      
      v2: Fixup several lingering crtc->fb instances that were missed in the
          first patch iteration.  [Rob Clark]
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      f4510a27
  5. 22 3月, 2014 2 次提交
    • D
      drm/helper: lock all around force mode restore · 3ea87855
      Dave Airlie 提交于
      Since Daniel documented things with a sledge hammer, we got lots of
      nice backtraces in suspend/resume operations, I've check the callers
      of this and they all seems safe to me,
      
      This fixes one set of warns I reported.
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      3ea87855
    • D
      drm/crtc-helper: fix locking for drm_helper_disable_unused_functions · b182cc59
      Daniel Vetter 提交于
      We have two calling contexts for thise function:
      
      - In the crtc helper code itself as part of the ->set_config
        implementation. In this calling context all modeset locks are
        already held, as they should.
      
      - In drivers not implementing fastboot before the fbdev/fbcon setup
        and initialization. This has been added for all drivers in
      
        commit 76a39dbf
        Author: Daniel Vetter <daniel.vetter@ffwll.ch>
        Date:   Sun Jan 20 23:12:54 2013 +0100
      
            drm/fb-helper: don't disable everything in initial_config
      
        In this calling context we do not hold any modeset locks since the
        immediately following call to initialize the fbev emulation grabs
        all these locks themselves.
      
      - There are two exceptions to the above rule: shmob doesn't have fbdev
        emulation support. I've manually checked the callchain up to the
        driver load function and no kms locks are held.
      
      The right fix therefore is to split this helper into an internal and
      external version and add the required locking to the function exported
      to drivers.
      
      This remedies locking inconsistencies exposed by me adding locking
      WARNs as part of the recent kerneldoc abi polishing done in
      
      commit 62ff94a5
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jan 23 22:18:47 2014 +0100
      
          drm/crtc-helper: remove LOCKING from kerneldoc
      
      and
      
      commit 63951385
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Thu Jan 23 15:14:15 2014 +0100
      
          drm/doc: Repleace LOCKING kerneldoc sections in drm_modes.c
      
      v2: It helps when I actually git add the entire thing.
      
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Tested-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b182cc59
  6. 13 3月, 2014 6 次提交
  7. 19 2月, 2014 1 次提交
  8. 20 1月, 2014 1 次提交
  9. 14 1月, 2014 2 次提交
  10. 06 11月, 2013 6 次提交
  11. 31 10月, 2013 1 次提交
    • T
      drm: Track the proper DPMS mode of connectors · a6ad6230
      Thierry Reding 提交于
      When userspace removes the active framebuffer using DRM_IOCTL_MODE_RMFB,
      or explicitly disables the CRTC (by calling drmModeSetCrtc(..., NULL)
      for example), a NULL framebuffer will be passed to the .set_config()
      implementation of a CRTC. The drm_crtc_helper_set_config() helper will
      decide to disable a CRTC when that happens.
      
      To do so, it calls drm_crtc_helper_disable(), which in turn will iterate
      over all encoders and decouple them from their connectors and finally
      call drm_helper_disable_unused_functions() to clean up and call the
      .disable() or .dpms() implementation for each encoder. However, at no
      point during this sequence does it track the DPMS mode of a connector,
      so it will usually remain on after this.
      
      When a connector is enabled again, drm_helper_connector_dpms() will not
      notice that the DPMS mode actually changed and won't do anything, which
      causes the connector to stay disabled indefinitely.
      
      To prevent this from happening, explicitly set the connector's DPMS mode
      to off when the CRTC is disabled. That way it reflects the correct state
      and can be enabled again.
      
      This solves an issue observed when terminating an X server running on
      the xf86-video-modesetting driver. Without this patch, the connector
      would not be enabled properly and the screen would stay dark.
      Acked-by: NDavid Airlie <airlied@linux.ie>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      a6ad6230
  12. 23 10月, 2013 1 次提交
  13. 12 10月, 2013 1 次提交
    • D
      drm: Add separate Kconfig option for fbdev helpers · 92b6f89f
      Daniel Vetter 提交于
      For drivers which might want to disable fbdev legacy support.
      
      Select the new option in all drivers for now, so this shouldn't result
      in any change. Drivers need some work anyway to make fbdev support
      optional (if they have it implemented, that is), so the recommended
      way to expose this is by adding per-driver options. At least as long
      as most drivers don't support disabling the fbdev support.
      
      v2: Update for new drm drivers msm and rcar-du. Note that Rob's msm
      driver can already take advantage of this, which allows us to build
      msm without any fbdev depencies in the kernel!
      
      v3: Move the MODULE_* stuff from the fbdev helper file to
      drm_crtc_helper.c.
      
      Cc: David Herrmann <dh.herrmann@gmail.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Acked-by: NDave Airlie <airlied@linux.ie>
      Reviewed-by: NChon Ming Lee <chon.ming.lee@intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      92b6f89f
  14. 09 10月, 2013 1 次提交
  15. 01 10月, 2013 1 次提交
  16. 02 9月, 2013 1 次提交
  17. 22 7月, 2013 1 次提交
    • D
      drm/crtc-helper: explicit DPMS on after modeset · 25f397a4
      Daniel Vetter 提交于
      Atm the crtc helper implementation of set_config has really
      inconsisten semantics: If just an fb update is good enough, dpms state
      will be left as-is, but if we do a full modeset we force everything to
      dpms on.
      
      This change has already been applied to the i915 modeset code in
      
      commit e3de42b6
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Fri May 3 19:44:07 2013 +0200
      
          drm/i915: force full modeset if the connector is in DPMS OFF mode
      
      which according to Greg KH seems to aim for a new record in most
      Bugzilla: links in a commit message.
      
      The history of this dpms forcing is pretty interesting. This patch
      here is an almost-revert of
      
      commit 811aaa55
      Author: Keith Packard <keithp@keithp.com>
      Date:   Thu Feb 3 16:57:28 2011 -0800
      
          drm: Only set DPMS ON when actually configuring a mode
      
      which fixed the bug of trying to dpms on disabled outputs, but
      introduced the new discrepancy between an fb update only and full
      modesets. The actual introduction of this goes back to
      
      commit bf9dc102
      Author: Keith Packard <keithp@keithp.com>
      Date:   Fri Nov 26 10:45:58 2010 -0800
      
          drm: Set connector DPMS status to ON in drm_crtc_helper_set_config
      
      And if you'd dig around in the i915 driver code there's even more fun
      around forcing dpms on and losing our heads and temper of the
      resulting inconsistencies. Especially the DP re-training code had tons
      of funny stuff in it.
      
      v2: So v1 totally blew up on resume on my radeon system here. After
      much head-scraching I've figured out that the radeon resume functions
      resumes the console system _before_ it actually restores all the
      modeset state. And resuming the console systems means that fbdev doeas
      an immediate ->set_par call.
      
      Now up to this patch that ->set_par did absolutely nothing: All the
      old sw state from pre-suspend was still around (since the modeset
      reset wasn't done yet), which means that the set_config calls done as
      a result of the ->set_par where all treated as no-ops (despite that
      the real hw state was obviously something completely different).
      
      Since v1 of this patch just added a bunch of ->dpms calls if the crtc
      was enabled, those set_config calls suddenly stopped being no-ops. But
      because the hw state wasn't restored the ->dpms callbacks resulted in
      decent amounts of hilarity and eventual full hangs.
      
      Since I can't review all kms drivers for such tricky ordering
      constraints v2 opts for a different approach and forces a full modeset
      if the connector dpms state isnt' DPMS_ON. Since the ->dpms callbacks
      implemented by the modeset helpers update the connector->dpms property
      we have the same effect of ensuring that the pipe is ultimately turned
      on, even if we just end up updating the fb. This is the same approac
      we ended up using in the intel driver.
      
      Note that besides i915.ko only all other drivers eventually call
      drm_helper_connector_dpms with the exception of vmwgfx, which does not
      support dmps at all.
      
      v3: Dave Airlie merged the broken first version of this patch, so
      squash in the revert of
      
      commit 372835a8
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Sat Jun 15 00:13:13 2013 +0200
      
          drm/crtc-helper: explicit DPMS on after modeset
      
      Also fix up the spelling fail a bit in the commit message while at it.
      
      Cc: Dave Airlie <airlied@redhat.com>
      Reviewed-by: NAlex Deucher <alexdeucher@gmail.com>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67043Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      25f397a4
  18. 28 6月, 2013 1 次提交
    • D
      Revert "drm: kms_helper: don't lose hotplug event" · d482e5fa
      Dave Airlie 提交于
      This reverts commit 160954b7.
      
      This was rearming the workqueue with a 0 timeout, causing
      a WARN_ON, and possible loop.
      
      Daniel writes:
      "I've looked a bit into this and I think we need to have a separate
      work struct for recovering these lost hotplug events since the
      continuous self-rearming case is a real risk (e.g. if a connector
      flip-flops all the time). At least I don't see a sane way to block out
      re-arming with the current code in a simple way. So reverting the
      offender seems like the right thing and I'll go back to the drawing
      board for 3.12."
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      d482e5fa
  19. 27 6月, 2013 1 次提交
    • D
      drm: kms_helper: don't lose hotplug event · 160954b7
      Daniel Vetter 提交于
      There's a race window (small for hpd, 10s large for polled outputs)
      where userspace could sneak in with an unrelated connnector probe
      ioctl call and eat the hotplug event (since neither the hpd nor the
      poll code see a state change).
      
      To avoid this, check whether the connector state changes in all other
      ->detect calls (in the current helper code that's only probe_single)
      and if that's the case, fire off a hotplug event. Note that we can't
      directly call the hotplug event handler, since that expects that no
      locks are held (due to reentrancy with the fb code to update the kms
      console).
      
      Also, this requires that drivers using the probe_single helper
      function set up the poll work. All current drivers do that already,
      and with the reworked hpd handling there'll be no downside to
      unconditionally setting up the poll work any more.
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      160954b7
  20. 25 6月, 2013 3 次提交
    • D
      drm/crtc-helper: explicit DPMS on after modeset · 372835a8
      Daniel Vetter 提交于
      Atm the crtc helper implementation of set_config has really
      inconsisten semantics: If just an fb update is good enough, dpms state
      will be left as-is, but if we do a full modeset we force everything to
      dpms on.
      
      This change has already been applied to the i915 modeset code in
      
      commit e3de42b6
      Author: Imre Deak <imre.deak@intel.com>
      Date:   Fri May 3 19:44:07 2013 +0200
      
          drm/i915: force full modeset if the connector is in DPMS OFF mode
      
      which according to Greg KH seems to aim for a new record in most
      Bugzilla: links in a commit message.
      
      The history of this dpms forcing is pretty interesting. This patch
      here is an almost-revert of
      
      commit 811aaa55
      Author: Keith Packard <keithp@keithp.com>
      Date:   Thu Feb 3 16:57:28 2011 -0800
      
          drm: Only set DPMS ON when actually configuring a mode
      
      which fixed the bug of trying to dpms on disabled outputs, but
      introduced the new discrepancy between an fb update only and full
      modesets. The actual introduction of this goes back to
      
      commit bf9dc102
      Author: Keith Packard <keithp@keithp.com>
      Date:   Fri Nov 26 10:45:58 2010 -0800
      
          drm: Set connector DPMS status to ON in drm_crtc_helper_set_config
      
      And if you'd dig around in the i915 driver code there's even more fun
      around forcing dpms on and losing our heads and temper of the
      resulting inconsistencies. Especially the DP re-training code had tons
      of funny stuff in it.
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      372835a8
    • D
      drm/crtc-helper: no need to check for fb->depth/bpp · cbdfebc9
      Daniel Vetter 提交于
      ... since we already check for fb->pixel_format, which encodes all
      this. The other two fields are only for backwards compat of older
      drivers (and we might want to look into eventually just killing them).
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      cbdfebc9
    • D
      drm/crtc-helpers: Enforce sane set_config api · e58de880
      Daniel Vetter 提交于
      There's no point in trying to clean up after driver-bugs, so just blow
      up. Furthermore it's an interface abuse to set no mode but have an fb
      and aslo to try to set an fb without enough connectors. These two
      spefici cases of interface abuse have been committed by the fb helper,
      but that's been fixed meanwhile in
      
      commit 7e53f3a4
      Author: Daniel Vetter <daniel.vetter@ffwll.ch>
      Date:   Mon Jan 21 10:52:17 2013 +0100
      
          drm/fb-helper: fixup set_config semantics
      
      The i915 driver has been shipping since a while with these BUGs with
      no reports, so should be save.
      
      Note that this drops an ugly case where we clear crtc->fb behind the
      upper levels back and so cause a refcounting mayhem, which Russell
      Kins spotted while trying to hunt down a drm framebuffer leak.
      Reported-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      e58de880
  21. 11 6月, 2013 1 次提交
  22. 13 5月, 2013 2 次提交
  23. 10 5月, 2013 1 次提交