[Deepin-Kernel-SIG] [linux 6.6-y] [Intel] Backport for i915 fixes#1484
[Deepin-Kernel-SIG] [linux 6.6-y] [Intel] Backport for i915 fixes#1484opsiff wants to merge 4 commits intodeepin-community:linux-6.6.yfrom
Conversation
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>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideBackports 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 orderingsequenceDiagram
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
Class diagram for updated VLV color funcs get_config hookclassDiagram
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
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The DSCA_PPS/DSCC_PPS macros embed the
12threshold 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
ppsrange 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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
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.
#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: