Skip to content

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] drm/i915/display: correct dual pps handling for MTL_PCH+#843

Merged
Avenger-285714 merged 1 commit into
deepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2025-06-03-i915
Jun 3, 2025
Merged

[Deepin-Kernel-SIG] [linux 6.6-y] [Upstream] [Intel] drm/i915/display: correct dual pps handling for MTL_PCH+#843
Avenger-285714 merged 1 commit into
deepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2025-06-03-i915

Conversation

@opsiff
Copy link
Copy Markdown
Member

@opsiff opsiff commented Jun 3, 2025

On the PCH side the second PPS was introduced in ICP+.Add condition On MTL_PCH and greater platform also having the second PPS.

Note that DG1/2 south block only has the single PPS, so need to exclude the fake DG1/2 PCHs

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11488
Fixes: 93cbc1a ("drm/i915/mtl: Add fake PCH for Meteor Lake")
Cc: stable@vger.kernel.org # v6.9+

Reviewed-by: Jani Nikula jani.nikula@intel.com

Link: https://patchwork.freedesktop.org/patch/msgid/20240801111141.574854-1-dnyaneshwar.bhadane@intel.com (cherry picked from commit da1878b)

(cherry picked from commit 1b85bdb)

Summary by Sourcery

Bug Fixes:

  • Enable dual backlight controllers and PPS instances for MTL_PCH+ platforms

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 3, 2025

Reviewer's Guide

Introduces explicit handling for Meteor Lake (MTL) PCH and newer platforms to correctly report two panel power sequencers (PPS) and backlight controllers, while preserving single-PPS behavior for DG1/DG2 south blocks.

Sequence diagram for i915 GetControllerCount logic with MTL PCH update

sequenceDiagram
    participant DS as Display System
    participant I915 as i915 Driver
    participant PCH as PCH Hardware

    DS->>I915: GetControllerCount()
    activate I915
    I915->>PCH: GetPCHType()
    activate PCH
    PCH-->>I915: PCH_Info (e.g., MTL, DG1, other)
    deactivate PCH
    alt PCH_TYPE is MTL or newer
        I915-->>DS: Returns 2 controllers
    else PCH_TYPE is DG1 (and not MTL+)
        I915-->>DS: Returns 1 controller
    else Other PCH types
        I915-->>DS: Returns count based on prior logic
    end
    deactivate I915
Loading

Class diagram for modified functions in i915 display driver

classDiagram
  class `intel_backlight.c` {
    +cnp_num_backlight_controllers(struct drm_i915_private *i915) int
  }
  class `intel_pps.c` {
    +intel_num_pps(struct drm_i915_private *i915) int
  }

  `intel_backlight.c` : contains modified cnp_num_backlight_controllers
  `intel_pps.c` : contains modified intel_num_pps
Loading

File-Level Changes

Change Details Files
Enable dual backlight controller support on MTL and newer PCH
  • Insert conditional check for PCH_MTL or later before existing DG1 check
  • Return 2 controllers when INTEL_PCH_TYPE(i915) >= PCH_MTL
drivers/gpu/drm/i915/display/intel_backlight.c
Enable dual PPS support on MTL and newer PCH
  • Add INTEL_PCH_TYPE(i915) >= PCH_MTL conditional in intel_num_pps()
  • Return 2 PPS when running on MTL or later platforms
drivers/gpu/drm/i915/display/intel_pps.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from opsiff. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Avenger-285714
Copy link
Copy Markdown
Member

why cherry-picked 2 times with different commit id...

@Avenger-285714
Copy link
Copy Markdown
Member

please add "commit xxx upstream." or "[ Upstream commit xxx ]" in commit msg.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @opsiff - I've reviewed your changes - here's some feedback:

  • Consider refactoring the PCH >= MTL dual-controller logic into a shared helper to avoid duplicating it in both intel_backlight and intel_pps.
  • Add a code comment near the PCH type comparisons to clarify why the >= PCH_MTL check precedes the >= PCH_DG1 check and ensures DG1/DG2 are excluded.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

mainline inclusion
commit 1b85bdb
from mainline v6.11-rc3
category: bugfix

[ Upstream commit 1b85bdb ]

On the PCH side the second PPS was introduced in ICP+.Add condition
On MTL_PCH and greater platform also having the second PPS.

Note that DG1/2 south block only has the single PPS, so need
to exclude the fake DG1/2 PCHs

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11488
Fixes: 93cbc1a ("drm/i915/mtl: Add fake PCH for Meteor Lake")
Cc: <stable@vger.kernel.org> # v6.9+
Signed-off-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240801111141.574854-1-dnyaneshwar.bhadane@intel.com
(cherry picked from commit da1878b)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit 1b85bdb)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@opsiff opsiff force-pushed the linux-6.6.y-2025-06-03-i915 branch from 619dc38 to 07dd516 Compare June 3, 2025 15:49
@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

代码审查意见:

  1. 代码重复:在intel_backlight.cintel_pps.c文件中,INTEL_PCH_TYPE(i915) >= PCH_MTL的条件判断和返回值2是重复的。建议将这部分代码提取到一个公共函数中,以减少代码重复和提高代码的可维护性。

  2. 条件判断的顺序:在intel_backlight.cintel_pps.c文件中,条件判断的顺序是先判断PCH_MTL,然后是PCH_DG1。这种顺序可能会导致在某些情况下返回错误的值。建议将条件判断的顺序调整为先判断PCH_DG1,然后是PCH_MTL,以确保返回正确的值。

  3. 缺少注释:在intel_backlight.cintel_pps.c文件中,新增的条件判断和返回值缺少相应的注释说明。建议添加注释,以便其他开发者理解代码的意图和逻辑。

  4. 代码风格:在intel_backlight.cintel_pps.c文件中,新增的条件判断和返回值与之前的代码风格不一致。建议统一代码风格,以提高代码的可读性。

综上所述,建议对代码进行重构,提取公共函数,调整条件判断的顺序,添加注释,并统一代码风格。

@opsiff opsiff force-pushed the linux-6.6.y-2025-06-03-i915 branch from 07dd516 to 255f934 Compare June 3, 2025 15:51
@opsiff
Copy link
Copy Markdown
Member Author

opsiff commented Jun 3, 2025

please add "commit xxx upstream." or "[ Upstream commit xxx ]" in commit msg.

up

please add "commit xxx upstream." or "[ Upstream commit xxx ]" in commit msg.

OK

@opsiff
Copy link
Copy Markdown
Member Author

opsiff commented Jun 3, 2025

why cherry-picked 2 times with different commit id...

it contains in v6.12-rc1 and cherry-pick to v6.11-rc3

@Avenger-285714 Avenger-285714 merged commit 3b19bf6 into deepin-community:linux-6.6.y Jun 3, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants