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

drm/msm/dpu: inline dpu_plane_get_ctl_flush

There is no need to keep a separate function for calling into the ctl if
we already know all the details. Inline this function in the dpu_crtc.c

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/473152/
Link: https://lore.kernel.org/r/20220209172520.3719906-7-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Dmitry Baryshkov and committed by
Rob Clark
30da01af e64ad2d2

+8 -28
+8 -7
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 412 412 struct dpu_format *format; 413 413 struct dpu_hw_ctl *ctl = mixer->lm_ctl; 414 414 415 - u32 flush_mask; 416 415 uint32_t stage_idx, lm_idx; 417 416 int zpos_cnt[DPU_STAGE_MAX + 1] = { 0 }; 418 417 bool bg_alpha_enable = false; ··· 419 420 420 421 memset(fetch_active, 0, sizeof(fetch_active)); 421 422 drm_atomic_crtc_for_each_plane(plane, crtc) { 423 + enum dpu_sspp sspp_idx; 424 + 422 425 state = plane->state; 423 426 if (!state) 424 427 continue; ··· 431 430 pstate = to_dpu_plane_state(state); 432 431 fb = state->fb; 433 432 434 - dpu_plane_get_ctl_flush(plane, ctl, &flush_mask); 435 - set_bit(dpu_plane_pipe(plane), fetch_active); 433 + sspp_idx = dpu_plane_pipe(plane); 434 + set_bit(sspp_idx, fetch_active); 436 435 437 436 DRM_DEBUG_ATOMIC("crtc %d stage:%d - plane %d sspp %d fb %d\n", 438 437 crtc->base.id, 439 438 pstate->stage, 440 439 plane->base.id, 441 - dpu_plane_pipe(plane) - SSPP_VIG0, 440 + sspp_idx - SSPP_VIG0, 442 441 state->fb ? state->fb->base.id : -1); 443 442 444 443 format = to_dpu_format(msm_framebuffer_format(pstate->base.fb)); ··· 448 447 449 448 stage_idx = zpos_cnt[pstate->stage]++; 450 449 stage_cfg->stage[pstate->stage][stage_idx] = 451 - dpu_plane_pipe(plane); 450 + sspp_idx; 452 451 stage_cfg->multirect_index[pstate->stage][stage_idx] = 453 452 pstate->multirect_index; 454 453 455 454 trace_dpu_crtc_setup_mixer(DRMID(crtc), DRMID(plane), 456 455 state, pstate, stage_idx, 457 - dpu_plane_pipe(plane) - SSPP_VIG0, 456 + sspp_idx - SSPP_VIG0, 458 457 format->base.pixel_format, 459 458 fb ? fb->modifier : 0); 460 459 ··· 463 462 _dpu_crtc_setup_blend_cfg(mixer + lm_idx, 464 463 pstate, format); 465 464 466 - mixer[lm_idx].flush_mask |= flush_mask; 465 + mixer[lm_idx].flush_mask |= ctl->ops.get_bitmask_sspp(ctl, sspp_idx); 467 466 468 467 if (bg_alpha_enable && !format->alpha_enable) 469 468 mixer[lm_idx].mixer_op_mode = 0;
-12
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
··· 850 850 return 0; 851 851 } 852 852 853 - /** 854 - * dpu_plane_get_ctl_flush - get control flush for the given plane 855 - * @plane: Pointer to drm plane structure 856 - * @ctl: Pointer to hardware control driver 857 - * @flush_sspp: Pointer to sspp flush control word 858 - */ 859 - void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl, 860 - u32 *flush_sspp) 861 - { 862 - *flush_sspp = ctl->ops.get_bitmask_sspp(ctl, dpu_plane_pipe(plane)); 863 - } 864 - 865 853 static int dpu_plane_prepare_fb(struct drm_plane *plane, 866 854 struct drm_plane_state *new_state) 867 855 {
-9
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h
··· 65 65 enum dpu_sspp dpu_plane_pipe(struct drm_plane *plane); 66 66 67 67 /** 68 - * dpu_plane_get_ctl_flush - get control flush mask 69 - * @plane: Pointer to DRM plane object 70 - * @ctl: Pointer to control hardware 71 - * @flush_sspp: Pointer to sspp flush control word 72 - */ 73 - void dpu_plane_get_ctl_flush(struct drm_plane *plane, struct dpu_hw_ctl *ctl, 74 - u32 *flush_sspp); 75 - 76 - /** 77 68 * dpu_plane_flush - final plane operations before commit flush 78 69 * @plane: Pointer to drm plane structure 79 70 */