1. 29 3月, 2022 4 次提交
  2. 15 3月, 2022 6 次提交
  3. 05 3月, 2022 1 次提交
  4. 30 9月, 2021 4 次提交
  5. 26 8月, 2021 3 次提交
  6. 20 8月, 2021 1 次提交
  7. 06 5月, 2021 1 次提交
  8. 03 5月, 2021 2 次提交
  9. 14 4月, 2021 2 次提交
    • L
      drm/i915/display: rename display version macros · 93e7e61e
      Lucas De Marchi 提交于
      While converting the rest of the driver to use GRAPHICS_VER() and
      MEDIA_VER(), following what was done for display, some discussions went
      back on what we did for display:
      
      	1) Why is the == comparison special that deserves a separate
      	macro instead of just getting the version and comparing directly
      	like is done for >, >=, <=?
      
      	2) IS_DISPLAY_RANGE() is weird in that it omits the "_VER" for
      	brevity. If we remove the current users of IS_DISPLAY_VER(), we
      	could actually repurpose it for a range check
      
      With (1) there could be an advantage if we used gen_mask since multiple
      conditionals be combined by the compiler in a single and instruction and
      check the result. However a) INTEL_GEN() doesn't use the mask since it
      would make the code bigger everywhere else and b) in the cases it made
      sense, it also made sense to convert to the _RANGE() variant.
      
      So here we repurpose IS_DISPLAY_VER() to work with a [ from, to ] range
      like was the IS_DISPLAY_RANGE() and convert the current IS_DISPLAY_VER()
      users to use == and != operators. Aside from the definition changes,
      this was done by the following semantic patch:
      
      	@@ expression dev_priv, E1; @@
      	- !IS_DISPLAY_VER(dev_priv, E1)
      	+ DISPLAY_VER(dev_priv) != E1
      
      	@@ expression dev_priv, E1; @@
      	- IS_DISPLAY_VER(dev_priv, E1)
      	+ DISPLAY_VER(dev_priv) == E1
      
      	@@ expression dev_priv, from, until; @@
      	- IS_DISPLAY_RANGE(dev_priv, from, until)
      	+ IS_DISPLAY_VER(dev_priv, from, until)
      
      Cc: Jani Nikula <jani.nikula@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NJani Nikula <jani.nikula@intel.com>
      Signed-off-by: NLucas De Marchi <lucas.demarchi@intel.com>
      [Jani: Minor conflict resolve while applying.]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20210413051002.92589-4-lucas.demarchi@intel.com
      93e7e61e
    • M
      drm/i915/display: Eliminate IS_GEN9_{BC,LP} · 2446e1d6
      Matt Roper 提交于
      Now that we've eliminated INTEL_GEN(), IS_GEN_RANGE(), etc. from the
      display code, we should also kill off our use of the IS_GEN9_* macros
      too.  We'll do the conversion manually this time instead of using
      Coccinelle since the most logical substitution can depend heavily on the
      code context, and sometimes we can keep the code simpler if we make
      additional adjustments such as swapping the order of if/else arms.
      
      v2:
       - Restore a lost negation in intel_pll_is_valid().
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: NMatt Roper <matthew.d.roper@intel.com>
      Reviewed-by: NRadhakrishna Sripada <radhakrishna.sripada@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210407203945.1432531-1-matthew.d.roper@intel.com
      (cherry picked from commit 70bfb307)
      [Jani: cherry picked to topic branch to reduce conflicts]
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      2446e1d6
  10. 08 4月, 2021 1 次提交
  11. 24 3月, 2021 1 次提交
  12. 02 2月, 2021 1 次提交
  13. 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
  14. 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
  15. 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
  16. 23 12月, 2020 2 次提交
  17. 03 12月, 2020 1 次提交
  18. 15 9月, 2020 1 次提交
  19. 06 9月, 2020 4 次提交