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: Set possible clones for all encoders

Set writeback encoders as possible clones for DSI encoders and vice
versa.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/637498/
Link: https://lore.kernel.org/r/20250214-concurrent-wb-v6-14-a44c293cf422@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

authored by

Jessica Zhang and committed by
Dmitry Baryshkov
e8cd8224 ad06972d

+39 -2
+32
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
··· 2569 2569 return 0; 2570 2570 } 2571 2571 2572 + /** 2573 + * dpu_encoder_get_clones - Calculate the possible_clones for DPU encoder 2574 + * @drm_enc: DRM encoder pointer 2575 + * Returns: possible_clones mask 2576 + */ 2577 + uint32_t dpu_encoder_get_clones(struct drm_encoder *drm_enc) 2578 + { 2579 + struct drm_encoder *curr; 2580 + int type = drm_enc->encoder_type; 2581 + uint32_t clone_mask = drm_encoder_mask(drm_enc); 2582 + 2583 + /* 2584 + * Set writeback as possible clones of real-time DSI encoders and vice 2585 + * versa 2586 + * 2587 + * Writeback encoders can't be clones of each other and DSI 2588 + * encoders can't be clones of each other. 2589 + * 2590 + * TODO: Add DP encoders as valid possible clones for writeback encoders 2591 + * (and vice versa) once concurrent writeback has been validated for DP 2592 + */ 2593 + drm_for_each_encoder(curr, drm_enc->dev) { 2594 + if ((type == DRM_MODE_ENCODER_VIRTUAL && 2595 + curr->encoder_type == DRM_MODE_ENCODER_DSI) || 2596 + (type == DRM_MODE_ENCODER_DSI && 2597 + curr->encoder_type == DRM_MODE_ENCODER_VIRTUAL)) 2598 + clone_mask |= drm_encoder_mask(curr); 2599 + } 2600 + 2601 + return clone_mask; 2602 + } 2603 + 2572 2604 static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, 2573 2605 struct dpu_kms *dpu_kms, 2574 2606 struct msm_display_info *disp_info)
+2
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h
··· 60 60 61 61 void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder); 62 62 63 + uint32_t dpu_encoder_get_clones(struct drm_encoder *drm_enc); 64 + 63 65 struct drm_encoder *dpu_encoder_init(struct drm_device *dev, 64 66 int drm_enc_mode, 65 67 struct msm_display_info *disp_info);
+5 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
··· 2 2 /* 3 3 * Copyright (C) 2013 Red Hat 4 4 * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved. 5 - * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. 5 + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. 6 6 * 7 7 * Author: Rob Clark <robdclark@gmail.com> 8 8 */ ··· 824 824 return ret; 825 825 826 826 num_encoders = 0; 827 - drm_for_each_encoder(encoder, dev) 827 + drm_for_each_encoder(encoder, dev) { 828 828 num_encoders++; 829 + if (catalog->cwb_count > 0) 830 + encoder->possible_clones = dpu_encoder_get_clones(encoder); 831 + } 829 832 830 833 max_crtc_count = min(catalog->mixer_count, num_encoders); 831 834