1. 20 4月, 2016 1 次提交
  2. 15 12月, 2015 1 次提交
    • V
      drm: Don't overwrite UNVERFIED mode status to OK · 4655a12b
      Ville Syrjälä 提交于
      The way the mode probing works is this:
      1. All modes currently on the mode list are marked as UNVERIFIED
      2. New modes are on the probed_modes list (they start with
         status OK)
      3. Modes are moved from the probed_modes list to the actual
         mode list. If a mode already on the mode list is deemed
         to match one of the probed modes, the duplicate is dropped
         and the mode status updated to OK. After this the
         probed_modes list will be empty.
      4. All modes on the mode list are verified to not violate any
         constraints. Any that do are marked as such.
      5. Any mode left with a non-OK status is pruned from the list,
         with an appropriate debug message.
      
      What all this means is that any mode on the original list that
      didn't have a duplicate on the probed_modes list, should be left
      with status UNVERFIED (or previously could have been left with
      some other status, but never OK).
      
      I broke that in
      commit 05acaec3 ("drm: Reorganize probed mode validation")
      by always assigning something to the mode->status during the validation
      step. So any mode from the old list that still passed the validation
      would be left on the list with status OK in the end.
      
      Fix this by not doing the basic mode validation unless the mode
      already has status OK (meaning it came from the probed_modes list,
      or at least a duplicate of it was on that list). This way we will
      correctly prune away any mode from the old mode list that didn't
      appear on the probed_modes list.
      
      Cc: stable@vger.kernel.org
      Cc: Adam Jackson <ajax@redhat.com>
      Fixes: 05acaec3 ("drm: Reorganize probed mode validation")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-2-git-send-email-ville.syrjala@linux.intel.com
      Testcase: igt/kms_force_connector_basic/prune-stale-modes
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93332
      [danvet: Also applying to drm-misc to avoid too much conflict hell -
      there's a big pile of patches from Ville on top of this one.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      4655a12b
  3. 11 12月, 2015 5 次提交
  4. 08 12月, 2015 2 次提交
  5. 04 12月, 2015 1 次提交
  6. 24 11月, 2015 1 次提交
  7. 30 9月, 2015 1 次提交
  8. 22 7月, 2015 2 次提交
    • D
      drm/probe-helper: Grab mode_config.mutex in poll_init/enable · 8c4ccc4a
      Daniel Vetter 提交于
      So on first looks this seems superflous since drivers should ensure
      correct ordering to not make this a problem. Otoh ordering constraints
      between hdp, fbdev load and enabling polling are already tricky on
      some hardware and it helps to be more robust.
      
      But the real goal is to just shut up a locking WARN_ON I'd like to
      add, which means init code gets some additional locks just for
      uniformity.
      
      v2: Also grab the lock for the public poll_enable, not just poll_init
      which is used for resume, with the same justification.
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      8c4ccc4a
    • D
      drm: Add modeset object iterators · 6295d607
      Daniel Vetter 提交于
      And roll them out across drm_* files. The point here isn't code
      prettification (it helps with that too) but that some of these lists
      aren't static any more. And having macros will gives us a convenient
      place to put locking checks into.
      
      I didn't add an iterator for props since that's only used by a
      list_for_each_entry_safe in the driver teardown code.
      
      Search&replace was done with the below cocci spatch. Note that there's
      a bunch more places that didn't match and which would need some manual
      changes, but I've intentially left these out for this mostly automated
      patch.
      
      iterator name drm_for_each_crtc;
      struct drm_crtc *crtc;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
      + drm_for_each_crtc (crtc, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_encoder;
      struct drm_encoder *encoder;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
      + drm_for_each_encoder (encoder, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_fb;
      struct drm_framebuffer *fb;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(fb, &dev->mode_config.fb_list, head) {
      + drm_for_each_fb (fb, dev) {
      ...
      }
      
      @@
      iterator name drm_for_each_connector;
      struct drm_connector *connector;
      struct drm_device *dev;
      expression head;
      @@
      - list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
      + drm_for_each_connector (connector, dev) {
      ...
      }
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@intel.com>
      6295d607
  9. 21 4月, 2015 1 次提交
  10. 08 4月, 2015 1 次提交
  11. 27 3月, 2015 1 次提交
  12. 22 1月, 2015 2 次提交
    • D
      drm/probe-helper: clamp unknown connector status in the poll work · b7703726
      Daniel Vetter 提交于
      On some chipset we try to avoid possibly invasive output detection
      methods (like load detect which can cause flickering elsewhere) in the
      output poll work. Drivers could hence return unknown when a previous
      full ->detect call returned a different state.
      
      This change will generate a hotplug event, forcing userspace to do a
      full scan. This in turn updates the connector->status field so that we
      will _again_ get a state change when the hotplug work re-runs in 10
      seconds.
      
      To avoid this ping-pong loop detect this situation and clamp the
      connector state to the old value.
      
      Patch is inspired by a patch from Knut Peterson. Knut's patch
      completely ignored connector state changes if either the old or new
      status was unknown, which seemed to be a bit too agressive to me.
      
      v2: Rebased onto the drm_probe_helper.c extraction.
      
      References: http://lists.freedesktop.org/archives/dri-devel/2012-August/025975.html
      Cc: Knut Petersen <Knut_Petersen@t-online.de>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: Rob Clark <robdclark@gmail.com>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      b7703726
    • D
      drm/probe-helper: don't lose hotplug event · 162b6a57
      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.
      
      v2: Review from Rob Clark
      - Don't bail out of the output poll work immediately if it's disabled
        to make sure we deliver the delayed hoptplug events. Instead just
        jump to the tail.
      - Don't scheduel the work when it's not set up. Would be a driver bug
        since using probe helpers for anything dynamic without them
        initialized makes them all noops.
      
      Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
      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@ffwll.ch>
      162b6a57
  13. 18 12月, 2014 2 次提交
  14. 04 11月, 2014 1 次提交
    • P
      drm: Fix DRM_FORCE_ON_DIGITAL use · 2c4cc91b
      Peter Hurley 提交于
      A connector may be forced on from the command line via video=
      command line setting. The digital output of dual-mode connectors
      can also be specifically selected and forced on; eg., 'video=DVI-I-2:D'.
      However, in this case, the connector->status will be mistakenly set to
      connector_status_disconnected, and the connector will not be mode set.
      
      Fix the connector->status when connector->force is DRM_FORCE_ON_DIGITAL.
      
      Note that this seems to have been broken ever since the introduction
      of the connector forcing support in
      
      commit d50ba256
      Author: Dave Airlie <airlied@linux.ie>
      Date:   Wed Sep 23 14:44:08 2009 +1000
      
          drm/kms: start adding command line interface using fb.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      [danvet: Add note about that this never worked.]
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      2c4cc91b
  15. 06 8月, 2014 1 次提交
    • C
      drm: Perform cmdline mode parsing during connector initialisation · eaf99c74
      Chris Wilson 提交于
      i915.ko has a custom fbdev initialisation routine that aims to preserve
      the current mode set by the BIOS, unless overruled by the user. The
      user's wishes are determined by what, if any, mode is specified on the
      command line (via the video= parameter). However, that command line mode
      is first parsed by drm_fb_helper_initial_config() which is called after
      i915.ko's custom initial_config() as a fallback method. So in order for
      us to honour it, we need to move the cmdline parser earlier. If we
      perform the connector cmdline parsing as soon as we initialise the
      connector, that cmdline mode and forced status is then available even if
      the fbdev helper is not compiled in or never called.
      
      We also then expose the cmdline user mode in the connector mode lists.
      
      v2: Rebase after connector->name upheaval.
      
      v3: Adapt mga200 to look for the cmdline mode in the new place. Nicely
      simplifies things while at that.
      
      v4: Fix checkpatch.
      
      v5: Select FB_CMDLINE to adapt to the changed fbdev patch.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73154
      Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (v2)
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> (v2)
      Cc: dri-devel@lists.freedesktop.org
      Cc: Julia Lemire <jlemire@matrox.com>
      Cc: Dave Airlie <airlied@redhat.com>
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      eaf99c74
  16. 19 6月, 2014 1 次提交
  17. 04 6月, 2014 1 次提交
  18. 01 5月, 2014 1 次提交
  19. 22 4月, 2014 1 次提交
    • A
      drm: make mode_valid callback optional · f9b0e251
      Andrzej Hajda 提交于
      Many drm connectors do not need mode validation.
      The patch makes this callback optional and removes dumb implementations.
      
      v2: Rebase:
      - imx move to a shared (but still dummy) ->mode_valid implementation.
      - probe helpers have been extracted to drm_probe_helper.c
      
      Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> (v1)
      Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      f9b0e251
  20. 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