1. 20 1月, 2021 1 次提交
    • L
      drm/dp: Revert "drm/dp: Introduce EDID-based quirks" · 7c553f8b
      Lyude Paul 提交于
      This reverts commit 0883ce81. Originally
      these quirks were added because of the issues with using the eDP
      backlight interfaces on certain laptop panels, which made it impossible
      to properly probe for DPCD backlight support without having a whitelist
      for panels that we know have working VESA backlight control interfaces
      over DPCD. As well, it should be noted it was impossible to use the
      normal sink OUI for recognizing these panels as none of them actually
      filled out their OUIs, hence needing to resort to checking EDIDs.
      
      At the time we weren't really sure why certain panels had issues with
      DPCD backlight controls, but we eventually figured out that there was a
      second interface that these problematic laptop panels actually did work
      with and advertise properly: Intel's proprietary backlight interface for
      HDR panels. So far the testing we've done hasn't brought any panels to
      light that advertise this interface and don't support it properly, which
      means we finally have a real solution to this problem.
      
      As a result, we now have no need for the force DPCD backlight quirk, and
      furthermore this also removes the need for any kind of EDID quirk
      checking in DRM. So, let's just revert it for now since we were the only
      driver using this.
      
      v3:
      * Rebase
      v2:
      * Fix indenting error picked up by checkpatch in
        intel_edp_init_connector()
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Cc: thaytan@noraisin.net
      Cc: Vasily Khoruzhick <anarsoul@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-6-lyude@redhat.com
      7c553f8b
  2. 13 1月, 2021 2 次提交
  3. 20 11月, 2020 1 次提交
    • M
      drm: Pass the full state to connectors atomic functions · eca22edb
      Maxime Ripard 提交于
      The current atomic helpers have either their object state being passed as
      an argument or the full atomic state.
      
      The former is the pattern that was done at first, before switching to the
      latter for new hooks or when it was needed.
      
      Now that the CRTCs have been converted, let's move forward with the
      connectors to provide a consistent interface.
      
      The conversion was done using the coccinelle script below, and built tested
      on all the drivers.
      
      @@
      identifier connector, connector_state;
      @@
      
       struct drm_connector_helper_funcs {
      	...
      	struct drm_encoder* (*atomic_best_encoder)(struct drm_connector *connector,
      -						   struct drm_connector_state *connector_state);
      +						   struct drm_atomic_state *state);
      	...
      }
      
      @@
      identifier connector, connector_state;
      @@
      
       struct drm_connector_helper_funcs {
      	...
      	void (*atomic_commit)(struct drm_connector *connector,
      -			      struct drm_connector_state *connector_state);
      +			      struct drm_atomic_state *state);
      	...
      }
      
      @@
      struct drm_connector_helper_funcs *FUNCS;
      identifier state;
      identifier connector, connector_state;
      identifier f;
      @@
      
       f(..., struct drm_atomic_state *state, ...)
       {
      	<+...
      -	FUNCS->atomic_commit(connector, connector_state);
      +	FUNCS->atomic_commit(connector, state);
      	...+>
       }
      
      @@
      struct drm_connector_helper_funcs *FUNCS;
      identifier state;
      identifier connector, connector_state;
      identifier var, f;
      @@
      
       f(struct drm_atomic_state *state, ...)
       {
      	<+...
      -	var = FUNCS->atomic_best_encoder(connector, connector_state);
      +	var = FUNCS->atomic_best_encoder(connector, state);
      	...+>
       }
      
      @ connector_atomic_func @
      identifier helpers;
      identifier func;
      @@
      
      (
      static struct drm_connector_helper_funcs helpers = {
      	...,
      	.atomic_best_encoder = func,
      	...,
      };
      |
      static struct drm_connector_helper_funcs helpers = {
      	...,
      	.atomic_commit = func,
      	...,
      };
      )
      
      @@
      identifier connector_atomic_func.func;
      identifier connector;
      symbol state;
      @@
      
       func(struct drm_connector *connector,
      -      struct drm_connector_state *state
      +      struct drm_connector_state *connector_state
            )
       {
      	...
      -	state
      +	connector_state
       	...
       }
      
      @ ignores_state @
      identifier connector_atomic_func.func;
      identifier connector, connector_state;
      @@
      
       func(struct drm_connector *connector,
            struct drm_connector_state *connector_state)
      {
      	... when != connector_state
      }
      
      @ adds_state depends on connector_atomic_func && !ignores_state @
      identifier connector_atomic_func.func;
      identifier connector, connector_state;
      @@
      
       func(struct drm_connector *connector, struct drm_connector_state *connector_state)
       {
      +	struct drm_connector_state *connector_state = drm_atomic_get_new_connector_state(state, connector);
      	...
       }
      
      @ depends on connector_atomic_func @
      identifier connector_atomic_func.func;
      identifier connector_state;
      identifier connector;
      @@
      
       func(struct drm_connector *connector,
      -     struct drm_connector_state *connector_state
      +     struct drm_atomic_state *state
      	   )
       { ... }
      
      @ include depends on adds_state @
      @@
      
       #include <drm/drm_atomic.h>
      
      @ no_include depends on !include && adds_state @
      @@
      
      + #include <drm/drm_atomic.h>
        #include <drm/...>
      Signed-off-by: NMaxime Ripard <maxime@cerno.tech>
      Reviewed-by: NRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Acked-by: NThomas Zimmermann <tzimmermann@suse.de>
      Acked-by: NHarry Wentland <harry.wentland@amd.com>
      Cc: Leo Li <sunpeng.li@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: "Christian König" <christian.koenig@amd.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
      Cc: Melissa Wen <melissa.srw@gmail.com>
      Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20201118094758.506730-1-maxime@cerno.tech
      eca22edb
  4. 19 11月, 2020 1 次提交
  5. 21 10月, 2020 1 次提交
  6. 06 10月, 2020 1 次提交
  7. 01 10月, 2020 1 次提交
  8. 25 9月, 2020 1 次提交
  9. 15 9月, 2020 1 次提交
  10. 01 9月, 2020 2 次提交
  11. 14 7月, 2020 1 次提交
    • L
      drm/i915/mst: filter out the display mode exceed sink's capability · e398d7c1
      Lee Shawn C 提交于
      So far, max dot clock rate for MST mode rely on physcial
      bandwidth limitation. It would caused compatibility issue
      if source display resolution exceed MST hub output ability.
      
      For example, source DUT had DP 1.2 output capability.
      And MST docking just support HDMI 1.4 spec. When a HDMI 2.0
      monitor connected. Source would retrieve EDID from external
      and get max resolution 4k@60fps. DP 1.2 can support 4K@60fps
      because it did not surpass DP physical bandwidth limitation.
      Do modeset to 4k@60fps, source output display data but MST
      docking can't output HDMI properly due to this resolution
      already over HDMI 1.4 spec.
      
      Refer to commit <fcf46380> ("drm/dp_mst: Use full_pbn
      instead of available_pbn for bandwidth checks").
      Source driver should refer to full_pbn to evaluate sink
      output capability. And filter out the resolution surpass
      sink output limitation.
      
      Changes since v1:
      * Using mgr->base.lock to protect full_pbn.
      Changes since v2:
      * Add ctx lock.
      Changes since v3:
      * s/intel_dp_mst_mode_clock_exceed_pbn_bandwidth/
        intel_dp_mst_mode_clock_exceeds_pbn_bw/
      * Use the new drm_connector_helper_funcs.mode_valid_ctx to properly pipe
        down the drm_modeset_acquire_ctx that the probe helpers are using, so
        we can safely grab &mgr->base.lock without deadlocking
      Changes since v4:
      * Move drm_dp_calc_pbn_mode(mode->clock, bpp, false) > port->full_pbn
        check
      * Fix the bpp we use in drm_dp_calc_pbn_mode()
      * Drop leftover (!mgr) check
      * Don't check for if full_pbn is unset. To be clear - it _can_ be unset,
        but if it is then it's certainly a bug in DRM or a non-compliant sink
        as full_pbn should always be populated by the time we call
        ->mode_valid_ctx.
        We should workaround non-compliant sinks with full_pbn=0, but that
        should happen in the DP MST helpers so we can estimate the full_pbn
        value as best we can.
      Tested-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NImre Deak <imre.deak@intel.com>
      Cc: Manasi Navare <manasi.d.navare@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Co-developed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NLee Shawn C <shawn.c.lee@intel.com>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200713170746.254388-3-lyude@redhat.com
      e398d7c1
  12. 03 7月, 2020 1 次提交
  13. 24 6月, 2020 1 次提交
  14. 23 6月, 2020 3 次提交
  15. 16 6月, 2020 1 次提交
  16. 11 6月, 2020 2 次提交
    • I
      drm/i915/dp_mst: Work around out-of-spec adapters filtering short pulses · 471bdd0d
      Imre Deak 提交于
      Some TypeC -> native DP adapters, at least the Club 3D CAC-1557 adapter,
      incorrectly filter out HPD short pulses with a duration less than
      ~540 usec, leading to MST probe failures.
      
      According to the DP Standard 2.0 section 5.1.4:
      - DP sinks should generate short pulses in the 500 usec -> 1 msec range
      - DP sources should detect short pulses in the 250 usec -> 2 msec range
      
      According to the DP Alt Mode on TypeC Standard section 3.9.2, adapters
      should detect and forward short pulses according to how sources should
      detect them as specified in the DP Standard (250 usec -> 2 msec).
      
      Based on the above filtering out short pulses with a duration less than
      540 usec is incorrect.
      
      To make such adapters work add support for a driver polling on MST
      inerrupt flags, and wire this up in the i915 driver. The sink can clear
      an interrupt it raised after 110 msec if the source doesn't respond, so
      use a 50 msec poll period to avoid missing an interrupt. Polling of the
      MST interrupt flags is explicitly allowed by the DP Standard.
      
      This fixes MST probe failures I saw using this adapter and a DELL U2515H
      monitor.
      
      v2:
      - Fix the wait event timeout for the no-poll case.
      v3 (Ville):
      - Fix the short pulse duration limits in the commit log prescribed by the
        DP Standard.
      - Add code comment explaining why/how polling is used.
      - Factor out a helper to schedule the port's hpd irq handler and move it
        to the rest of hotplug handlers.
      - Document the new MST callback.
      - s/update_hpd_irq_state/poll_hpd_irq/
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200604184500.23730-2-imre.deak@intel.com
      471bdd0d
    • I
      drm/i915/icl: Disable DIP on MST ports with the transcoder clock still on · c980216d
      Imre Deak 提交于
      According to BSpec the Data Island Packet should be disabled after
      disabling the transcoder, but before the transcoder clock select is set
      to none. On an ICL RVP, daisy-chained MST config not following this
      leads to a hang with the following MCE when disabling the output:
      
      [  870.948739] mce: [Hardware Error]: CPU 0: Machine Check Exception: 5 Bank 6: ba00000011000402
      [  871.019212] mce: [Hardware Error]: RIP !INEXACT! 10:<ffffffff81aca652> {poll_idle+0x92/0xb0}
      [  871.019212] mce: [Hardware Error]: TSC 135a261fe61
      [  871.019212] mce: [Hardware Error]: PROCESSOR 0:706e5 TIME 1591739604 SOCKET 0 APIC 0 microcode 20
      [  871.019212] mce: [Hardware Error]: Run the above through 'mcelog --ascii'
      [  871.019212] mce: [Hardware Error]: Machine check: Processor context corrupt
      [  871.019212] Kernel panic - not syncing: Fatal machine check
      [  871.019212] Kernel Offset: disabled
      
      Bspec: 4287
      
      Fixes: fa37a213 ("drm/i915: Stop sending DP SDPs on ddi disable")
      Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
      Cc: Uma Shankar <uma.shankar@intel.com>
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NUma Shankar <uma.shankar@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200609220616.6015-1-imre.deak@intel.com
      c980216d
  17. 11 5月, 2020 1 次提交
  18. 21 4月, 2020 3 次提交
  19. 08 4月, 2020 1 次提交
    • L
      drm/dp_mst: Remove drm_dp_mst_has_audio() · 20c22ad3
      Lyude Paul 提交于
      Drive-by fix I noticed the other day - drm_dp_mst_has_audio() only ever
      made sense back when we still had to validate ports before accessing
      them in order to (attempt to) avoid NULL dereferences. Since we have
      proper reference counting that guarantees we always can safely access
      the MST port, there's no use in keeping this function around as all it
      does is validate the port pointer before checking the audio status.
      
      Note - drm_dp_mst_port->has_audio is technically protected by
      drm_device->mode_config.connection_mutex, since it's only ever updated
      from drm_dp_mst_get_edid(). Additionally, we change the declaration for
      port in struct intel_connector to be properly typed, so we can directly
      access it.
      
      Changes since v1:
      * Change type of intel_connector->port in a separate patch - Sean Paul
      
      Cc: "Lee, Shawn C" <shawn.c.lee@intel.com>
      Reviewed-by: NSean Paul <sean@poorly.run>
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200406200646.1263435-2-lyude@redhat.com
      20c22ad3
  20. 04 4月, 2020 1 次提交
  21. 28 3月, 2020 1 次提交
  22. 27 3月, 2020 1 次提交
  23. 26 3月, 2020 1 次提交
    • J
      drm/i915/dp_mst: use struct drm_device based logging · ca4aae6d
      Jani Nikula 提交于
      Convert all the DRM_* logging macros to the struct drm_device based
      macros to provide device specific logging.
      
      No functional changes.
      
      Generated using the following semantic patch, originally written by
      Wambui Karuga <wambui.karugax@gmail.com>, with manual fixups on top:
      
      @@
      identifier fn, T;
      @@
      
      fn(...,struct drm_i915_private *T,...) {
      <+...
      (
      -DRM_INFO(
      +drm_info(&T->drm,
      ...)
      |
      -DRM_NOTE(
      +drm_notice(&T->drm,
      ...)
      |
      -DRM_ERROR(
      +drm_err(&T->drm,
      ...)
      |
      -DRM_WARN(
      +drm_warn(&T->drm,
      ...)
      |
      -DRM_DEBUG_DRIVER(
      +drm_dbg(&T->drm,
      ...)
      |
      -DRM_DEBUG_KMS(
      +drm_dbg_kms(&T->drm,
      ...)
      |
      -DRM_DEBUG_ATOMIC(
      +drm_dbg_atomic(&T->drm,
      ...)
      )
      ...+>
      }
      
      @@
      identifier fn, T;
      @@
      
      fn(...) {
      ...
      struct drm_i915_private *T = ...;
      <+...
      (
      -DRM_INFO(
      +drm_info(&T->drm,
      ...)
      |
      -DRM_NOTE(
      +drm_notice(&T->drm,
      ...)
      |
      -DRM_ERROR(
      +drm_err(&T->drm,
      ...)
      |
      -DRM_WARN(
      +drm_warn(&T->drm,
      ...)
      |
      -DRM_DEBUG_DRIVER(
      +drm_dbg(&T->drm,
      ...)
      |
      -DRM_DEBUG_KMS(
      +drm_dbg_kms(&T->drm,
      ...)
      |
      -DRM_DEBUG_ATOMIC(
      +drm_dbg_atomic(&T->drm,
      ...)
      )
      ...+>
      }
      
      Cc: Wambui Karuga <wambui.karugax@gmail.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/5ee3b8040658b5b4ef0b8b1a546fa04f554cdf6a.1584714939.git.jani.nikula@intel.com
      ca4aae6d
  24. 12 3月, 2020 2 次提交
  25. 11 3月, 2020 1 次提交
  26. 06 3月, 2020 1 次提交
  27. 04 3月, 2020 1 次提交
    • L
      drm/dp: Introduce EDID-based quirks · 0883ce81
      Lyude Paul 提交于
      The whole point of using OUIs is so that we can recognize certain
      devices and potentially apply quirks for them. Normally this should work
      quite well, but there appears to be quite a number of laptop panels out
      there that will fill the OUI but not the device ID. As such, for devices
      like this I can't imagine it's a very good idea to try relying on OUIs
      for applying quirks. As well, some laptop vendors have confirmed to us
      that their panels have this exact issue.
      
      So, let's introduce the ability to apply DP quirks based on EDID
      identification. We reuse the same quirk bits for OUI-based quirks, so
      that callers can simply check all possible quirks using
      drm_dp_has_quirk().
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: NAdam Jackson <ajax@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200211183358.157448-2-lyude@redhat.com
      0883ce81
  28. 15 2月, 2020 1 次提交
  29. 10 2月, 2020 1 次提交
  30. 04 2月, 2020 1 次提交
    • P
      drm/i915/display: Make WARN* drm specific where drm_device ptr is available · f4224a4c
      Pankaj Bharadiya 提交于
      drm specific WARN* calls include device information in the
      backtrace, so we know what device the warnings originate from.
      
      Covert all the calls of WARN* with device specific drm_WARN*
      variants in functions where drm_device or drm_i915_private struct
      pointer is readily available.
      
      The conversion was done automatically with below coccinelle semantic
      patch. checkpatch errors/warnings are fixed manually.
      
      @rule1@
      identifier func, T;
      @@
      func(...) {
      ...
      struct drm_device *T = ...;
      <...
      (
      -WARN(
      +drm_WARN(T,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(T,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(T,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(T,
      ...)
      )
      ...>
      }
      
      @rule2@
      identifier func, T;
      @@
      func(struct drm_device *T,...) {
      <...
      (
      -WARN(
      +drm_WARN(T,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(T,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(T,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(T,
      ...)
      )
      ...>
      }
      
      @rule3@
      identifier func, T;
      @@
      func(...) {
      ...
      struct drm_i915_private *T = ...;
      <+...
      (
      -WARN(
      +drm_WARN(&T->drm,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(&T->drm,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(&T->drm,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(&T->drm,
      ...)
      )
      ...+>
      }
      
      @rule4@
      identifier func, T;
      @@
      func(struct drm_i915_private *T,...) {
      <+...
      (
      -WARN(
      +drm_WARN(&T->drm,
      ...)
      |
      -WARN_ON(
      +drm_WARN_ON(&T->drm,
      ...)
      |
      -WARN_ONCE(
      +drm_WARN_ONCE(&T->drm,
      ...)
      |
      -WARN_ON_ONCE(
      +drm_WARN_ON_ONCE(&T->drm,
      ...)
      )
      ...+>
      }
      Signed-off-by: NPankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200128181603.27767-20-pankaj.laxminarayan.bharadiya@intel.com
      f4224a4c
  31. 27 1月, 2020 1 次提交
  32. 22 1月, 2020 1 次提交