Skip to content

Commit 2b8ad19

Browse files
committed
drm/i915: Introduce intel_crtc_joined_pipe_mask()
Add a small helper to compute the set of pipes that the current crtc is using. And we have at least one trivial place in intel_ddi_update_active_dpll() where we can use it immediately, so let's do that. v2: Use the name 'pipe_crtc' for the per-pipe crtc pointer Tested-by: Vidya Srinivas <vidya.srinivas@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240404213441.17637-12-ville.syrjala@linux.intel.com
1 parent e43b4f7 commit 2b8ad19

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,18 +3462,17 @@ void intel_ddi_update_active_dpll(struct intel_atomic_state *state,
34623462
struct intel_crtc *crtc)
34633463
{
34643464
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3465-
struct intel_crtc_state *crtc_state =
3465+
const struct intel_crtc_state *crtc_state =
34663466
intel_atomic_get_new_crtc_state(state, crtc);
3467-
struct intel_crtc *slave_crtc;
3467+
struct intel_crtc *pipe_crtc;
34683468

34693469
/* FIXME: Add MTL pll_mgr */
34703470
if (DISPLAY_VER(i915) >= 14 || !intel_encoder_is_tc(encoder))
34713471
return;
34723472

3473-
intel_update_active_dpll(state, crtc, encoder);
3474-
for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
3475-
intel_crtc_bigjoiner_slave_pipes(crtc_state))
3476-
intel_update_active_dpll(state, slave_crtc, encoder);
3473+
for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
3474+
intel_crtc_joined_pipe_mask(crtc_state))
3475+
intel_update_active_dpll(state, pipe_crtc, encoder);
34773476
}
34783477

34793478
static void

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,13 @@ static int intel_bigjoiner_num_pipes(const struct intel_crtc_state *crtc_state)
275275
return hweight8(crtc_state->bigjoiner_pipes);
276276
}
277277

278+
u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state)
279+
{
280+
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
281+
282+
return BIT(crtc->pipe) | crtc_state->bigjoiner_pipes;
283+
}
284+
278285
struct intel_crtc *intel_master_crtc(const struct intel_crtc_state *crtc_state)
279286
{
280287
struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ intel_cpu_transcoder_mode_valid(struct drm_i915_private *i915,
416416
enum phy intel_port_to_phy(struct drm_i915_private *i915, enum port port);
417417
bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
418418
bool is_trans_port_sync_master(const struct intel_crtc_state *state);
419+
u8 intel_crtc_joined_pipe_mask(const struct intel_crtc_state *crtc_state);
419420
bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
420421
bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
421422
u8 intel_crtc_bigjoiner_slave_pipes(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)