Skip to content

Commit 59406bd

Browse files
committed
drm/i915/cdclk: abstract intel_cdclk_logical()
Add intel_cdclk_logical() helper to avoid looking at struct intel_cdclk_state internals outside of intel_cdclk.c. Reviewed-by: Imre Deak <imre.deak@intel.com> Link: https://lore.kernel.org/r/e965667550e82307341d6abbeedc67b93cae9fc6.1750847509.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
1 parent d7ecd05 commit 59406bd

6 files changed

Lines changed: 11 additions & 4 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ int hsw_ips_compute_config(struct intel_atomic_state *state,
265265
return PTR_ERR(cdclk_state);
266266

267267
/* pixel rate mustn't exceed 95% of cdclk with IPS on BDW */
268-
if (crtc_state->pixel_rate > cdclk_state->logical.cdclk * 95 / 100)
268+
if (crtc_state->pixel_rate > intel_cdclk_logical(cdclk_state) * 95 / 100)
269269
return 0;
270270
}
271271

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,3 +3834,8 @@ void intel_init_cdclk_hooks(struct intel_display *display)
38343834
"Unknown platform. Assuming i830\n"))
38353835
display->funcs.cdclk = &i830_cdclk_funcs;
38363836
}
3837+
3838+
int intel_cdclk_logical(const struct intel_cdclk_state *cdclk_state)
3839+
{
3840+
return cdclk_state->logical.cdclk;
3841+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,6 @@ void intel_cdclk_crtc_disable_noatomic(struct intel_crtc *crtc);
9797
int intel_cdclk_init(struct intel_display *display);
9898
void intel_cdclk_debugfs_register(struct intel_display *display);
9999

100+
int intel_cdclk_logical(const struct intel_cdclk_state *cdclk_state);
101+
100102
#endif /* __INTEL_CDCLK_H__ */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4168,7 +4168,7 @@ static u16 hsw_ips_linetime_wm(const struct intel_crtc_state *crtc_state,
41684168
return 0;
41694169

41704170
linetime_wm = DIV_ROUND_CLOSEST(pipe_mode->crtc_htotal * 1000 * 8,
4171-
cdclk_state->logical.cdclk);
4171+
intel_cdclk_logical(cdclk_state));
41724172

41734173
return min(linetime_wm, 0x1ff);
41744174
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ static int intel_fbc_check_plane(struct intel_atomic_state *state,
15761576
if (IS_ERR(cdclk_state))
15771577
return PTR_ERR(cdclk_state);
15781578

1579-
if (crtc_state->pixel_rate >= cdclk_state->logical.cdclk * 95 / 100) {
1579+
if (crtc_state->pixel_rate >= intel_cdclk_logical(cdclk_state) * 95 / 100) {
15801580
plane_state->no_fbc_reason = "pixel rate too high";
15811581
return 0;
15821582
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ cdclk_prefill_adjustment(const struct intel_crtc_state *crtc_state)
21782178
}
21792179

21802180
return min(1, DIV_ROUND_UP(crtc_state->pixel_rate,
2181-
2 * cdclk_state->logical.cdclk));
2181+
2 * intel_cdclk_logical(cdclk_state)));
21822182
}
21832183

21842184
static int

0 commit comments

Comments
 (0)