Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/pmdemand: convert to struct intel_display

Going forward, struct intel_display is the main display device
structure. Convert pmdemand to it.

Cc: Gustavo Sousa <gustavo.sousa@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c1d92e9490013d5aba50fc1d1ebc0ee18e82cf7e.1735662324.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+101 -98
+2 -2
drivers/gpu/drm/i915/display/intel_display_driver.c
··· 233 233 if (ret < 0) 234 234 goto cleanup_vga; 235 235 236 - intel_pmdemand_init_early(i915); 236 + intel_pmdemand_init_early(display); 237 237 238 238 intel_power_domains_init_hw(display, false); 239 239 ··· 265 265 if (ret) 266 266 goto cleanup_vga_client_pw_domain_dmc; 267 267 268 - ret = intel_pmdemand_init(i915); 268 + ret = intel_pmdemand_init(display); 269 269 if (ret) 270 270 goto cleanup_vga_client_pw_domain_dmc; 271 271
+2 -2
drivers/gpu/drm/i915/display/intel_display_power.c
··· 1103 1103 slices_mask = BIT(DBUF_S1) | display->dbuf.enabled_slices; 1104 1104 1105 1105 if (DISPLAY_VER(display) >= 14) 1106 - intel_pmdemand_program_dbuf(dev_priv, slices_mask); 1106 + intel_pmdemand_program_dbuf(display, slices_mask); 1107 1107 1108 1108 /* 1109 1109 * Just power up at least 1 slice, we will ··· 1119 1119 gen9_dbuf_slices_update(dev_priv, 0); 1120 1120 1121 1121 if (DISPLAY_VER(display) >= 14) 1122 - intel_pmdemand_program_dbuf(dev_priv, 0); 1122 + intel_pmdemand_program_dbuf(display, 0); 1123 1123 } 1124 1124 1125 1125 static void gen12_dbuf_slices_config(struct intel_display *display)
+10 -7
drivers/gpu/drm/i915/display/intel_modeset_setup.c
··· 116 116 117 117 static void reset_encoder_connector_state(struct intel_encoder *encoder) 118 118 { 119 + struct intel_display *display = to_intel_display(encoder); 119 120 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 120 121 struct intel_pmdemand_state *pmdemand_state = 121 122 to_intel_pmdemand_state(i915->display.pmdemand.obj.state); ··· 129 128 continue; 130 129 131 130 /* Clear the corresponding bit in pmdemand active phys mask */ 132 - intel_pmdemand_update_phys_mask(i915, encoder, 131 + intel_pmdemand_update_phys_mask(display, encoder, 133 132 pmdemand_state, false); 134 133 135 134 set_encoder_for_connector(connector, NULL); ··· 153 152 154 153 static void intel_crtc_disable_noatomic_complete(struct intel_crtc *crtc) 155 154 { 155 + struct intel_display *display = to_intel_display(crtc); 156 156 struct drm_i915_private *i915 = to_i915(crtc->base.dev); 157 157 struct intel_bw_state *bw_state = 158 158 to_intel_bw_state(i915->display.bw.obj.state); ··· 187 185 bw_state->data_rate[pipe] = 0; 188 186 bw_state->num_active_planes[pipe] = 0; 189 187 190 - intel_pmdemand_update_port_clock(i915, pmdemand_state, pipe, 0); 188 + intel_pmdemand_update_port_clock(display, pmdemand_state, pipe, 0); 191 189 } 192 190 193 191 /* ··· 584 582 585 583 static void intel_sanitize_encoder(struct intel_encoder *encoder) 586 584 { 585 + struct intel_display *display = to_intel_display(encoder); 587 586 struct drm_i915_private *i915 = to_i915(encoder->base.dev); 588 587 struct intel_connector *connector; 589 588 struct intel_crtc *crtc = to_intel_crtc(encoder->base.crtc); ··· 616 613 encoder->base.name); 617 614 618 615 /* Clear the corresponding bit in pmdemand active phys mask */ 619 - intel_pmdemand_update_phys_mask(i915, encoder, 616 + intel_pmdemand_update_phys_mask(display, encoder, 620 617 pmdemand_state, false); 621 618 622 619 /* ··· 773 770 } 774 771 } 775 772 776 - intel_pmdemand_update_phys_mask(i915, encoder, 773 + intel_pmdemand_update_phys_mask(display, encoder, 777 774 pmdemand_state, 778 775 true); 779 776 } else { 780 - intel_pmdemand_update_phys_mask(i915, encoder, 777 + intel_pmdemand_update_phys_mask(display, encoder, 781 778 pmdemand_state, 782 779 false); 783 780 ··· 902 899 cdclk_state->min_voltage_level[crtc->pipe] = 903 900 crtc_state->min_voltage_level; 904 901 905 - intel_pmdemand_update_port_clock(i915, pmdemand_state, pipe, 902 + intel_pmdemand_update_port_clock(display, pmdemand_state, pipe, 906 903 crtc_state->port_clock); 907 904 908 905 intel_bw_crtc_update(bw_state, crtc_state); 909 906 } 910 907 911 - intel_pmdemand_init_pmdemand_params(i915, pmdemand_state); 908 + intel_pmdemand_init_pmdemand_params(display, pmdemand_state); 912 909 } 913 910 914 911 static void
+80 -80
drivers/gpu/drm/i915/display/intel_pmdemand.c
··· 74 74 static struct intel_pmdemand_state * 75 75 intel_atomic_get_pmdemand_state(struct intel_atomic_state *state) 76 76 { 77 - struct drm_i915_private *i915 = to_i915(state->base.dev); 77 + struct intel_display *display = to_intel_display(state); 78 78 struct intel_global_state *pmdemand_state = 79 79 intel_atomic_get_global_obj_state(state, 80 - &i915->display.pmdemand.obj); 80 + &display->pmdemand.obj); 81 81 82 82 if (IS_ERR(pmdemand_state)) 83 83 return ERR_CAST(pmdemand_state); ··· 88 88 static struct intel_pmdemand_state * 89 89 intel_atomic_get_old_pmdemand_state(struct intel_atomic_state *state) 90 90 { 91 - struct drm_i915_private *i915 = to_i915(state->base.dev); 91 + struct intel_display *display = to_intel_display(state); 92 92 struct intel_global_state *pmdemand_state = 93 93 intel_atomic_get_old_global_obj_state(state, 94 - &i915->display.pmdemand.obj); 94 + &display->pmdemand.obj); 95 95 96 96 if (!pmdemand_state) 97 97 return NULL; ··· 102 102 static struct intel_pmdemand_state * 103 103 intel_atomic_get_new_pmdemand_state(struct intel_atomic_state *state) 104 104 { 105 - struct drm_i915_private *i915 = to_i915(state->base.dev); 105 + struct intel_display *display = to_intel_display(state); 106 106 struct intel_global_state *pmdemand_state = 107 107 intel_atomic_get_new_global_obj_state(state, 108 - &i915->display.pmdemand.obj); 108 + &display->pmdemand.obj); 109 109 110 110 if (!pmdemand_state) 111 111 return NULL; ··· 113 113 return to_intel_pmdemand_state(pmdemand_state); 114 114 } 115 115 116 - int intel_pmdemand_init(struct drm_i915_private *i915) 116 + int intel_pmdemand_init(struct intel_display *display) 117 117 { 118 + struct drm_i915_private *i915 = to_i915(display->drm); 118 119 struct intel_pmdemand_state *pmdemand_state; 119 120 120 121 pmdemand_state = kzalloc(sizeof(*pmdemand_state), GFP_KERNEL); 121 122 if (!pmdemand_state) 122 123 return -ENOMEM; 123 124 124 - intel_atomic_global_obj_init(i915, &i915->display.pmdemand.obj, 125 + intel_atomic_global_obj_init(i915, &display->pmdemand.obj, 125 126 &pmdemand_state->base, 126 127 &intel_pmdemand_funcs); 127 128 128 - if (IS_DISPLAY_VERx100_STEP(i915, 1400, STEP_A0, STEP_C0)) 129 + if (IS_DISPLAY_VERx100_STEP(display, 1400, STEP_A0, STEP_C0)) 129 130 /* Wa_14016740474 */ 130 - intel_de_rmw(i915, XELPD_CHICKEN_DCPR_3, 0, DMD_RSP_TIMEOUT_DISABLE); 131 + intel_de_rmw(display, XELPD_CHICKEN_DCPR_3, 0, DMD_RSP_TIMEOUT_DISABLE); 131 132 132 133 return 0; 133 134 } 134 135 135 - void intel_pmdemand_init_early(struct drm_i915_private *i915) 136 + void intel_pmdemand_init_early(struct intel_display *display) 136 137 { 137 - mutex_init(&i915->display.pmdemand.lock); 138 - init_waitqueue_head(&i915->display.pmdemand.waitqueue); 138 + mutex_init(&display->pmdemand.lock); 139 + init_waitqueue_head(&display->pmdemand.waitqueue); 139 140 } 140 141 141 142 void 142 - intel_pmdemand_update_phys_mask(struct drm_i915_private *i915, 143 + intel_pmdemand_update_phys_mask(struct intel_display *display, 143 144 struct intel_encoder *encoder, 144 145 struct intel_pmdemand_state *pmdemand_state, 145 146 bool set_bit) 146 147 { 147 148 enum phy phy; 148 149 149 - if (DISPLAY_VER(i915) < 14) 150 + if (DISPLAY_VER(display) < 14) 150 151 return; 151 152 152 153 if (!encoder) ··· 165 164 } 166 165 167 166 void 168 - intel_pmdemand_update_port_clock(struct drm_i915_private *i915, 167 + intel_pmdemand_update_port_clock(struct intel_display *display, 169 168 struct intel_pmdemand_state *pmdemand_state, 170 169 enum pipe pipe, int port_clock) 171 170 { 172 - if (DISPLAY_VER(i915) < 14) 171 + if (DISPLAY_VER(display) < 14) 173 172 return; 174 173 175 174 pmdemand_state->ddi_clocks[pipe] = port_clock; 176 175 } 177 176 178 177 static void 179 - intel_pmdemand_update_max_ddiclk(struct drm_i915_private *i915, 178 + intel_pmdemand_update_max_ddiclk(struct intel_display *display, 180 179 struct intel_atomic_state *state, 181 180 struct intel_pmdemand_state *pmdemand_state) 182 181 { ··· 186 185 int i; 187 186 188 187 for_each_new_intel_crtc_in_state(state, crtc, new_crtc_state, i) 189 - intel_pmdemand_update_port_clock(i915, pmdemand_state, 188 + intel_pmdemand_update_port_clock(display, pmdemand_state, 190 189 crtc->pipe, 191 190 new_crtc_state->port_clock); 192 191 ··· 197 196 } 198 197 199 198 static void 200 - intel_pmdemand_update_connector_phys(struct drm_i915_private *i915, 199 + intel_pmdemand_update_connector_phys(struct intel_display *display, 201 200 struct intel_atomic_state *state, 202 201 struct drm_connector_state *conn_state, 203 202 bool set_bit, ··· 218 217 if (!crtc_state->hw.active) 219 218 return; 220 219 221 - intel_pmdemand_update_phys_mask(i915, encoder, pmdemand_state, 220 + intel_pmdemand_update_phys_mask(display, encoder, pmdemand_state, 222 221 set_bit); 223 222 } 224 223 225 224 static void 226 - intel_pmdemand_update_active_non_tc_phys(struct drm_i915_private *i915, 225 + intel_pmdemand_update_active_non_tc_phys(struct intel_display *display, 227 226 struct intel_atomic_state *state, 228 227 struct intel_pmdemand_state *pmdemand_state) 229 228 { ··· 238 237 continue; 239 238 240 239 /* First clear the active phys in the old connector state */ 241 - intel_pmdemand_update_connector_phys(i915, state, 240 + intel_pmdemand_update_connector_phys(display, state, 242 241 old_conn_state, false, 243 242 pmdemand_state); 244 243 245 244 /* Then set the active phys in new connector state */ 246 - intel_pmdemand_update_connector_phys(i915, state, 245 + intel_pmdemand_update_connector_phys(display, state, 247 246 new_conn_state, true, 248 247 pmdemand_state); 249 248 } ··· 254 253 } 255 254 256 255 static bool 257 - intel_pmdemand_encoder_has_tc_phy(struct drm_i915_private *i915, 256 + intel_pmdemand_encoder_has_tc_phy(struct intel_display *display, 258 257 struct intel_encoder *encoder) 259 258 { 260 259 return encoder && intel_encoder_is_tc(encoder); ··· 263 262 static bool 264 263 intel_pmdemand_connector_needs_update(struct intel_atomic_state *state) 265 264 { 266 - struct drm_i915_private *i915 = to_i915(state->base.dev); 265 + struct intel_display *display = to_intel_display(state); 267 266 struct drm_connector_state *old_conn_state; 268 267 struct drm_connector_state *new_conn_state; 269 268 struct drm_connector *connector; ··· 280 279 continue; 281 280 282 281 if (old_encoder == new_encoder || 283 - (intel_pmdemand_encoder_has_tc_phy(i915, old_encoder) && 284 - intel_pmdemand_encoder_has_tc_phy(i915, new_encoder))) 282 + (intel_pmdemand_encoder_has_tc_phy(display, old_encoder) && 283 + intel_pmdemand_encoder_has_tc_phy(display, new_encoder))) 285 284 continue; 286 285 287 286 return true; ··· 338 337 339 338 int intel_pmdemand_atomic_check(struct intel_atomic_state *state) 340 339 { 341 - struct drm_i915_private *i915 = to_i915(state->base.dev); 340 + struct intel_display *display = to_intel_display(state); 342 341 const struct intel_bw_state *new_bw_state; 343 342 const struct intel_cdclk_state *new_cdclk_state; 344 343 const struct intel_dbuf_state *new_dbuf_state; 345 344 struct intel_pmdemand_state *new_pmdemand_state; 346 345 347 - if (DISPLAY_VER(i915) < 14) 346 + if (DISPLAY_VER(display) < 14) 348 347 return 0; 349 348 350 349 if (!intel_pmdemand_needs_update(state)) ··· 366 365 if (IS_ERR(new_dbuf_state)) 367 366 return PTR_ERR(new_dbuf_state); 368 367 369 - if (DISPLAY_VER(i915) < 30) { 368 + if (DISPLAY_VER(display) < 30) { 370 369 new_pmdemand_state->params.active_dbufs = 371 370 min_t(u8, hweight8(new_dbuf_state->enabled_slices), 3); 372 371 new_pmdemand_state->params.active_pipes = 373 372 min_t(u8, hweight8(new_dbuf_state->active_pipes), 3); 374 373 } else { 375 374 new_pmdemand_state->params.active_pipes = 376 - min_t(u8, hweight8(new_dbuf_state->active_pipes), INTEL_NUM_PIPES(i915)); 375 + min_t(u8, hweight8(new_dbuf_state->active_pipes), INTEL_NUM_PIPES(display)); 377 376 } 378 377 379 378 new_cdclk_state = intel_atomic_get_cdclk_state(state); ··· 385 384 new_pmdemand_state->params.cdclk_freq_mhz = 386 385 DIV_ROUND_UP(new_cdclk_state->actual.cdclk, 1000); 387 386 388 - intel_pmdemand_update_max_ddiclk(i915, state, new_pmdemand_state); 387 + intel_pmdemand_update_max_ddiclk(display, state, new_pmdemand_state); 389 388 390 - intel_pmdemand_update_active_non_tc_phys(i915, state, new_pmdemand_state); 389 + intel_pmdemand_update_active_non_tc_phys(display, state, new_pmdemand_state); 391 390 392 391 /* 393 392 * Active_PLLs starts with 1 because of CDCLK PLL. ··· 408 407 return intel_atomic_lock_global_state(&new_pmdemand_state->base); 409 408 } 410 409 411 - static bool intel_pmdemand_check_prev_transaction(struct drm_i915_private *i915) 410 + static bool intel_pmdemand_check_prev_transaction(struct intel_display *display) 412 411 { 413 - return !(intel_de_wait_for_clear(i915, 412 + return !(intel_de_wait_for_clear(display, 414 413 XELPDP_INITIATE_PMDEMAND_REQUEST(1), 415 414 XELPDP_PMDEMAND_REQ_ENABLE, 10) || 416 - intel_de_wait_for_clear(i915, 415 + intel_de_wait_for_clear(display, 417 416 GEN12_DCPR_STATUS_1, 418 417 XELPDP_PMDEMAND_INFLIGHT_STATUS, 10)); 419 418 } 420 419 421 420 void 422 - intel_pmdemand_init_pmdemand_params(struct drm_i915_private *i915, 421 + intel_pmdemand_init_pmdemand_params(struct intel_display *display, 423 422 struct intel_pmdemand_state *pmdemand_state) 424 423 { 425 424 u32 reg1, reg2; 426 425 427 - if (DISPLAY_VER(i915) < 14) 426 + if (DISPLAY_VER(display) < 14) 428 427 return; 429 428 430 - mutex_lock(&i915->display.pmdemand.lock); 431 - if (drm_WARN_ON(&i915->drm, 432 - !intel_pmdemand_check_prev_transaction(i915))) { 429 + mutex_lock(&display->pmdemand.lock); 430 + if (drm_WARN_ON(display->drm, 431 + !intel_pmdemand_check_prev_transaction(display))) { 433 432 memset(&pmdemand_state->params, 0, 434 433 sizeof(pmdemand_state->params)); 435 434 goto unlock; 436 435 } 437 436 438 - reg1 = intel_de_read(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(0)); 437 + reg1 = intel_de_read(display, XELPDP_INITIATE_PMDEMAND_REQUEST(0)); 439 438 440 - reg2 = intel_de_read(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1)); 439 + reg2 = intel_de_read(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1)); 441 440 442 441 pmdemand_state->params.qclk_gv_bw = 443 442 REG_FIELD_GET(XELPDP_PMDEMAND_QCLK_GV_BW_MASK, reg1); ··· 453 452 pmdemand_state->params.ddiclk_max = 454 453 REG_FIELD_GET(XELPDP_PMDEMAND_DDICLK_FREQ_MASK, reg2); 455 454 456 - if (DISPLAY_VER(i915) >= 30) { 455 + if (DISPLAY_VER(display) >= 30) { 457 456 pmdemand_state->params.active_pipes = 458 457 REG_FIELD_GET(XE3_PMDEMAND_PIPES_MASK, reg1); 459 458 } else { ··· 467 466 } 468 467 469 468 unlock: 470 - mutex_unlock(&i915->display.pmdemand.lock); 469 + mutex_unlock(&display->pmdemand.lock); 471 470 } 472 471 473 - static bool intel_pmdemand_req_complete(struct drm_i915_private *i915) 472 + static bool intel_pmdemand_req_complete(struct intel_display *display) 474 473 { 475 - return !(intel_de_read(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1)) & 474 + return !(intel_de_read(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1)) & 476 475 XELPDP_PMDEMAND_REQ_ENABLE); 477 476 } 478 477 479 - static void intel_pmdemand_wait(struct drm_i915_private *i915) 478 + static void intel_pmdemand_wait(struct intel_display *display) 480 479 { 481 - if (!wait_event_timeout(i915->display.pmdemand.waitqueue, 482 - intel_pmdemand_req_complete(i915), 480 + if (!wait_event_timeout(display->pmdemand.waitqueue, 481 + intel_pmdemand_req_complete(display), 483 482 msecs_to_jiffies_timeout(10))) 484 - drm_err(&i915->drm, 483 + drm_err(display->drm, 485 484 "timed out waiting for Punit PM Demand Response\n"); 486 485 } 487 486 488 487 /* Required to be programmed during Display Init Sequences. */ 489 - void intel_pmdemand_program_dbuf(struct drm_i915_private *i915, 488 + void intel_pmdemand_program_dbuf(struct intel_display *display, 490 489 u8 dbuf_slices) 491 490 { 492 491 u32 dbufs = min_t(u32, hweight8(dbuf_slices), 3); 493 492 494 493 /* PM Demand only tracks active dbufs on pre-Xe3 platforms */ 495 - if (DISPLAY_VER(i915) >= 30) 494 + if (DISPLAY_VER(display) >= 30) 496 495 return; 497 496 498 - mutex_lock(&i915->display.pmdemand.lock); 499 - if (drm_WARN_ON(&i915->drm, 500 - !intel_pmdemand_check_prev_transaction(i915))) 497 + mutex_lock(&display->pmdemand.lock); 498 + if (drm_WARN_ON(display->drm, 499 + !intel_pmdemand_check_prev_transaction(display))) 501 500 goto unlock; 502 501 503 - intel_de_rmw(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(0), 502 + intel_de_rmw(display, XELPDP_INITIATE_PMDEMAND_REQUEST(0), 504 503 XELPDP_PMDEMAND_DBUFS_MASK, 505 504 REG_FIELD_PREP(XELPDP_PMDEMAND_DBUFS_MASK, dbufs)); 506 - intel_de_rmw(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0, 505 + intel_de_rmw(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0, 507 506 XELPDP_PMDEMAND_REQ_ENABLE); 508 507 509 - intel_pmdemand_wait(i915); 508 + intel_pmdemand_wait(display); 510 509 511 510 unlock: 512 - mutex_unlock(&i915->display.pmdemand.lock); 511 + mutex_unlock(&display->pmdemand.lock); 513 512 } 514 513 515 514 static void ··· 569 568 } 570 569 571 570 static void 572 - intel_pmdemand_program_params(struct drm_i915_private *i915, 571 + intel_pmdemand_program_params(struct intel_display *display, 573 572 const struct intel_pmdemand_state *new, 574 573 const struct intel_pmdemand_state *old, 575 574 bool serialized) 576 575 { 577 - struct intel_display *display = &i915->display; 578 576 bool changed = false; 579 577 u32 reg1, mod_reg1; 580 578 u32 reg2, mod_reg2; 581 579 582 - mutex_lock(&i915->display.pmdemand.lock); 583 - if (drm_WARN_ON(&i915->drm, 584 - !intel_pmdemand_check_prev_transaction(i915))) 580 + mutex_lock(&display->pmdemand.lock); 581 + if (drm_WARN_ON(display->drm, 582 + !intel_pmdemand_check_prev_transaction(display))) 585 583 goto unlock; 586 584 587 - reg1 = intel_de_read(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(0)); 585 + reg1 = intel_de_read(display, XELPDP_INITIATE_PMDEMAND_REQUEST(0)); 588 586 mod_reg1 = reg1; 589 587 590 - reg2 = intel_de_read(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1)); 588 + reg2 = intel_de_read(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1)); 591 589 mod_reg2 = reg2; 592 590 593 591 intel_pmdemand_update_params(display, new, old, &mod_reg1, &mod_reg2, 594 592 serialized); 595 593 596 594 if (reg1 != mod_reg1) { 597 - intel_de_write(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(0), 595 + intel_de_write(display, XELPDP_INITIATE_PMDEMAND_REQUEST(0), 598 596 mod_reg1); 599 597 changed = true; 600 598 } 601 599 602 600 if (reg2 != mod_reg2) { 603 - intel_de_write(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 601 + intel_de_write(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 604 602 mod_reg2); 605 603 changed = true; 606 604 } ··· 608 608 if (!changed) 609 609 goto unlock; 610 610 611 - drm_dbg_kms(&i915->drm, 611 + drm_dbg_kms(display->drm, 612 612 "initate pmdemand request values: (0x%x 0x%x)\n", 613 613 mod_reg1, mod_reg2); 614 614 615 - intel_de_rmw(i915, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0, 615 + intel_de_rmw(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0, 616 616 XELPDP_PMDEMAND_REQ_ENABLE); 617 617 618 - intel_pmdemand_wait(i915); 618 + intel_pmdemand_wait(display); 619 619 620 620 unlock: 621 - mutex_unlock(&i915->display.pmdemand.lock); 621 + mutex_unlock(&display->pmdemand.lock); 622 622 } 623 623 624 624 static bool ··· 630 630 631 631 void intel_pmdemand_pre_plane_update(struct intel_atomic_state *state) 632 632 { 633 - struct drm_i915_private *i915 = to_i915(state->base.dev); 633 + struct intel_display *display = to_intel_display(state); 634 634 const struct intel_pmdemand_state *new_pmdemand_state = 635 635 intel_atomic_get_new_pmdemand_state(state); 636 636 const struct intel_pmdemand_state *old_pmdemand_state = 637 637 intel_atomic_get_old_pmdemand_state(state); 638 638 639 - if (DISPLAY_VER(i915) < 14) 639 + if (DISPLAY_VER(display) < 14) 640 640 return; 641 641 642 642 if (!new_pmdemand_state || ··· 646 646 647 647 WARN_ON(!new_pmdemand_state->base.changed); 648 648 649 - intel_pmdemand_program_params(i915, new_pmdemand_state, 649 + intel_pmdemand_program_params(display, new_pmdemand_state, 650 650 old_pmdemand_state, 651 651 intel_atomic_global_state_is_serialized(state)); 652 652 } 653 653 654 654 void intel_pmdemand_post_plane_update(struct intel_atomic_state *state) 655 655 { 656 - struct drm_i915_private *i915 = to_i915(state->base.dev); 656 + struct intel_display *display = to_intel_display(state); 657 657 const struct intel_pmdemand_state *new_pmdemand_state = 658 658 intel_atomic_get_new_pmdemand_state(state); 659 659 const struct intel_pmdemand_state *old_pmdemand_state = 660 660 intel_atomic_get_old_pmdemand_state(state); 661 661 662 - if (DISPLAY_VER(i915) < 14) 662 + if (DISPLAY_VER(display) < 14) 663 663 return; 664 664 665 665 if (!new_pmdemand_state || ··· 669 669 670 670 WARN_ON(!new_pmdemand_state->base.changed); 671 671 672 - intel_pmdemand_program_params(i915, new_pmdemand_state, NULL, 672 + intel_pmdemand_program_params(display, new_pmdemand_state, NULL, 673 673 intel_atomic_global_state_is_serialized(state)); 674 674 }
+7 -7
drivers/gpu/drm/i915/display/intel_pmdemand.h
··· 9 9 #include <linux/types.h> 10 10 11 11 enum pipe; 12 - struct drm_i915_private; 13 12 struct intel_atomic_state; 14 13 struct intel_crtc_state; 14 + struct intel_display; 15 15 struct intel_encoder; 16 16 struct intel_global_state; 17 17 struct intel_plane_state; ··· 19 19 20 20 struct intel_pmdemand_state *to_intel_pmdemand_state(struct intel_global_state *obj_state); 21 21 22 - void intel_pmdemand_init_early(struct drm_i915_private *i915); 23 - int intel_pmdemand_init(struct drm_i915_private *i915); 24 - void intel_pmdemand_init_pmdemand_params(struct drm_i915_private *i915, 22 + void intel_pmdemand_init_early(struct intel_display *display); 23 + int intel_pmdemand_init(struct intel_display *display); 24 + void intel_pmdemand_init_pmdemand_params(struct intel_display *display, 25 25 struct intel_pmdemand_state *pmdemand_state); 26 - void intel_pmdemand_update_port_clock(struct drm_i915_private *i915, 26 + void intel_pmdemand_update_port_clock(struct intel_display *display, 27 27 struct intel_pmdemand_state *pmdemand_state, 28 28 enum pipe pipe, int port_clock); 29 - void intel_pmdemand_update_phys_mask(struct drm_i915_private *i915, 29 + void intel_pmdemand_update_phys_mask(struct intel_display *display, 30 30 struct intel_encoder *encoder, 31 31 struct intel_pmdemand_state *pmdemand_state, 32 32 bool clear_bit); 33 - void intel_pmdemand_program_dbuf(struct drm_i915_private *i915, 33 + void intel_pmdemand_program_dbuf(struct intel_display *display, 34 34 u8 dbuf_slices); 35 35 void intel_pmdemand_pre_plane_update(struct intel_atomic_state *state); 36 36 void intel_pmdemand_post_plane_update(struct intel_atomic_state *state);