Skip to content

Commit 631ef2e

Browse files
committed
drm/i915/pps: pass intel_dp to pps_name()
Currently all of intel_pps.c passes struct intel_dp around. Do the same with pps_name() instead of passing both struct drm_i915_private and struct intel_pps. Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/f2a7fec4a2ff1f09cb73e6734604fae99ab6b11a.1725012870.git.jani.nikula@intel.com
1 parent 402bd11 commit 631ef2e

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

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

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ static void vlv_steal_power_sequencer(struct drm_i915_private *dev_priv,
2424
static void pps_init_delays(struct intel_dp *intel_dp);
2525
static void pps_init_registers(struct intel_dp *intel_dp, bool force_disable_vdd);
2626

27-
static const char *pps_name(struct drm_i915_private *i915,
28-
struct intel_pps *pps)
27+
static const char *pps_name(struct intel_dp *intel_dp)
2928
{
29+
struct intel_display *display = to_intel_display(intel_dp);
30+
struct drm_i915_private *i915 = to_i915(display->drm);
31+
struct intel_pps *pps = &intel_dp->pps;
32+
3033
if (IS_VALLEYVIEW(i915) || IS_CHERRYVIEW(i915)) {
3134
switch (pps->pps_pipe) {
3235
case INVALID_PIPE:
@@ -97,13 +100,13 @@ vlv_power_sequencer_kick(struct intel_dp *intel_dp)
97100
if (drm_WARN(&dev_priv->drm,
98101
intel_de_read(dev_priv, intel_dp->output_reg) & DP_PORT_EN,
99102
"skipping %s kick due to [ENCODER:%d:%s] being active\n",
100-
pps_name(dev_priv, &intel_dp->pps),
103+
pps_name(intel_dp),
101104
dig_port->base.base.base.id, dig_port->base.base.name))
102105
return;
103106

104107
drm_dbg_kms(&dev_priv->drm,
105108
"kicking %s for [ENCODER:%d:%s]\n",
106-
pps_name(dev_priv, &intel_dp->pps),
109+
pps_name(intel_dp),
107110
dig_port->base.base.base.id, dig_port->base.base.name);
108111

109112
/* Preserve the BIOS-computed detected bit. This is
@@ -227,7 +230,7 @@ vlv_power_sequencer_pipe(struct intel_dp *intel_dp)
227230

228231
drm_dbg_kms(&dev_priv->drm,
229232
"picked %s for [ENCODER:%d:%s]\n",
230-
pps_name(dev_priv, &intel_dp->pps),
233+
pps_name(intel_dp),
231234
dig_port->base.base.base.id, dig_port->base.base.name);
232235

233236
/* init power sequencer on this pipe and port */
@@ -340,7 +343,7 @@ vlv_initial_power_sequencer_setup(struct intel_dp *intel_dp)
340343
drm_dbg_kms(&dev_priv->drm,
341344
"[ENCODER:%d:%s] initial power sequencer: %s\n",
342345
dig_port->base.base.base.id, dig_port->base.base.name,
343-
pps_name(dev_priv, &intel_dp->pps));
346+
pps_name(intel_dp));
344347
}
345348

346349
static int intel_num_pps(struct drm_i915_private *i915)
@@ -424,12 +427,12 @@ pps_initial_setup(struct intel_dp *intel_dp)
424427
drm_dbg_kms(&i915->drm,
425428
"[ENCODER:%d:%s] no initial power sequencer, assuming %s\n",
426429
encoder->base.base.id, encoder->base.name,
427-
pps_name(i915, &intel_dp->pps));
430+
pps_name(intel_dp));
428431
} else {
429432
drm_dbg_kms(&i915->drm,
430433
"[ENCODER:%d:%s] initial power sequencer: %s\n",
431434
encoder->base.base.id, encoder->base.name,
432-
pps_name(i915, &intel_dp->pps));
435+
pps_name(intel_dp));
433436
}
434437

