1. 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
  2. 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
  3. 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
  4. 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
  5. 11 6月, 2013 1 次提交
  6. 13 5月, 2013 2 次提交
  7. 10 5月, 2013 1 次提交
  8. 22 4月, 2013 1 次提交
  9. 21 1月, 2013 2 次提交
    • D
      drm: don't hold crtc mutexes for connector ->detect callbacks · 7b24056b
      Daniel Vetter 提交于
      The coup de grace of the entire journey. No more dropped frames every
      10s on my testbox!
      
      I've tried to audit all ->detect and ->get_modes callbacks, but things
      became a bit fuzzy after trying to piece together the umpteenth
      implemenation. Afaict most drivers just have bog-standard output
      register frobbing with a notch of i2c edid reading, nothing which
      could potentially race with the newly concurrent pageflip/set_cursor
      code. The big exception is load-detection code which requires a
      running pipe, but radeon/nouveau seem to to this without touching any
      state which can be observed from page_flip (e.g. disabled crtcs
      temporarily getting enabled and so a pageflip succeeding).
      
      The only special case I could find is the i915 load detect code. That
      uses the normal modeset interface to enable the load-detect crtc, and
      so userspace could try to squeeze in a pageflip on the load-detect
      pipe. So we need to grab the relevant crtc mutex in there, to avoid
      the temporary crtc enabling to sneak out and be visible to userspace.
      
      Note that the sysfs files already stopped grabbing the per-crtc locks,
      since I didn't want to bother with doing a interruptible
      modeset_lock_all. But since there's very little in-between breakage
      (essentially just the ability for userspace to pageflip on load-detect
      crtcs when it shouldn't on the i915 driver) I figured I don't need to
      bother.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      7b24056b
    • D
      drm: add drm_modeset_lock|unlock_all · 84849903
      Daniel Vetter 提交于
      This is the first step towards introducing the new modeset locking
      scheme. The plan is to put helper functions into place at all the
      right places step-by-step, so that the final patch to switch on the
      new locking scheme doesn't need to touch every single driver.
      
      This helper here will serve as the shotgun solutions for all places
      where a more fine-grained locking isn't (yet) implemented.
      
      v2: Fixup kerneldoc for unlock_all.
      Reviewed-by: NRob Clark <rob@ti.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      84849903
  10. 28 11月, 2012 1 次提交
  11. 20 11月, 2012 7 次提交
  12. 12 11月, 2012 1 次提交
  13. 03 10月, 2012 1 次提交
  14. 21 8月, 2012 1 次提交
    • T
      workqueue: deprecate system_nrt[_freezable]_wq · 3b07e9ca
      Tejun Heo 提交于
      system_nrt[_freezable]_wq are now spurious.  Mark them deprecated and
      convert all users to system[_freezable]_wq.
      
      If you're cc'd and wondering what's going on: Now all workqueues are
      non-reentrant, so there's no reason to use system_nrt[_freezable]_wq.
      Please use system[_freezable]_wq instead.
      
      This patch doesn't make any functional difference.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Acked-By: NLai Jiangshan <laijs@cn.fujitsu.com>
      
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Jiri Kosina <jkosina@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: David Howells <dhowells@redhat.com>
      3b07e9ca
  15. 22 5月, 2012 1 次提交
  16. 20 4月, 2012 1 次提交
  17. 20 3月, 2012 1 次提交
    • C
      drm: allow loading an EDID as firmware to override broken monitor · da0df92b
      Carsten Emde 提交于
      Broken monitors and/or broken graphic boards may send erroneous or no
      EDID data. This also applies to broken KVM devices that are unable to
      correctly forward the EDID data of the connected monitor but invent
      their own fantasy data.
      
      This patch allows to specify an EDID data set to be used instead of
      probing the monitor for it. It contains built-in data sets of frequently
      used screen resolutions. In addition, a particular EDID data set may be
      provided in the /lib/firmware directory and loaded via the firmware
      interface. The name is passed to the kernel as module parameter of the
      drm_kms_helper module either when loaded
        options drm_kms_helper edid_firmware=edid/1280x1024.bin
      or as kernel commandline parameter
        drm_kms_helper.edid_firmware=edid/1280x1024.bin
      
      It is also possible to restrict the usage of a specified EDID data set
      to a particular connector. This is done by prepending the name of the
      connector to the name of the EDID data set using the syntax
        edid_firmware=[<connector>:]<edid>
      such as, for example,
        edid_firmware=DVI-I-1:edid/1920x1080.bin
      in which case no other connector will be affected.
      
      The built-in data sets are
      Resolution    Name
      --------------------------------
      1024x768      edid/1024x768.bin
      1280x1024     edid/1280x1024.bin
      1680x1050     edid/1680x1050.bin
      1920x1080     edid/1920x1080.bin
      
      They are ignored, if a file with the same name is available in the
      /lib/firmware directory.
      
      The built-in EDID data sets are based on standard timings that may not
      apply to a particular monitor and even crash it. Ideally, EDID data of
      the connected monitor should be used. They may be obtained through the
      drm/cardX/cardX-<connector>/edid entry in the /sys/devices PCI directory
      of a correctly working graphics adapter.
      
      It is even possible to specify the name of an EDID data set on-the-fly
      via the /sys/module interface, e.g.
      echo edid/myedid.bin >/sys/module/drm_kms_helper/parameters/edid_firmware
      The new screen mode is considered when the related kernel function is
      called for the first time after the change. Such calls are made when the
      X server is started or when the display settings dialog is opened in an
      already running X server.
      Signed-off-by: NCarsten Emde <C.Emde@osadl.org>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      da0df92b
  18. 15 3月, 2012 1 次提交
  19. 03 2月, 2012 1 次提交
  20. 21 12月, 2011 2 次提交
  21. 20 12月, 2011 1 次提交
  22. 02 12月, 2011 1 次提交
    • C
      drm: Fix lack of CRTC disable for drm_crtc_helper_set_config(.fb=NULL) · 6eebd6bb
      Chris Wilson 提交于
      Disabling the CRTC by setting its framebuffer to NULL, as used by
      drm_framebuffer_cleanup(), was failing to pass the current framebuffer
      to the crtc_func->disable callback. This is because of the dance within
      drm_crtc_helper_set_config to pass the new_fb (NULL in this case) to the
      drm_crtc_helper_set_mode with the currently attached fb as a parameter.
      drm_crtc_helper_set_mode treats this as a no-op and the encoder is still
      enabled. And so the current fb is forgotten before the call to
      drm_helper_disable_unused_functions.
      
      This patch treats disabling the CRTC as a simple special case rather
      than adding further complexity into the configuration logic.
      
      This fixes a pin-leak of the fb bo on Xserver close.
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      6eebd6bb
  23. 30 11月, 2011 1 次提交
  24. 16 11月, 2011 1 次提交
  25. 11 11月, 2011 1 次提交
  26. 01 11月, 2011 2 次提交
  27. 11 10月, 2011 1 次提交
  28. 08 7月, 2011 1 次提交