Skip to content
/ linux Public

Commit a5cdbbc

Browse files
hogandergregkh
authored andcommitted
drm/i915/dsc: Add helper for writing DSC Selective Update ET parameters
commit bb5f1cd upstream. There are slice row per frame and pic height configuration in DSC Selective Update Parameter Set 1 register. Add helper for configuring these. v2: - Add WARN_ON_ONCE if vdsc instances per pipe > 2 - instead of checking vdsc instances per pipe being > 1 check == 2 Bspec: 71709 Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Link: https://patch.msgid.link/20260304113011.626542-4-jouni.hogander@intel.com (cherry picked from commit c8698d61aeb3f70fe33761ee9d3d0e131b5bc2eb) Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net> [tursulin: fixup forward declaration conflict] Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 291d19d commit a5cdbbc

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

drivers/gpu/drm/i915/display/intel_vdsc.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,29 @@ void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
751751
sizeof(dp_dsc_pps_sdp));
752752
}
753753

754+
void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
755+
const struct intel_crtc_state *crtc_state, int su_lines)
756+
{
757+
struct intel_display *display = to_intel_display(crtc_state);
758+
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
759+
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
760+
enum pipe pipe = crtc->pipe;
761+
int vdsc_instances_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
762+
int slice_row_per_frame = su_lines / vdsc_cfg->slice_height;
763+
u32 val;
764+
765+
drm_WARN_ON_ONCE(display->drm, su_lines % vdsc_cfg->slice_height);
766+
drm_WARN_ON_ONCE(display->drm, vdsc_instances_per_pipe > 2);
767+
768+
val = DSC_SUPS0_SU_SLICE_ROW_PER_FRAME(slice_row_per_frame);
769+
val |= DSC_SUPS0_SU_PIC_HEIGHT(su_lines);
770+
771+
intel_de_write_dsb(display, dsb, LNL_DSC0_SU_PARAMETER_SET_0(pipe), val);
772+
773+
if (vdsc_instances_per_pipe == 2)
774+
intel_de_write_dsb(display, dsb, LNL_DSC1_SU_PARAMETER_SET_0(pipe), val);
775+
}
776+
754777
static i915_reg_t dss_ctl1_reg(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
755778
{
756779
return is_pipe_dsc(crtc, cpu_transcoder) ?

drivers/gpu/drm/i915/display/intel_vdsc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ struct drm_printer;
1313
enum transcoder;
1414
struct intel_crtc;
1515
struct intel_crtc_state;
16+
struct intel_dsb;
1617
struct intel_encoder;
1718

1819
bool intel_dsc_source_support(const struct intel_crtc_state *crtc_state);
@@ -29,6 +30,8 @@ void intel_dsc_dsi_pps_write(struct intel_encoder *encoder,
2930
const struct intel_crtc_state *crtc_state);
3031
void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
3132
const struct intel_crtc_state *crtc_state);
33+
void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
34+
const struct intel_crtc_state *crtc_state, int su_lines);
3235
void intel_vdsc_state_dump(struct drm_printer *p, int indent,
3336
const struct intel_crtc_state *crtc_state);
3437
int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)