Lines Matching +full:performance +full:- +full:affecting
1 // SPDX-License-Identifier: MIT
26 u8 active_dbufs; /* pre-Xe3 only */
33 u8 scalers; /* pre-Xe3 only */
59 pmdemand_state = kmemdup(obj->state, sizeof(*pmdemand_state), GFP_KERNEL);
63 return &pmdemand_state->base;
83 &display->pmdemand.obj);
97 &display->pmdemand.obj);
111 &display->pmdemand.obj);
125 return -ENOMEM;
127 intel_atomic_global_obj_init(display, &display->pmdemand.obj,
128 &pmdemand_state->base,
140 mutex_init(&display->pmdemand.lock);
141 init_waitqueue_head(&display->pmdemand.waitqueue);
164 pmdemand_state->active_combo_phys_mask |= BIT(phy);
166 pmdemand_state->active_combo_phys_mask &= ~BIT(phy);
177 pmdemand_state->ddi_clocks[pipe] = port_clock;
192 crtc->pipe,
193 new_crtc_state->port_clock);
195 for (i = 0; i < ARRAY_SIZE(pmdemand_state->ddi_clocks); i++)
196 max_ddiclk = max(pmdemand_state->ddi_clocks[i], max_ddiclk);
198 pmdemand_state->params.ddiclk_max = DIV_ROUND_UP(max_ddiclk, 1000);
208 struct intel_encoder *encoder = to_intel_encoder(conn_state->best_encoder);
209 struct intel_crtc *crtc = to_intel_crtc(conn_state->crtc);
220 if (!crtc_state->hw.active)
237 for_each_oldnew_connector_in_state(&state->base, connector,
253 pmdemand_state->params.active_phys =
254 min_t(u16, hweight16(pmdemand_state->active_combo_phys_mask),
274 for_each_oldnew_connector_in_state(&state->base, connector,
277 to_intel_encoder(old_conn_state->best_encoder);
279 to_intel_encoder(new_conn_state->best_encoder);
312 if (new_crtc_state->port_clock != old_crtc_state->port_clock)
341 new_pmdemand_state->params.qclk_gv_index = 0;
342 new_pmdemand_state->params.qclk_gv_bw = intel_bw_qgv_point_peakbw(new_bw_state);
349 new_pmdemand_state->params.active_dbufs =
351 new_pmdemand_state->params.active_pipes =
354 new_pmdemand_state->params.active_pipes =
362 new_pmdemand_state->params.voltage_index =
364 new_pmdemand_state->params.cdclk_freq_mhz =
375 new_pmdemand_state->params.plls =
376 min_t(u16, new_pmdemand_state->params.active_phys + 1, 7);
382 new_pmdemand_state->params.scalers = 7;
384 if (state->base.allow_modeset)
385 return intel_atomic_serialize_global_state(&new_pmdemand_state->base);
387 return intel_atomic_lock_global_state(&new_pmdemand_state->base);
409 mutex_lock(&display->pmdemand.lock);
410 if (drm_WARN_ON(display->drm,
412 memset(&pmdemand_state->params, 0,
413 sizeof(pmdemand_state->params));
421 pmdemand_state->params.qclk_gv_bw =
423 pmdemand_state->params.voltage_index =
425 pmdemand_state->params.qclk_gv_index =
427 pmdemand_state->params.active_phys =
430 pmdemand_state->params.cdclk_freq_mhz =
432 pmdemand_state->params.ddiclk_max =
436 pmdemand_state->params.active_pipes =
439 pmdemand_state->params.active_pipes =
441 pmdemand_state->params.active_dbufs =
444 pmdemand_state->params.scalers =
449 mutex_unlock(&display->pmdemand.lock);
468 if (ret == -ETIMEDOUT)
469 drm_err(display->drm,
480 if (!wait_event_timeout(display->pmdemand.waitqueue,
483 drm_err(display->drm,
494 /* PM Demand only tracks active dbufs on pre-Xe3 platforms */
498 mutex_lock(&display->pmdemand.lock);
499 if (drm_WARN_ON(display->drm,
512 mutex_unlock(&display->pmdemand.lock);
524 * handling with some old operations, to avoid unexpected performance
531 * some parallel atomic commits affecting the pmdemand parameters. In
533 * as well. So in pre-plane case, we need to check the max of old, new
541 u32 old_val = old ? old->params.field : 0; \
542 u32 new_val = new->params.field; \
581 mutex_lock(&display->pmdemand.lock);
582 if (drm_WARN_ON(display->drm,
611 drm_dbg_kms(display->drm,
621 mutex_unlock(&display->pmdemand.lock);
628 return memcmp(&new->params, &old->params, sizeof(new->params)) != 0;
647 WARN_ON(!new_pmdemand_state->base.changed);
670 WARN_ON(!new_pmdemand_state->base.changed);