435438
return intel_pps_is_valid(intel_dp);
@@ -565,11 +568,11 @@ void intel_pps_check_power_unlocked(struct intel_dp *intel_dp)
565568
drm_WARN(&dev_priv->drm, 1,
566569
"[ENCODER:%d:%s] %s powered off while attempting AUX CH communication.\n",
567570
dig_port->base.base.base.id, dig_port->base.base.name,
568-
pps_name(dev_priv, &intel_dp->pps));
571+
pps_name(intel_dp));
569572
drm_dbg_kms(&dev_priv->drm,
570573
"[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
571574
dig_port->base.base.base.id, dig_port->base.base.name,
572-
pps_name(dev_priv, &intel_dp->pps),
575+
pps_name(intel_dp),
573576
intel_de_read(dev_priv, _pp_stat_reg(intel_dp)),
574577
intel_de_read(dev_priv, _pp_ctrl_reg(intel_dp)));
575578
}
@@ -603,7 +606,7 @@ static void wait_panel_status(struct intel_dp *intel_dp,
603606
drm_dbg_kms(&dev_priv->drm,
604607
"[ENCODER:%d:%s] %s mask: 0x%08x value: 0x%08x PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
605608
dig_port->base.base.base.id, dig_port->base.base.name,
606-
pps_name(dev_priv, &intel_dp->pps),
609+
pps_name(intel_dp),
607610
mask, value,
608611
intel_de_read(dev_priv, pp_stat_reg),
609612
intel_de_read(dev_priv, pp_ctrl_reg));
@@ -612,7 +615,7 @@ static void wait_panel_status(struct intel_dp *intel_dp,
612615
drm_err(&dev_priv->drm,
613616
"[ENCODER:%d:%s] %s panel status timeout: PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
614617
dig_port->base.base.base.id, dig_port->base.base.name,
615-
pps_name(dev_priv, &intel_dp->pps),
618+
pps_name(intel_dp),
616619
intel_de_read(dev_priv, pp_stat_reg),
617620
intel_de_read(dev_priv, pp_ctrl_reg));
618621

@@ -626,7 +629,7 @@ static void wait_panel_on(struct intel_dp *intel_dp)
626629

627630
drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] %s wait for panel power on\n",
628631
dig_port->base.base.base.id, dig_port->base.base.name,
629-
pps_name(i915, &intel_dp->pps));
632+
pps_name(intel_dp));
630633
wait_panel_status(intel_dp, IDLE_ON_MASK, IDLE_ON_VALUE);
631634
}
632635

@@ -637,7 +640,7 @@ static void wait_panel_off(struct intel_dp *intel_dp)
637640

638641
drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] %s wait for panel power off time\n",
639642
dig_port->base.base.base.id, dig_port->base.base.name,
640-
pps_name(i915, &intel_dp->pps));
643+
pps_name(intel_dp));
641644
wait_panel_status(intel_dp, IDLE_OFF_MASK, IDLE_OFF_VALUE);
642645
}
643646

@@ -650,7 +653,7 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp)
650653

651654
drm_dbg_kms(&i915->drm, "[ENCODER:%d:%s] %s wait for panel power cycle\n",
652655
dig_port->base.base.base.id, dig_port->base.base.name,
653-
pps_name(i915, &intel_dp->pps));
656+
pps_name(intel_dp));
654657

655658
/* take the difference of current time and panel power off time
656659
* and then make panel wait for t11_t12 if needed. */
@@ -742,7 +745,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
742745

743746
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s turning VDD on\n",
744747
dig_port->base.base.base.id, dig_port->base.base.name,
745-
pps_name(dev_priv, &intel_dp->pps));
748+
pps_name(intel_dp));
746749

747750
if (!edp_have_panel_power(intel_dp))
748751
wait_panel_power_cycle(intel_dp);
@@ -754,7 +757,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
754757
intel_de_posting_read(dev_priv, pp_ctrl_reg);
755758
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
756759
dig_port->base.base.base.id, dig_port->base.base.name,
757-
pps_name(dev_priv, &intel_dp->pps),
760+
pps_name(intel_dp),
758761
intel_de_read(dev_priv, pp_stat_reg),
759762
intel_de_read(dev_priv, pp_ctrl_reg));
760763
/*
@@ -764,7 +767,7 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
764767
drm_dbg_kms(&dev_priv->drm,
765768
"[ENCODER:%d:%s] %s panel power wasn't enabled\n",
766769
dig_port->base.base.base.id, dig_port->base.base.name,
767-
pps_name(dev_priv, &intel_dp->pps));
770+
pps_name(intel_dp));
768771
msleep(intel_dp->pps.panel_power_up_delay);
769772
}
770773

@@ -792,7 +795,7 @@ void intel_pps_vdd_on(struct intel_dp *intel_dp)
792795
I915_STATE_WARN(i915, !vdd, "[ENCODER:%d:%s] %s VDD already requested on\n",
793796
dp_to_dig_port(intel_dp)->base.base.base.id,
794797
dp_to_dig_port(intel_dp)->base.base.name,
795-
pps_name(i915, &intel_dp->pps));
798+
pps_name(intel_dp));
796799
}
797800

798801
static void intel_pps_vdd_off_sync_unlocked(struct intel_dp *intel_dp)
@@ -812,7 +815,7 @@ static void intel_pps_vdd_off_sync_unlocked(struct intel_dp *intel_dp)
812815

813816
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s turning VDD off\n",
814817
dig_port->base.base.base.id, dig_port->base.base.name,
815-
pps_name(dev_priv, &intel_dp->pps));
818+
pps_name(intel_dp));
816819

817820
pp = ilk_get_pp_control(intel_dp);
818821
pp &= ~EDP_FORCE_VDD;
@@ -826,7 +829,7 @@ static void intel_pps_vdd_off_sync_unlocked(struct intel_dp *intel_dp)
826829
/* Make sure sequencer is idle before allowing subsequent activity */
827830
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s PP_STATUS: 0x%08x PP_CONTROL: 0x%08x\n",
828831
dig_port->base.base.base.id, dig_port->base.base.name,
829-
pps_name(dev_priv, &intel_dp->pps),
832+
pps_name(intel_dp),
830833
intel_de_read(dev_priv, pp_stat_reg),
831834
intel_de_read(dev_priv, pp_ctrl_reg));
832835

