Skip to content

[Deepin-Kernel-SIG] [linux 6.6-y] [Intel] Backport for i915 fixes#1484

Open
opsiff wants to merge 4 commits intodeepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-02-06-fix-i915
Open

[Deepin-Kernel-SIG] [linux 6.6-y] [Intel] Backport for i915 fixes#1484
opsiff wants to merge 4 commits intodeepin-community:linux-6.6.yfrom
opsiff:linux-6.6.y-2026-02-06-fix-i915

Conversation

@opsiff
Copy link
Member

@opsiff opsiff commented Feb 6, 2026

#65
#327

Ankit Nautiyal (1):
drm/i915/display: Get bigjoiner config before dsc config during
readout

Manasi Navare (1):
drm/i915/dsc: Fix the macro that calculates DSCC_/DSCA_ PPS reg
address

Suraj Kandpal (1):
drm/i915/dsc: Fix pic_width readout

Ville Syrjälä (1):
drm/i915: Fix VLV color state readout

drivers/gpu/drm/i915/display/intel_color.c | 1 +
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
drivers/gpu/drm/i915/display/intel_vdsc.c | 2 +-
drivers/gpu/drm/i915/display/intel_vdsc_regs.h | 4 ++--
4 files changed, 5 insertions(+), 4 deletions(-)

Summary by Sourcery

Backport i915 display driver fixes for DSC PPS handling, pipe configuration readout ordering, picture width calculation, and VLV color configuration.

Bug Fixes:

  • Correct DSC PPS register address calculation for DSCA/DSCC blocks to match hardware layout.
  • Fix pipe configuration readout ordering by obtaining bigjoiner state before DSC configuration on Haswell.
  • Correct DSC picture width readout by multiplying by the number of DSC instances instead of dividing.
  • Ensure VLV color state readout is wired to the generic i9xx get_config implementation.

surajk8 and others added 4 commits February 6, 2026 16:14
mainline inclusion
from mainline-v6.7-rc1
category: bugfix

pic_width when written into the PPS register is divided by the no.
of vdsc instances first but the actual variable that we compare it
to does not change i.e vdsc_cfg->pic_width hence when reading the
register back for pic_width it needs to be multiplied by
num_vdsc_instances rather than being divided.

Fixes: 8b70b56 ("drm/i915/vdsc: Fill the intel_dsc_get_pps_config function")
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230911193742.836063-1-suraj.kandpal@intel.com
(cherry picked from commit 3106c34)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.7-rc1
category: bugfix

VLV was missed when the color.get_config() hook was added.
Remedy that.

Not really sure what the final plan here was since a bunch of
color related readout was left in intel_display.c anyway,
but that's for anothr day to figure out...

Cc: Jani Nikula <jani.nikula@intel.com>
Fixes: 9af09df ("drm/i915/color: move pre-SKL gamma and CSC enable read to intel_color")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231009145828.12960-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 2bc823c)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.8-rc1
category: bugfix

Currently we get bigjoiner config after the dsc get config, during HW
readout.
Since dsc_get_config now uses bigjoiner flags/pipes to compute DSC PPS
parameter pic_width, this results in a state mismatch when Bigjoiner
and DSC are used together.

So call get bigjoiner config before calling dsc get config function.

Fixes: 8b70b56 ("drm/i915/vdsc: Fill the intel_dsc_get_pps_config function")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231122064627.905828-1-ankit.k.nautiyal@intel.com
(cherry picked from commit baf31a2)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
mainline inclusion
from mainline-v6.9-rc1
category: bugfix

