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

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dpu: get rid of struct dpu_rm_requirements

The struct dpu_rm_requirements was used to wrap display topology and
hw resources, which meant INTF indices. As of commit ef58e0ad3436
("drm/msm/dpu: get INTF blocks directly rather than through RM") the hw
resources struct was removed, leaving struct dpu_rm_requirements
containing a single field (topology). Remove the useless wrapper.

Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
[DB: dropped stray msm_drv.h inclusion]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/629259/
Link: https://lore.kernel.org/r/20241216-concurrent-wb-v4-5-fe220297a7f0@quicinc.com

+24 -50
+1 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 800 800 801 801 if (!crtc_state->active_changed || crtc_state->enable) 802 802 ret = dpu_rm_reserve(&dpu_kms->rm, global_state, 803 - drm_enc, crtc_state, topology); 803 + drm_enc, crtc_state, &topology); 804 804 if (!ret) 805 805 dpu_encoder_assign_crtc_resources(dpu_kms, drm_enc, 806 806 global_state, crtc_state);
+22 -48
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
··· 27 27 } 28 28 29 29 /** 30 - * struct dpu_rm_requirements - Reservation requirements parameter bundle 31 - * @topology: selected topology for the display 32 - */ 33 - struct dpu_rm_requirements { 34 - struct msm_display_topology topology; 35 - }; 36 - 37 - /** 38 30 * dpu_rm_init - Read hardware catalog and create reservation tracking objects 39 31 * for all HW blocks. 40 32 * @dev: Corresponding device for devres management ··· 233 241 * mixer in rm->pingpong_blks[]. 234 242 * @dspp_idx: output parameter, index of dspp block attached to the layer 235 243 * mixer in rm->dspp_blks[]. 236 - * @reqs: input parameter, rm requirements for HW blocks needed in the 237 - * datapath. 244 + * @topology: selected topology for the display 238 245 * Return: true if lm matches all requirements, false otherwise 239 246 */ 240 247 static bool _dpu_rm_check_lm_and_get_connected_blks(struct dpu_rm *rm, 241 248 struct dpu_global_state *global_state, 242 249 uint32_t enc_id, int lm_idx, int *pp_idx, int *dspp_idx, 243 - struct dpu_rm_requirements *reqs) 250 + struct msm_display_topology *topology) 244 251 { 245 252 const struct dpu_lm_cfg *lm_cfg; 246 253 int idx; ··· 264 273 } 265 274 *pp_idx = idx; 266 275 267 - if (!reqs->topology.num_dspp) 276 + if (!topology->num_dspp) 268 277 return true; 269 278 270 279 idx = lm_cfg->dspp - DSPP_0; ··· 286 295 static int _dpu_rm_reserve_lms(struct dpu_rm *rm, 287 296 struct dpu_global_state *global_state, 288 297 uint32_t enc_id, 289 - struct dpu_rm_requirements *reqs) 298 + struct msm_display_topology *topology) 290 299 291 300 { 292 301 int lm_idx[MAX_BLOCKS]; ··· 294 303 int dspp_idx[MAX_BLOCKS] = {0}; 295 304 int i, lm_count = 0; 296 305 297 - if (!reqs->topology.num_lm) { 298 - DPU_ERROR("invalid number of lm: %d\n", reqs->topology.num_lm); 306 + if (!topology->num_lm) { 307 + DPU_ERROR("invalid number of lm: %d\n", topology->num_lm); 299 308 return -EINVAL; 300 309 } 301 310 302 311 /* Find a primary mixer */ 303 312 for (i = 0; i < ARRAY_SIZE(rm->mixer_blks) && 304 - lm_count < reqs->topology.num_lm; i++) { 313 + lm_count < topology->num_lm; i++) { 305 314 if (!rm->mixer_blks[i]) 306 315 continue; 307 316 ··· 310 319 311 320 if (!_dpu_rm_check_lm_and_get_connected_blks(rm, global_state, 312 321 enc_id, i, &pp_idx[lm_count], 313 - &dspp_idx[lm_count], reqs)) { 322 + &dspp_idx[lm_count], topology)) { 314 323 continue; 315 324 } 316 325 317 326 ++lm_count; 318 327 319 328 /* Valid primary mixer found, find matching peers */ 320 - if (lm_count < reqs->topology.num_lm) { 329 + if (lm_count < topology->num_lm) { 321 330 int j = _dpu_rm_get_lm_peer(rm, i); 322 331 323 332 /* ignore the peer if there is an error or if the peer was already processed */ ··· 330 339 if (!_dpu_rm_check_lm_and_get_connected_blks(rm, 331 340 global_state, enc_id, j, 332 341 &pp_idx[lm_count], &dspp_idx[lm_count], 333 - reqs)) { 342 + topology)) { 334 343 continue; 335 344 } 336 345 ··· 339 348 } 340 349 } 341 350 342 - if (lm_count != reqs->topology.num_lm) { 351 + if (lm_count != topology->num_lm) { 343 352 DPU_DEBUG("unable to find appropriate mixers\n"); 344 353 return -ENAVAIL; 345 354 } ··· 348 357 global_state->mixer_to_enc_id[lm_idx[i]] = enc_id; 349 358 global_state->pingpong_to_enc_id[pp_idx[i]] = enc_id; 350 359 global_state->dspp_to_enc_id[dspp_idx[i]] = 351 - reqs->topology.num_dspp ? enc_id : 0; 360 + topology->num_dspp ? enc_id : 0; 352 361 353 362 trace_dpu_rm_reserve_lms(lm_idx[i] + LM_0, enc_id, 354 363 pp_idx[i] + PINGPONG_0); ··· 585 594 struct dpu_rm *rm, 586 595 struct dpu_global_state *global_state, 587 596 struct drm_encoder *enc, 588 - struct dpu_rm_requirements *reqs) 597 + struct msm_display_topology *topology) 589 598 { 590 599 int ret; 591 600 592 - ret = _dpu_rm_reserve_lms(rm, global_state, enc->base.id, reqs); 601 + ret = _dpu_rm_reserve_lms(rm, global_state, enc->base.id, topology); 593 602 if (ret) { 594 603 DPU_ERROR("unable to find appropriate mixers\n"); 595 604 return ret; 596 605 } 597 606 598 607 ret = _dpu_rm_reserve_ctls(rm, global_state, enc->base.id, 599 - &reqs->topology); 608 + topology); 600 609 if (ret) { 601 610 DPU_ERROR("unable to find appropriate CTL\n"); 602 611 return ret; 603 612 } 604 613 605 - ret = _dpu_rm_reserve_dsc(rm, global_state, enc, &reqs->topology); 614 + ret = _dpu_rm_reserve_dsc(rm, global_state, enc, topology); 606 615 if (ret) 607 616 return ret; 608 617 609 - if (reqs->topology.needs_cdm) { 618 + if (topology->needs_cdm) { 610 619 ret = _dpu_rm_reserve_cdm(rm, global_state, enc); 611 620 if (ret) { 612 621 DPU_ERROR("unable to find CDM blk\n"); ··· 615 624 } 616 625 617 626 return ret; 618 - } 619 - 620 - static int _dpu_rm_populate_requirements( 621 - struct drm_encoder *enc, 622 - struct dpu_rm_requirements *reqs, 623 - struct msm_display_topology req_topology) 624 - { 625 - reqs->topology = req_topology; 626 - 627 - DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d cdm: %d\n", 628 - reqs->topology.num_lm, reqs->topology.num_dsc, 629 - reqs->topology.num_intf, reqs->topology.needs_cdm); 630 - 631 - return 0; 632 627 } 633 628 634 629 static void _dpu_rm_clear_mapping(uint32_t *res_mapping, int cnt, ··· 670 693 struct dpu_global_state *global_state, 671 694 struct drm_encoder *enc, 672 695 struct drm_crtc_state *crtc_state, 673 - struct msm_display_topology topology) 696 + struct msm_display_topology *topology) 674 697 { 675 - struct dpu_rm_requirements reqs; 676 698 int ret; 677 699 678 700 /* Check if this is just a page-flip */ ··· 686 710 DRM_DEBUG_KMS("reserving hw for enc %d crtc %d\n", 687 711 enc->base.id, crtc_state->crtc->base.id); 688 712 689 - ret = _dpu_rm_populate_requirements(enc, &reqs, topology); 690 - if (ret) { 691 - DPU_ERROR("failed to populate hw requirements\n"); 692 - return ret; 693 - } 713 + DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d\n", 714 + topology->num_lm, topology->num_dsc, 715 + topology->num_intf); 694 716 695 - ret = _dpu_rm_make_reservation(rm, global_state, enc, &reqs); 717 + ret = _dpu_rm_make_reservation(rm, global_state, enc, topology); 696 718 if (ret) 697 719 DPU_ERROR("failed to reserve hw resources: %d\n", ret); 698 720
+1 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
··· 69 69 struct dpu_global_state *global_state, 70 70 struct drm_encoder *drm_enc, 71 71 struct drm_crtc_state *crtc_state, 72 - struct msm_display_topology topology); 72 + struct msm_display_topology *topology); 73 73 74 74 void dpu_rm_release(struct dpu_global_state *global_state, 75 75 struct drm_encoder *enc);