@@ -139,7 +139,7 @@ static int
139
139
_lnl_compute_aux_less_alpm_params (struct intel_dp * intel_dp ,
140
140
const struct intel_crtc_state * crtc_state )
141
141
{
142
- struct drm_i915_private * i915 = dp_to_i915 (intel_dp );
142
+ struct intel_display * display = to_intel_display (intel_dp );
143
143
int aux_less_wake_time , aux_less_wake_lines , silence_period ,
144
144
lfps_half_cycle ;
145
145
@@ -158,7 +158,7 @@ _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp,
158
158
lfps_half_cycle > PORT_ALPM_LFPS_CTL_LAST_LFPS_HALF_CYCLE_DURATION_MASK )
159
159
return false;
160
160
161
- if (i915 -> display . params .psr_safest_params )
161
+ if (display -> params .psr_safest_params )
162
162
aux_less_wake_lines = ALPM_CTL_AUX_LESS_WAKE_TIME_MASK ;
163
163
164
164
intel_dp -> alpm_parameters .aux_less_wake_lines = aux_less_wake_lines ;
@@ -171,10 +171,10 @@ _lnl_compute_aux_less_alpm_params(struct intel_dp *intel_dp,
171
171
static bool _lnl_compute_alpm_params (struct intel_dp * intel_dp ,
172
172
const struct intel_crtc_state * crtc_state )
173
173
{
174
- struct drm_i915_private * i915 = dp_to_i915 (intel_dp );
174
+ struct intel_display * display = to_intel_display (intel_dp );
175
175
int check_entry_lines ;
176
176
177
- if (DISPLAY_VER (i915 ) < 20 )
177
+ if (DISPLAY_VER (display ) < 20 )
178
178
return true;
179
179
180
180
/* ALPM Entry Check = 2 + CEILING( 5us /tline ) */
@@ -187,7 +187,7 @@ static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp,
187
187
if (!_lnl_compute_aux_less_alpm_params (intel_dp , crtc_state ))
188
188
return false;
189
189
190
- if (i915 -> display . params .psr_safest_params )
190
+ if (display -> params .psr_safest_params )
191
191
check_entry_lines = 15 ;
192
192
193
193
intel_dp -> alpm_parameters .check_entry_lines = check_entry_lines ;
@@ -212,9 +212,9 @@ static int tgl_io_buffer_wake_time(void)
212
212
213
213
static int io_buffer_wake_time (const struct intel_crtc_state * crtc_state )
214
214
{
215
- struct drm_i915_private * i915 = to_i915 (crtc_state -> uapi . crtc -> dev );
215
+ struct intel_display * display = to_intel_display (crtc_state );
216
216
217
- if (DISPLAY_VER (i915 ) >= 12 )
217
+ if (DISPLAY_VER (display ) >= 12 )
218
218
return tgl_io_buffer_wake_time ();
219
219
else
220
220
return skl_io_buffer_wake_time ();
@@ -223,7 +223,7 @@ static int io_buffer_wake_time(const struct intel_crtc_state *crtc_state)
223
223
bool intel_alpm_compute_params (struct intel_dp * intel_dp ,
224
224
const struct intel_crtc_state * crtc_state )
225
225
{
226
- struct drm_i915_private * i915 = dp_to_i915 (intel_dp );
226
+ struct intel_display * display = to_intel_display (intel_dp );
227
227
int io_wake_lines , io_wake_time , fast_wake_lines , fast_wake_time ;
228
228
int tfw_exit_latency = 20 ; /* eDP spec */
229
229
int phy_wake = 4 ; /* eDP spec */
@@ -236,9 +236,9 @@ bool intel_alpm_compute_params(struct intel_dp *intel_dp,
236
236
fast_wake_time = precharge + preamble + phy_wake +
237
237
tfw_exit_latency ;
238
238
239
- if (DISPLAY_VER (i915 ) >= 20 )
239
+ if (DISPLAY_VER (display ) >= 20 )
240
240
max_wake_lines = 68 ;
241
- else if (DISPLAY_VER (i915 ) >= 12 )
241
+ else if (DISPLAY_VER (display ) >= 12 )
242
242
max_wake_lines = 12 ;
243
243
else
244
244
max_wake_lines = 8 ;
@@ -255,7 +255,7 @@ bool intel_alpm_compute_params(struct intel_dp *intel_dp,
255
255
if (!_lnl_compute_alpm_params (intel_dp , crtc_state ))
256
256
return false;
257
257
258
- if (i915 -> display . params .psr_safest_params )
258
+ if (display -> params .psr_safest_params )
259
259
io_wake_lines = fast_wake_lines = max_wake_lines ;
260
260
261
261
/* According to Bspec lower limit should be set as 7 lines. */
@@ -269,15 +269,15 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
269
269
struct intel_crtc_state * crtc_state ,
270
270
struct drm_connector_state * conn_state )
271
271
{
272
- struct drm_i915_private * i915 = dp_to_i915 (intel_dp );
272
+ struct intel_display * display = to_intel_display (intel_dp );
273
273
struct drm_display_mode * adjusted_mode = & crtc_state -> hw .adjusted_mode ;
274
274
int waketime_in_lines , first_sdp_position ;
275
275
int context_latency , guardband ;
276
276
277
277
if (!intel_dp_is_edp (intel_dp ))
278
278
return ;
279
279
280
- if (DISPLAY_VER (i915 ) < 20 )
280
+ if (DISPLAY_VER (display ) < 20 )
281
281
return ;
282
282
283
283
if (!intel_dp -> as_sdp_supported )
@@ -309,13 +309,13 @@ void intel_alpm_lobf_compute_config(struct intel_dp *intel_dp,
309
309
static void lnl_alpm_configure (struct intel_dp * intel_dp ,
310
310
const struct intel_crtc_state * crtc_state )
311
311
{
312
- struct drm_i915_private * dev_priv = dp_to_i915 (intel_dp );
312
+ struct intel_display * display = to_intel_display (intel_dp );
313
313
enum transcoder cpu_transcoder = crtc_state -> cpu_transcoder ;
314
314
enum port port = dp_to_dig_port (intel_dp )-> base .port ;
315
315
u32 alpm_ctl ;
316
316
317
- if (DISPLAY_VER (dev_priv ) < 20 || (! intel_dp -> psr . sel_update_enabled &&
318
- !intel_dp_is_edp (intel_dp )))
317
+ if (DISPLAY_VER (display ) < 20 ||
318
+ (! intel_dp -> psr . sel_update_enabled && !intel_dp_is_edp (intel_dp )))
319
319
return ;
320
320
321
321
/*
@@ -329,16 +329,16 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp,
329
329
ALPM_CTL_AUX_LESS_SLEEP_HOLD_TIME_50_SYMBOLS |
330
330
ALPM_CTL_AUX_LESS_WAKE_TIME (intel_dp -> alpm_parameters .aux_less_wake_lines );
331
331
332
- intel_de_write (dev_priv ,
333
- PORT_ALPM_CTL (dev_priv , port ),
332
+ intel_de_write (display ,
333
+ PORT_ALPM_CTL (display , port ),
334
334
PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE |
335
335
PORT_ALPM_CTL_MAX_PHY_SWING_SETUP (15 ) |
336
336
PORT_ALPM_CTL_MAX_PHY_SWING_HOLD (0 ) |
337
337
PORT_ALPM_CTL_SILENCE_PERIOD (
338
338
intel_dp -> alpm_parameters .silence_period_sym_clocks ));
339
339
340
- intel_de_write (dev_priv ,
341
- PORT_ALPM_LFPS_CTL (dev_priv , port ),
340
+ intel_de_write (display ,
341
+ PORT_ALPM_LFPS_CTL (display , port ),
342
342
PORT_ALPM_LFPS_CTL_LFPS_CYCLE_COUNT (10 ) |
343
343
PORT_ALPM_LFPS_CTL_LFPS_HALF_CYCLE_DURATION (
344
344
intel_dp -> alpm_parameters .lfps_half_cycle_num_of_syms ) |
@@ -356,7 +356,7 @@ static void lnl_alpm_configure(struct intel_dp *intel_dp,
356
356
357
357
alpm_ctl |= ALPM_CTL_ALPM_ENTRY_CHECK (intel_dp -> alpm_parameters .check_entry_lines );
358
358
359
- intel_de_write (dev_priv , ALPM_CTL (dev_priv , cpu_transcoder ), alpm_ctl );
359
+ intel_de_write (display , ALPM_CTL (display , cpu_transcoder ), alpm_ctl );
360
360
}
361
361
362
362
void intel_alpm_configure (struct intel_dp * intel_dp ,
@@ -368,14 +368,14 @@ void intel_alpm_configure(struct intel_dp *intel_dp,
368
368
static int i915_edp_lobf_info_show (struct seq_file * m , void * data )
369
369
{
370
370
struct intel_connector * connector = m -> private ;
371
- struct drm_i915_private * dev_priv = to_i915 (connector -> base . dev );
371
+ struct intel_display * display = to_intel_display (connector );
372
372
struct drm_crtc * crtc ;
373
373
struct intel_crtc_state * crtc_state ;
374
374
enum transcoder cpu_transcoder ;
375
375
u32 alpm_ctl ;
376
376
int ret ;
377
377
378
- ret = drm_modeset_lock_single_interruptible (& dev_priv -> drm . mode_config .connection_mutex );
378
+ ret = drm_modeset_lock_single_interruptible (& display -> drm -> mode_config .connection_mutex );
379
379
if (ret )
380
380
return ret ;
381
381
@@ -387,14 +387,14 @@ static int i915_edp_lobf_info_show(struct seq_file *m, void *data)
387
387
388
388
crtc_state = to_intel_crtc_state (crtc -> state );
389
389
cpu_transcoder = crtc_state -> cpu_transcoder ;
390
- alpm_ctl = intel_de_read (dev_priv , ALPM_CTL (dev_priv , cpu_transcoder ));
390
+ alpm_ctl = intel_de_read (display , ALPM_CTL (display , cpu_transcoder ));
391
391
seq_printf (m , "LOBF status: %s\n" , str_enabled_disabled (alpm_ctl & ALPM_CTL_LOBF_ENABLE ));
392
392
seq_printf (m , "Aux-wake alpm status: %s\n" ,
393
393
str_enabled_disabled (!(alpm_ctl & ALPM_CTL_ALPM_AUX_LESS_ENABLE )));
394
394
seq_printf (m , "Aux-less alpm status: %s\n" ,
395
395
str_enabled_disabled (alpm_ctl & ALPM_CTL_ALPM_AUX_LESS_ENABLE ));
396
396
out :
397
- drm_modeset_unlock (& dev_priv -> drm . mode_config .connection_mutex );
397
+ drm_modeset_unlock (& display -> drm -> mode_config .connection_mutex );
398
398
399
399
return ret ;
400
400
}
@@ -403,10 +403,10 @@ DEFINE_SHOW_ATTRIBUTE(i915_edp_lobf_info);
403
403
404
404
void intel_alpm_lobf_debugfs_add (struct intel_connector * connector )
405
405
{
406
- struct drm_i915_private * i915 = to_i915 (connector -> base . dev );
406
+ struct intel_display * display = to_intel_display (connector );
407
407
struct dentry * root = connector -> base .debugfs_entry ;
408
408
409
- if (DISPLAY_VER (i915 ) < 20 ||
409
+ if (DISPLAY_VER (display ) < 20 ||
410
410
connector -> base .connector_type != DRM_MODE_CONNECTOR_eDP )
411
411
return ;
412
412
0 commit comments