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: Implement CTL_PIPE_ACTIVE for v12.0 DPU

v12.0 DPU on SM8750 comes with new CTL_PIPE_ACTIVE register for
selective activation of pipes, which replaces earlier
dpu_hw_ctl_setup_blendstage() code path for newer devices.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/659630/
Link: https://lore.kernel.org/r/20250618-b4-sm8750-display-v7-11-a591c609743d@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Krzysztof Kozlowski and committed by
Dmitry Baryshkov
b567e928 8984f97c

+47 -2
+9
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 453 453 u32 lm_idx; 454 454 bool bg_alpha_enable = false; 455 455 DECLARE_BITMAP(active_fetch, SSPP_MAX); 456 + DECLARE_BITMAP(active_pipes, SSPP_MAX); 456 457 457 458 memset(active_fetch, 0, sizeof(active_fetch)); 459 + memset(active_pipes, 0, sizeof(active_pipes)); 458 460 drm_atomic_crtc_for_each_plane(plane, crtc) { 459 461 state = plane->state; 460 462 if (!state) ··· 474 472 bg_alpha_enable = true; 475 473 476 474 set_bit(pstate->pipe.sspp->idx, active_fetch); 475 + set_bit(pstate->pipe.sspp->idx, active_pipes); 477 476 _dpu_crtc_blend_setup_pipe(crtc, plane, 478 477 mixer, cstate->num_mixers, 479 478 pstate->stage, ··· 483 480 484 481 if (pstate->r_pipe.sspp) { 485 482 set_bit(pstate->r_pipe.sspp->idx, active_fetch); 483 + set_bit(pstate->r_pipe.sspp->idx, active_pipes); 486 484 _dpu_crtc_blend_setup_pipe(crtc, plane, 487 485 mixer, cstate->num_mixers, 488 486 pstate->stage, ··· 506 502 507 503 if (ctl->ops.set_active_fetch_pipes) 508 504 ctl->ops.set_active_fetch_pipes(ctl, active_fetch); 505 + 506 + if (ctl->ops.set_active_pipes) 507 + ctl->ops.set_active_pipes(ctl, active_pipes); 509 508 510 509 _dpu_crtc_program_lm_output_roi(crtc); 511 510 } ··· 536 529 mixer[i].lm_ctl); 537 530 if (mixer[i].lm_ctl->ops.set_active_fetch_pipes) 538 531 mixer[i].lm_ctl->ops.set_active_fetch_pipes(mixer[i].lm_ctl, NULL); 532 + if (mixer[i].lm_ctl->ops.set_active_pipes) 533 + mixer[i].lm_ctl->ops.set_active_pipes(mixer[i].lm_ctl, NULL); 539 534 } 540 535 541 536 /* initialize stage cfg */
+3
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 2197 2197 2198 2198 if (ctl->ops.set_active_fetch_pipes) 2199 2199 ctl->ops.set_active_fetch_pipes(ctl, NULL); 2200 + 2201 + if (ctl->ops.set_active_pipes) 2202 + ctl->ops.set_active_pipes(ctl, NULL); 2200 2203 } 2201 2204 } 2202 2205
+27 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
··· 42 42 #define CTL_INTF_FLUSH 0x110 43 43 #define CTL_CDM_FLUSH 0x114 44 44 #define CTL_PERIPH_FLUSH 0x128 45 + #define CTL_PIPE_ACTIVE 0x12c 45 46 #define CTL_INTF_MASTER 0x134 46 47 #define CTL_DSPP_n_FLUSH(n) ((0x13C) + ((n) * 4)) 47 48 ··· 682 681 if (ctx->ops.set_active_fetch_pipes) 683 682 ctx->ops.set_active_fetch_pipes(ctx, NULL); 684 683 684 + if (ctx->ops.set_active_pipes) 685 + ctx->ops.set_active_pipes(ctx, NULL); 686 + 685 687 if (cfg->intf) { 686 688 intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE); 687 689 intf_active &= ~BIT(cfg->intf - INTF_0); ··· 739 735 } 740 736 741 737 DPU_REG_WRITE(&ctx->hw, CTL_FETCH_PIPE_ACTIVE, val); 738 + } 739 + 740 + static void dpu_hw_ctl_set_active_pipes(struct dpu_hw_ctl *ctx, 741 + unsigned long *active_pipes) 742 + { 743 + int i; 744 + u32 val = 0; 745 + 746 + if (active_pipes) { 747 + for (i = 0; i < SSPP_MAX; i++) { 748 + if (test_bit(i, active_pipes) && 749 + fetch_tbl[i] != CTL_INVALID_BIT) 750 + val |= BIT(fetch_tbl[i]); 751 + } 752 + } 753 + 754 + DPU_REG_WRITE(&ctx->hw, CTL_PIPE_ACTIVE, val); 742 755 } 743 756 744 757 /** ··· 821 800 c->ops.trigger_pending = dpu_hw_ctl_trigger_pending; 822 801 c->ops.reset = dpu_hw_ctl_reset_control; 823 802 c->ops.wait_reset_status = dpu_hw_ctl_wait_reset_status; 824 - c->ops.clear_all_blendstages = dpu_hw_ctl_clear_all_blendstages; 825 - c->ops.setup_blendstage = dpu_hw_ctl_setup_blendstage; 803 + if (mdss_ver->core_major_ver < 12) { 804 + c->ops.clear_all_blendstages = dpu_hw_ctl_clear_all_blendstages; 805 + c->ops.setup_blendstage = dpu_hw_ctl_setup_blendstage; 806 + } else { 807 + c->ops.set_active_pipes = dpu_hw_ctl_set_active_pipes; 808 + } 826 809 c->ops.update_pending_flush_sspp = dpu_hw_ctl_update_pending_flush_sspp; 827 810 c->ops.update_pending_flush_mixer = dpu_hw_ctl_update_pending_flush_mixer; 828 811 if (mdss_ver->core_major_ver >= 7)
+8
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h
··· 258 258 259 259 void (*set_active_fetch_pipes)(struct dpu_hw_ctl *ctx, 260 260 unsigned long *fetch_active); 261 + 262 + /** 263 + * Set active pipes attached to this CTL 264 + * @ctx: ctl path ctx pointer 265 + * @active_pipes: bitmap of enum dpu_sspp 266 + */ 267 + void (*set_active_pipes)(struct dpu_hw_ctl *ctx, 268 + unsigned long *active_pipes); 261 269 }; 262 270 263 271 /**