drm/i915/cdclk: Hide intel_modeset_calc_cdclk()

We no longer have anything of importance between
intel_cdclk_atomic_check() and intel_modeset_calc_cdclk(), so
hide the latter inside the former.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250923171943.7319-20-ville.syrjala@linux.intel.com
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
This commit is contained in:
Ville Syrjälä 2025-09-23 20:19:41 +03:00
parent 4b044b1368
commit 1cb17a6a27
3 changed files with 20 additions and 28 deletions

View File

@ -3311,22 +3311,24 @@ static int intel_crtcs_calc_min_cdclk(struct intel_atomic_state *state,
return 0;
}
int intel_cdclk_atomic_check(struct intel_atomic_state *state,
bool *need_cdclk_calc)
static int intel_modeset_calc_cdclk(struct intel_atomic_state *state);
int intel_cdclk_atomic_check(struct intel_atomic_state *state)
{
const struct intel_cdclk_state *old_cdclk_state;
struct intel_cdclk_state *new_cdclk_state;
bool need_cdclk_calc = false;
int ret;
ret = intel_cdclk_modeset_checks(state, need_cdclk_calc);
ret = intel_cdclk_modeset_checks(state, &need_cdclk_calc);
if (ret)
return ret;
ret = intel_crtcs_calc_min_cdclk(state, need_cdclk_calc);
ret = intel_crtcs_calc_min_cdclk(state, &need_cdclk_calc);
if (ret)
return ret;
ret = intel_bw_calc_min_cdclk(state, need_cdclk_calc);
ret = intel_bw_calc_min_cdclk(state, &need_cdclk_calc);
if (ret)
return ret;
@ -3339,7 +3341,13 @@ int intel_cdclk_atomic_check(struct intel_atomic_state *state,
if (ret)
return ret;
*need_cdclk_calc = true;
need_cdclk_calc = true;
}
if (need_cdclk_calc) {
ret = intel_modeset_calc_cdclk(state);
if (ret)
return ret;
}
return 0;
@ -3387,7 +3395,7 @@ static bool intel_cdclk_need_serialize(struct intel_display *display,
dg2_power_well_count(display, new_cdclk_state);
}
int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
static int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
{
struct intel_display *display = to_intel_display(state);
const struct intel_cdclk_state *old_cdclk_state;

View File

@ -38,11 +38,9 @@ void intel_set_cdclk_post_plane_update(struct intel_atomic_state *state);
void intel_cdclk_dump_config(struct intel_display *display,
const struct intel_cdclk_config *cdclk_config,
const char *context);
int intel_modeset_calc_cdclk(struct intel_atomic_state *state);
void intel_cdclk_get_cdclk(struct intel_display *display,
struct intel_cdclk_config *cdclk_config);
int intel_cdclk_atomic_check(struct intel_atomic_state *state,
bool *need_cdclk_calc);
int intel_cdclk_atomic_check(struct intel_atomic_state *state);
int intel_cdclk_state_set_joined_mbus(struct intel_atomic_state *state, bool joined_mbus);
struct intel_cdclk_state *
intel_atomic_get_cdclk_state(struct intel_atomic_state *state);

View File

@ -6322,9 +6322,7 @@ int intel_atomic_check(struct drm_device *dev,
struct intel_atomic_state *state = to_intel_atomic_state(_state);
struct intel_crtc_state *old_crtc_state, *new_crtc_state;
struct intel_crtc *crtc;
bool need_cdclk_calc = false;
int ret, i;
bool any_ms = false;
if (!intel_display_driver_check_access(display))
return -ENODEV;
@ -6432,14 +6430,11 @@ int intel_atomic_check(struct drm_device *dev,
if (!intel_crtc_needs_modeset(new_crtc_state))
continue;
any_ms = true;
intel_dpll_release(state, crtc);
}
if (any_ms && !check_digital_port_conflicts(state)) {
drm_dbg_kms(display->drm,
"rejecting conflicting digital port configuration\n");
if (intel_any_crtc_needs_modeset(state) && !check_digital_port_conflicts(state)) {
drm_dbg_kms(display->drm, "rejecting conflicting digital port configuration\n");
ret = -EINVAL;
goto fail;
}
@ -6456,25 +6451,16 @@ int intel_atomic_check(struct drm_device *dev,
if (ret)
goto fail;
ret = intel_cdclk_atomic_check(state, &need_cdclk_calc);
ret = intel_cdclk_atomic_check(state);
if (ret)
goto fail;
if (intel_any_crtc_needs_modeset(state))
any_ms = true;
if (any_ms) {
if (intel_any_crtc_needs_modeset(state)) {
ret = intel_modeset_checks(state);
if (ret)
goto fail;
}
if (need_cdclk_calc) {
ret = intel_modeset_calc_cdclk(state);
if (ret)
return ret;
}
ret = intel_pmdemand_atomic_check(state);
if (ret)
goto fail;