Commit bd07725 ("drm/i915/vdsc: Add function to read any PPS
register") defines a new macro to calculate the DSC PPS register
addresses with PPS number as an input. This macro correctly calculates
the addresses till PPS 11 since the addresses increment by 4. So in that
case the following macro works correctly to give correct register
address:

_MMIO(_DSCA_PPS_0 + (pps) * 4)

However after PPS 11, the register address for PPS 12 increments by 12
because of RC Buffer memory allocation in between. Because of this
discontinuity in the address space, the macro calculates wrong addresses
for PPS 12 - 16 resulting into incorrect DSC PPS parameter value
read/writes causing DSC corruption.

This fixes it by correcting this macro to add the offset of 12 for PPS
>=12.

v3: Add correct paranthesis for pps argument (Jani Nikula)

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10172
Fixes: bd07725 ("drm/i915/vdsc: Add function to read any PPS register")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <sean@poorly.run>
Cc: Drew Davenport <ddavenport@chromium.org>
Signed-off-by: Manasi Navare <navaremanasi@chromium.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240205204619.1991673-1-navaremanasi@chromium.org
(cherry picked from commit 6074be6)
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Feb 6, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Backports several Intel i915 display/DC fixes: corrects DSC PPS register address macros and pic_width readout, adjusts the order of bigjoiner vs. DSC state readout in pipe config, and wires VLV color state get_config so legacy color state is correctly reported.

Sequence diagram for updated pipe config readout ordering

sequenceDiagram
    participant HSW_hsw_get_pipe_config as hsw_get_pipe_config
    participant IntelBigjoiner as intel_bigjoiner_get_config
    participant IntelDsc as intel_dsc_get_config

    HSW_hsw_get_pipe_config->>IntelBigjoiner: intel_bigjoiner_get_config(pipe_config)
    IntelBigjoiner-->>HSW_hsw_get_pipe_config: update bigjoiner state in pipe_config

    HSW_hsw_get_pipe_config->>IntelDsc: intel_dsc_get_config(pipe_config)
    IntelDsc-->>HSW_hsw_get_pipe_config: update DSC state in pipe_config

    HSW_hsw_get_pipe_config-->>HSW_hsw_get_pipe_config: use updated bigjoiner and DSC state for further config readout
Loading

Class diagram for updated VLV color funcs get_config hook

classDiagram
    class IntelColorFuncs {
        +read_luts(crtc_state)
        +lut_equal(crtc_state_a, crtc_state_b)
        +read_csc(crtc_state)
        +get_config(crtc_state)
    }

    class vlv_color_funcs {
        +read_luts = i965_read_luts
        +lut_equal = i965_lut_equal
        +read_csc = vlv_read_csc
        +get_config = i9xx_get_config
    }

    class i965_read_luts {
        +i965_read_luts(crtc_state)
    }

    class i965_lut_equal {
        +i965_lut_equal(crtc_state_a, crtc_state_b)
    }

    class vlv_read_csc {
        +vlv_read_csc(crtc_state)
    }

    class i9xx_get_config {
        +i9xx_get_config(crtc_state)
    }

    IntelColorFuncs <|.. vlv_color_funcs
    vlv_color_funcs ..> i965_read_luts
    vlv_color_funcs ..> i965_lut_equal
    vlv_color_funcs ..> vlv_read_csc
    vlv_color_funcs ..> i9xx_get_config
Loading

File-Level Changes

Change Details Files
Fix DSC PPS register address calculation for DSCA/DSCC blocks to match hardware layout.
  • Update DSCA_PPS() macro to apply a non‑linear PPS index mapping where entries >= 12 are offset by an additional 12
  • Update DSCC_PPS() macro with the same PPS index mapping logic as DSCA to ensure correct register addresses
drivers/gpu/drm/i915/display/intel_vdsc_regs.h
Correct DSC picture width computation from PPS2 to reflect total width across all DSC instances.
  • Change pic_width extraction from dividing by num_vdsc_instances to multiplying by num_vdsc_instances when decoding PPS2
  • Leave pic_height readout logic unchanged
drivers/gpu/drm/i915/display/intel_vdsc.c
Ensure bigjoiner configuration is read before DSC configuration during pipe state readout.
  • Reorder hsw_get_pipe_config() so intel_bigjoiner_get_config() is called before intel_dsc_get_config()
  • Keep the rest of the pipe configuration flow unchanged
drivers/gpu/drm/i915/display/intel_display.c
Hook up VLV color get_config implementation so color state is correctly reported on readout.
  • Add .get_config = i9xx_get_config to the vlv_color_funcs table to provide color state readout on VLV platforms
drivers/gpu/drm/i915/display/intel_color.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

[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

Copy link

@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 - I've left some high level feedback:

  • The DSCA_PPS/DSCC_PPS macros embed the 12 threshold and repetition of the ((pps) < 12 ? (pps) : (pps) + 12) expression; consider factoring this into a small inline helper or at least adding a brief comment to document the hardware layout and avoid the magic number.
  • For the new PPS index mapping in DSCA_PPS/DSCC_PPS, consider asserting or at least documenting the valid pps range expected from callers, as out-of-range values will now silently generate arbitrary MMIO addresses.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The DSCA_PPS/DSCC_PPS macros embed the `12` threshold and repetition of the `((pps) < 12 ? (pps) : (pps) + 12)` expression; consider factoring this into a small inline helper or at least adding a brief comment to document the hardware layout and avoid the magic number.
- For the new PPS index mapping in DSCA_PPS/DSCC_PPS, consider asserting or at least documenting the valid `pps` range expected from callers, as out-of-range values will now silently generate arbitrary MMIO addresses.

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.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR backports four i915 display driver bug fixes from upstream to the 6.6-y kernel for Intel graphics. The fixes address critical issues in DSC (Display Stream Compression) configuration and VLV (Valleyview) color state handling that could cause incorrect hardware programming and display malfunctions.

Changes:

  • Fixed DSC PPS register address calculation to account for hardware register layout gap
  • Corrected DSC picture width readout to multiply instead of divide by number of VDSC instances
  • Reordered bigjoiner and DSC config readout to respect dependency relationship
  • Added missing VLV color state readout callback

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
drivers/gpu/drm/i915/display/intel_vdsc_regs.h Fixed DSCA_PPS and DSCC_PPS macros to account for register gap between PPS 11 and PPS 16
drivers/gpu/drm/i915/display/intel_vdsc.c Fixed pic_width readout to multiply by num_vdsc_instances instead of dividing
drivers/gpu/drm/i915/display/intel_display.c Reordered config readout to get bigjoiner config before DSC config
drivers/gpu/drm/i915/display/intel_color.c Added missing get_config callback for VLV platform

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

5 participants