mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 07:33:19 +02:00
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>
This commit is contained in:
parent
ad06972d53
commit
e8cd8224a3
|
|
@ -2569,6 +2569,38 @@ static int dpu_encoder_virt_add_phys_encs(
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* dpu_encoder_get_clones - Calculate the possible_clones for DPU encoder
|
||||
* @drm_enc: DRM encoder pointer
|
||||
* Returns: possible_clones mask
|
||||
*/
|
||||
uint32_t dpu_encoder_get_clones(struct drm_encoder *drm_enc)
|
||||
{
|
||||
struct drm_encoder *curr;
|
||||
int type = drm_enc->encoder_type;
|
||||
uint32_t clone_mask = drm_encoder_mask(drm_enc);
|
||||
|
||||
/*
|
||||
* Set writeback as possible clones of real-time DSI encoders and vice
|
||||
* versa
|
||||
*
|
||||
* Writeback encoders can't be clones of each other and DSI
|
||||
* encoders can't be clones of each other.
|
||||
*
|
||||
* TODO: Add DP encoders as valid possible clones for writeback encoders
|
||||
* (and vice versa) once concurrent writeback has been validated for DP
|
||||
*/
|
||||
drm_for_each_encoder(curr, drm_enc->dev) {
|
||||
if ((type == DRM_MODE_ENCODER_VIRTUAL &&
|
||||
curr->encoder_type == DRM_MODE_ENCODER_DSI) ||
|
||||
(type == DRM_MODE_ENCODER_DSI &&
|
||||
curr->encoder_type == DRM_MODE_ENCODER_VIRTUAL))
|
||||
clone_mask |= drm_encoder_mask(curr);
|
||||
}
|
||||
|
||||
return clone_mask;
|
||||
}
|
||||
|
||||
static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc,
|
||||
struct dpu_kms *dpu_kms,
|
||||
struct msm_display_info *disp_info)
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ enum dpu_intf_mode dpu_encoder_get_intf_mode(struct drm_encoder *encoder);
|
|||
|
||||
void dpu_encoder_virt_runtime_resume(struct drm_encoder *encoder);
|
||||
|
||||
uint32_t dpu_encoder_get_clones(struct drm_encoder *drm_enc);
|
||||
|
||||
struct drm_encoder *dpu_encoder_init(struct drm_device *dev,
|
||||
int drm_enc_mode,
|
||||
struct msm_display_info *disp_info);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* Copyright (C) 2013 Red Hat
|
||||
* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*
|
||||
* Author: Rob Clark <robdclark@gmail.com>
|
||||
*/
|
||||
|
|
@ -824,8 +824,11 @@ static int _dpu_kms_drm_obj_init(struct dpu_kms *dpu_kms)
|
|||
return ret;
|
||||
|
||||
num_encoders = 0;
|
||||
drm_for_each_encoder(encoder, dev)
|
||||
drm_for_each_encoder(encoder, dev) {
|
||||
num_encoders++;
|
||||
if (catalog->cwb_count > 0)
|
||||
encoder->possible_clones = dpu_encoder_get_clones(encoder);
|
||||
}
|
||||
|
||||
max_crtc_count = min(catalog->mixer_count, num_encoders);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user