Skip to content

Commit 08a3a79

Browse files
committed
drm/i915: Add helper function for getting number of VDSC engines
Currently we are using dsc_split and bigjoiner variables for determining amount of VDSC instances, however that might change in future, if we happen to have more of those. So lets pack all that logic into single function for convenience, so that at least this isn't hardcoded throughout the whole VDSC code. v2: - s/u8/int/ (Jani Nikula) Signed-off-by: Stanislav Lisovskiy <[email protected]> Reviewed-by: Ankit Nautiyal <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 021a62a commit 08a3a79

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder)
293293
return POWER_DOMAIN_TRANSCODER_VDSC_PW2;
294294
}
295295

296+
int intel_dsc_get_num_vdsc_instances(const struct intel_crtc_state *crtc_state)
297+
{
298+
int num_vdsc_instances = (crtc_state->dsc.dsc_split) ? 2 : 1;
299+
300+
if (crtc_state->bigjoiner_pipes)
301+
num_vdsc_instances *= 2;
302+
303+
return num_vdsc_instances;
304+
}
305+
296306
static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state)
297307
{
298308
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
@@ -303,11 +313,8 @@ static void intel_dsc_pps_configure(const struct intel_crtc_state *crtc_state)
303313
u32 pps_val = 0;
304314
u32 rc_buf_thresh_dword[4];
305315
u32 rc_range_params_dword[8];
306-
u8 num_vdsc_instances = (crtc_state->dsc.dsc_split) ? 2 : 1;
307316
int i = 0;
308-
309-
if (crtc_state->bigjoiner_pipes)
310-
num_vdsc_instances *= 2;
317+
int num_vdsc_instances = intel_dsc_get_num_vdsc_instances(crtc_state);
311318

312319
/* Populate PICTURE_PARAMETER_SET_0 registers */
313320
pps_val = DSC_VER_MAJ | vdsc_cfg->dsc_version_minor <<

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ void intel_dsc_get_config(struct intel_crtc_state *crtc_state);
2222
enum intel_display_power_domain
2323
intel_dsc_power_domain(struct intel_crtc *crtc, enum transcoder cpu_transcoder);
2424
struct intel_crtc *intel_dsc_get_bigjoiner_secondary(const struct intel_crtc *primary_crtc);
25+
int intel_dsc_get_num_vdsc_instances(const struct intel_crtc_state *crtc_state);
2526
void intel_dsc_dsi_pps_write(struct intel_encoder *encoder,
2627
const struct intel_crtc_state *crtc_state);
2728
void intel_dsc_dp_pps_write(struct intel_encoder *encoder,

0 commit comments

Comments
 (0)