1. 24 3月, 2021 1 次提交
  2. 02 2月, 2021 1 次提交
  3. 20 1月, 2021 2 次提交
    • L
      drm/i915/dp: Enable Intel's HDR backlight interface (only SDR for now) · 4a8d7990
      Lyude Paul 提交于
      So-recently a bunch of laptops on the market have started using DPCD
      backlight controls instead of the traditional DDI backlight controls.
      Originally we thought we had this handled by adding VESA backlight
      control support to i915, but the story ended up being a lot more
      complicated then that.
      
      Simply put-there's two main backlight interfaces Intel can see in the
      wild. Intel's proprietary HDR backlight interface, and the standard VESA
      backlight interface. Note that many panels have been observed to report
      support for both backlight interfaces, but testing has shown far more
      panels work with the Intel HDR backlight interface at the moment.
      Additionally, the VBT appears to be capable of reporting support for the
      VESA backlight interface but not the Intel HDR interface which needs to
      be probed by setting the right magic OUI.
      
      On top of that however, there's also actually two different variants of
      the Intel HDR backlight interface. The first uses the AUX channel for
      controlling the brightness of the screen in both SDR and HDR mode, and
      the second only uses the AUX channel for setting the brightness level in
      HDR mode - relying on PWM for setting the brightness level in SDR mode.
      
      For the time being we've been using EDIDs to maintain a list of quirks
      for panels that safely do support the VESA backlight interface. Adding
      support for Intel's HDR backlight interface in addition however, should
      finally allow us to auto-detect eDP backlight controls properly so long
      as we probe like so:
      
      * If the panel's VBT reports VESA backlight support, assume it really
        does support it
      * If the panel's VBT reports DDI backlight controls:
        * First probe for Intel's HDR backlight interface
        * If that fails, probe for VESA's backlight interface
        * If that fails, assume no DPCD backlight control
      * If the panel's VBT reports any other backlight type: just assume it
        doesn't have DPCD backlight controls
      
      Changes since v4:
      * Fix checkpatch issues
      Changes since v3:
      * Stop using drm_device and use drm_i915_private instead
      * Don't forget to return from intel_dp_aux_hdr_get_backlight() if we fail
        to read the current backlight mode from the DPCD
      * s/uint8_t/u8/
      * Remove unneeded parenthesis in intel_dp_aux_hdr_enable_backlight()
      * Use drm_dbg_kms() in intel_dp_aux_init_backlight_funcs()
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-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-4-lyude@redhat.com
      4a8d7990
    • L
      drm/i915: Keep track of pwm-related backlight hooks separately · a575c00e
      Lyude Paul 提交于
      Currently, every different type of backlight hook that i915 supports is
      pretty straight forward - you have a backlight, probably through PWM
      (but maybe DPCD), with a single set of platform-specific hooks that are
      used for controlling it.
      
      HDR backlights, in particular VESA and Intel's HDR backlight
      implementations, can end up being more complicated. With Intel's
      proprietary interface, HDR backlight controls always run through the
      DPCD. When the backlight is in SDR backlight mode however, the driver
      may need to bypass the TCON and control the backlight directly through
      PWM.
      
      So, in order to support this we'll need to split our backlight callbacks
      into two groups: a set of high-level backlight control callbacks in
      intel_panel, and an additional set of pwm-specific backlight control
      callbacks. This also implies a functional changes for how these
      callbacks are used:
      
      * We now keep track of two separate backlight level ranges, one for the
        high-level backlight, and one for the pwm backlight range
      * We also keep track of backlight enablement and PWM backlight
        enablement separately
      * Since the currently set backlight level might not be the same as the
        currently programmed PWM backlight level, we stop setting
        panel->backlight.level with the currently programmed PWM backlight
        level in panel->backlight.pwm_funcs->setup(). Instead, we rely
        on the higher level backlight control functions to retrieve the
        current PWM backlight level (in this case, intel_pwm_get_backlight()).
        Note that there are still a few PWM backlight setup callbacks that
        do actually need to retrieve the current PWM backlight level, although
        we no longer save this value in panel->backlight.level like before.
      
      Additionally, we drop the call to lpt_get_backlight() in
      lpt_setup_backlight(), and avoid unconditionally writing the PWM value that
      we get from it and only write it back if we're in CPU mode, and switching
      to PCH mode. The reason for this is because in the original codepath for
      this, it was expected that the intel_panel_bl_funcs->setup() hook would be
      responsible for fetching the initial backlight level. On lpt systems, the
      only time we could ever be in PCH backlight mode is during the initial
      driver load - meaning that outside of the setup() hook, lpt_get_backlight()
      will always be the callback used for retrieving the current backlight
      level. After this patch we still need to fetch and write-back the PCH
      backlight value if we're switching from CPU mode to PCH, but because
      intel_pwm_setup_backlight() will retrieve the backlight level after setup()
      using the get() hook, which always ends up being lpt_get_backlight(). Thus
      - an additional call to lpt_get_backlight() in lpt_setup_backlight() is
      made redundant.
      
      v9:
      * Drop the intel_panel_invert_pwm_level() call in lpt_setup_backlight()
      * Remove leftover detritus from lpt_setup_backlight()
      v8:
      * Go back to getting initial brightness level with
        intel_pwm_get_backlight(), the other fix we had was definitely wrong.
      v7:
      * Use panel->backlight.pwm_funcs->get() to get the backlight level in
        intel_pwm_setup_backlight(), lest we upset lockdep
      * Rebase
      * Rename intel_panel_sanitize_pwm_level() to intel_panel_invert_pwm_level()
      v6:
      * Make sure to grab connection_mutex before calling
        intel_pwm_get_backlight() in intel_pwm_setup_backlight()
      v5:
      * Fix indenting warnings from checkpatch
      v4:
      * Fix commit message
      * Remove outdated comment in intel_panel.c
      * Rename pwm_(min|max) to pwm_level_(min|max)
      * Use intel_pwm_get_backlight() in intel_pwm_setup_backlight() instead of
        indirection
      * Don't move intel_dp_aux_init_bcklight_funcs() call to bottom of
        intel_panel_init_backlight_funcs() quite yet
      v3:
      * Reuse intel_panel_bl_funcs() for pwm_funcs
      * Explain why we drop lpt_get_backlight()
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Reviewed-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-3-lyude@redhat.com
      a575c00e
  4. 15 1月, 2021 1 次提交
    • L
      drm/i915: Pass port to intel_panel_bl_funcs.get() · 31b10c1a
      Lyude Paul 提交于
      In the next commit where we split PWM related backlight functions from
      higher-level backlight functions, we'll want to be able to retrieve the
      backlight level for the current display panel from the
      intel_panel_bl_funcs->setup() function using pwm_funcs->get(). Since
      intel_panel_bl_funcs->setup() is called before we've fully read in the
      current hardware state into our atomic state, we can't grab atomic
      modesetting locks safely anyway in intel_panel_bl_funcs->setup(), and some
      PWM backlight functions (vlv_get_backlight() in particular) require knowing
      the currently used pipe we need to be able to discern the current display
      pipe through other means. Luckily, we're already passing the current
      display pipe to intel_panel_bl_funcs->setup() so all we have to do in order
      to achieve this is pass down that parameter to intel_panel_bl_funcs->get().
      
      So, fix this by accepting an additional pipe parameter in
      intel_panel_bl_funcs->get(), and leave figuring out the current display
      pipe up to the caller.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-2-lyude@redhat.com
      31b10c1a
  5. 11 1月, 2021 2 次提交
    • J
      drm/i915/backlight: fix CPU mode backlight takeover on LPT · bb83d5fb
      Jani Nikula 提交于
      The pch_get_backlight(), lpt_get_backlight(), and lpt_set_backlight()
      functions operate directly on the hardware registers. If inverting the
      value is needed, using intel_panel_compute_brightness(), it should only
      be done in the interface between hardware registers and
      panel->backlight.level.
      
      The CPU mode takeover code added in commit 5b1ec9ac
      ("drm/i915/backlight: Fix backlight takeover on LPT, v3.") reads the
      hardware register and converts to panel->backlight.level correctly,
      however the value written back should remain in the hardware register
      "domain".
      
      This hasn't been an issue, because GM45 machines are the only known
      users of i915.invert_brightness and the brightness invert quirk, and
      without one of them no conversion is made. It's likely nobody's ever hit
      the problem.
      
      Fixes: 5b1ec9ac ("drm/i915/backlight: Fix backlight takeover on LPT, v3.")
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: <stable@vger.kernel.org> # v5.1+
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210108152841.6944-1-jani.nikula@intel.com
      (cherry picked from commit 0d4ced1c)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      bb83d5fb
    • J
      drm/i915/backlight: fix CPU mode backlight takeover on LPT · 0d4ced1c
      Jani Nikula 提交于
      The pch_get_backlight(), lpt_get_backlight(), and lpt_set_backlight()
      functions operate directly on the hardware registers. If inverting the
      value is needed, using intel_panel_compute_brightness(), it should only
      be done in the interface between hardware registers and
      panel->backlight.level.
      
      The CPU mode takeover code added in commit 5b1ec9ac
      ("drm/i915/backlight: Fix backlight takeover on LPT, v3.") reads the
      hardware register and converts to panel->backlight.level correctly,
      however the value written back should remain in the hardware register
      "domain".
      
      This hasn't been an issue, because GM45 machines are the only known
      users of i915.invert_brightness and the brightness invert quirk, and
      without one of them no conversion is made. It's likely nobody's ever hit
      the problem.
      
      Fixes: 5b1ec9ac ("drm/i915/backlight: Fix backlight takeover on LPT, v3.")
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: <stable@vger.kernel.org> # v5.1+
      Reviewed-by: NLyude Paul <lyude@redhat.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210108152841.6944-1-jani.nikula@intel.com
      0d4ced1c
  6. 23 12月, 2020 2 次提交
  7. 03 12月, 2020 1 次提交
  8. 15 9月, 2020 1 次提交
  9. 06 9月, 2020 4 次提交
  10. 24 8月, 2020 1 次提交
  11. 23 6月, 2020 1 次提交
    • J
      drm/i915/params: switch to device specific parameters · 8a25c4be
      Jani Nikula 提交于
      Start using device specific parameters instead of module parameters for
      most things. The module parameters become the immutable initial values
      for i915 parameters. The device specific parameters in i915->params
      start life as a copy of i915_modparams. Any later changes are only
      reflected in the debugfs.
      
      The stragglers are:
      
      * i915.force_probe and i915.modeset. Needed before dev_priv is
        available. This is fine because the parameters are read-only and never
        modified.
      
      * i915.verbose_state_checks. Passing dev_priv to I915_STATE_WARN and
        I915_STATE_WARN_ON would result in massive and ugly churn. This is
        handled by not exposing the parameter via debugfs, and leaving the
        parameter writable in sysfs. This may be fixed up in follow-up work.
      
      * i915.inject_probe_failure. Only makes sense in terms of the module,
        not the device. This is handled by not exposing the parameter via
        debugfs.
      
      v2: Fix uc i915 lookup code (Michał Winiarski)
      
      Cc: Juha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>
      Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com>
      Cc: Michał Winiarski <michal.winiarski@intel.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Acked-by: NMichał Winiarski <michal.winiarski@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20200618150402.14022-1-jani.nikula@intel.com
      8a25c4be
  12. 16 6月, 2020 1 次提交
  13. 19 5月, 2020 1 次提交
  14. 16 5月, 2020 1 次提交
  15. 24 4月, 2020 4 次提交
  16. 21 4月, 2020 1 次提交
  17. 08 4月, 2020 1 次提交
    • J
      drm/i915/panel: use struct drm_device based logging · 2b3c472c
      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: NWambui Karuga <wambui.karugax@gmail.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200402114819.17232-2-jani.nikula@intel.com
      2b3c472c
  18. 04 4月, 2020 1 次提交
  19. 04 3月, 2020 1 次提交
  20. 21 2月, 2020 1 次提交
  21. 19 2月, 2020 1 次提交
  22. 04 2月, 2020 2 次提交
  23. 27 1月, 2020 1 次提交
  24. 17 12月, 2019 1 次提交
    • H
      drm/i915: DSI: select correct PWM controller to use based on the VBT · b6941311
      Hans de Goede 提交于
      At least Bay Trail (BYT) and Cherry Trail (CHT) devices can use 1 of 2
      different PWM controllers for controlling the LCD's backlight brightness.
      Either the one integrated into the PMIC or the one integrated into the
      SoC (the 1st LPSS PWM controller).
      
      So far in the LPSS code on BYT we have skipped registering the LPSS PWM
      controller "pwm_backlight" lookup entry when a Crystal Cove PMIC is
      present, assuming that in this case the PMIC PWM controller will be used.
      
      On CHT we have been relying on only 1 of the 2 PWM controllers being
      enabled in the DSDT at the same time; and always registered the lookup.
      
      So far this has been working, but the correct way to determine which PWM
      controller needs to be used is by checking a bit in the VBT table and
      recently I've learned about 2 different BYT devices:
      Point of View MOBII TAB-P800W
      Acer Switch 10 SW5-012
      
      Which use a Crystal Cove PMIC, yet the LCD is connected to the SoC/LPSS
      PWM controller (and the VBT correctly indicates this), so here our old
      heuristics fail.
      
      This commit fixes using the wrong PWM controller on these devices by
      calling pwm_get() for the right PWM controller based on the
      VBT dsi.config.pwm_blc bit.
      
      Note this is part of a series which contains 2 other patches which renames
      the PWM lookup for the 1st SoC/LPSS PWM from "pwm_backlight" to
      "pwm_pmic_backlight" and the PWM lookup for the Crystal Cove PMIC PWM
      from "pwm_backlight" to "pwm_pmic_backlight".
      Acked-by: NJani Nikula <jani.nikula@intel.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20191216202906.1662893-4-hdegoede@redhat.com
      b6941311
  25. 01 11月, 2019 2 次提交
  26. 07 8月, 2019 1 次提交
  27. 17 6月, 2019 1 次提交
  28. 14 6月, 2019 1 次提交
  29. 30 4月, 2019 1 次提交