@@ -907,7 +910,7 @@ void intel_pps_vdd_off_unlocked(struct intel_dp *intel_dp, bool sync)
907910
"[ENCODER:%d:%s] %s VDD not forced on",
908911
dp_to_dig_port(intel_dp)->base.base.base.id,
909912
dp_to_dig_port(intel_dp)->base.base.name,
910-
pps_name(dev_priv, &intel_dp->pps));
913+
pps_name(intel_dp));
911914

912915
intel_dp->pps.want_panel_vdd = false;
913916

@@ -931,13 +934,13 @@ void intel_pps_on_unlocked(struct intel_dp *intel_dp)
931934
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s turn panel power on\n",
932935
dp_to_dig_port(intel_dp)->base.base.base.id,
933936
dp_to_dig_port(intel_dp)->base.base.name,
934-
pps_name(dev_priv, &intel_dp->pps));
937+
pps_name(intel_dp));
935938

936939
if (drm_WARN(&dev_priv->drm, edp_have_panel_power(intel_dp),
937940
"[ENCODER:%d:%s] %s panel power already on\n",
938941
dp_to_dig_port(intel_dp)->base.base.base.id,
939942
dp_to_dig_port(intel_dp)->base.base.name,
940-
pps_name(dev_priv, &intel_dp->pps)))
943+
pps_name(intel_dp)))
941944
return;
942945

943946
wait_panel_power_cycle(intel_dp);
@@ -1005,12 +1008,12 @@ void intel_pps_off_unlocked(struct intel_dp *intel_dp)
10051008

10061009
drm_dbg_kms(&dev_priv->drm, "[ENCODER:%d:%s] %s turn panel power off\n",
10071010
dig_port->base.base.base.id, dig_port->base.base.name,
1008-
pps_name(dev_priv, &intel_dp->pps));
1011+
pps_name(intel_dp));
10091012

10101013
drm_WARN(&dev_priv->drm, !intel_dp->pps.want_panel_vdd,
10111014
"[ENCODER:%d:%s] %s need VDD to turn off panel\n",
10121015
dig_port->base.base.base.id, dig_port->base.base.name,
1013-
pps_name(dev_priv, &intel_dp->pps));
1016+
pps_name(intel_dp));
10141017

10151018
pp = ilk_get_pp_control(intel_dp);
10161019
/* We need to switch off panel power _and_ force vdd, for otherwise some
@@ -1146,7 +1149,7 @@ static void vlv_detach_power_sequencer(struct intel_dp *intel_dp)
11461149
*/
11471150
drm_dbg_kms(&dev_priv->drm,
11481151
"detaching %s from [ENCODER:%d:%s]\n",
1149-
pps_name(dev_priv, &intel_dp->pps),
1152+
pps_name(intel_dp),
11501153
dig_port->base.base.base.id, dig_port->base.base.name);
11511154
intel_de_write(dev_priv, pp_on_reg, 0);
11521155
intel_de_posting_read(dev_priv, pp_on_reg);
@@ -1219,7 +1222,7 @@ void vlv_pps_init(struct intel_encoder *encoder,
12191222

12201223
drm_dbg_kms(&dev_priv->drm,
12211224
"initializing %s for [ENCODER:%d:%s]\n",
1222-
pps_name(dev_priv, &intel_dp->pps),
1225+
pps_name(intel_dp),
12231226
encoder->base.base.id, encoder->base.name);
12241227

12251228
/* init power sequencer on this pipe and port */
@@ -1246,7 +1249,7 @@ static void pps_vdd_init(struct intel_dp *intel_dp)
12461249
drm_dbg_kms(&dev_priv->drm,
12471250
"[ENCODER:%d:%s] %s VDD left on by BIOS, adjusting state tracking\n",
12481251
dig_port->base.base.base.id, dig_port->base.base.name,
1249-
pps_name(dev_priv, &intel_dp->pps));
1252+
pps_name(intel_dp));
12501253
drm_WARN_ON(&dev_priv->drm, intel_dp->pps.vdd_wakeref);
12511254
intel_dp->pps.vdd_wakeref = intel_display_power_get(dev_priv,
12521255
intel_aux_power_domain(dig_port));

0 commit comments

Comments
 (0)