Skip to content

Commit bb5f1cd

Browse files
hogandertursulin
authored andcommitted
drm/i915/dsc: Add helper for writing DSC Selective Update ET parameters
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 c8698d6) Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net> [tursulin: fixup forward declaration conflict]
1 parent c2c79c6 commit bb5f1cd

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,29 @@ void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
767767
sizeof(dp_dsc_pps_sdp));
768768
}
769769

770+
void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
771+
const struct intel_crtc_state *crtc_state, int su_lines)
772+
{
773+
struct intel_display *display = to_intel_display(crtc_state);
774+
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
775+
const struct drm_dsc_config *vdsc_cfg = &crtc_state->dsc.config;
776+
enum pipe pipe = crtc->pipe;
777+
int vdsc_instances_per_pipe = intel_dsc_get_vdsc_per_pipe(crtc_state);
778+
int slice_row_per_frame = su_lines / vdsc_cfg->slice_height;
779+
u32 val;
780+
781+
drm_WARN_ON_ONCE(display->drm, su_lines % vdsc_cfg->slice_height);
782+
drm_WARN_ON_ONCE(display->drm, vdsc_instances_per_pipe > 2);
783+
784+
val = DSC_SUPS0_SU_SLICE_ROW_PER_FRAME(slice_row_per_frame);
785+
val |= DSC_SUPS0_SU_PIC_HEIGHT(su_lines);
786+
787+
intel_de_write_dsb(display, dsb, LNL_DSC0_SU_PARAMETER_SET_0(pipe), val);
788+
789+
if (vdsc_instances_per_pipe == 2)
790+
intel_de_write_dsb(display, dsb, LNL_DSC1_SU_PARAMETER_SET_0(pipe), val);
791+
}
792+
770793
static i915_reg_t dss_ctl1_reg(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
771794
{
772795
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);
@@ -31,6 +32,8 @@ void intel_dsc_dsi_pps_write(struct intel_encoder *encoder,
3132
const struct intel_crtc_state *crtc_state);
3233
void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
3334
const struct intel_crtc_state *crtc_state);
35+
void intel_dsc_su_et_parameters_configure(struct intel_dsb *dsb, struct intel_encoder *encoder,
36+
const struct intel_crtc_state *crtc_state, int su_lines);
3437
void intel_vdsc_state_dump(struct drm_printer *p, int indent,
3538
const struct intel_crtc_state *crtc_state);
3639
int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)