[PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together

Yongbang Shi posted 10 patches 3 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together
Posted by Yongbang Shi 3 months, 2 weeks ago
From: Baihan Li <libaihan@huawei.com>

If VGA and DP connected together, there will be only one can get crtc.
Add encoder possible_clones to support two connectors enable.

Fixes: 0ab6ea261c1f ("drm/hisilicon/hibmc: add dp module in hibmc")
Fixes: 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")
Signed-off-by: Baihan Li <libaihan@huawei.com>
Signed-off-by: Yongbang Shi <shiyongbang@huawei.com>
---
ChangeLog:
v1 -> v2:
  - don't tie VGA and DP status, suggested by Dmitry Baryshkov.
  - use crtc clone to let 2 connectors can display simultaneous
---
 drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index ac552c339671..289304500ab0 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -115,6 +115,8 @@ static const struct drm_mode_config_funcs hibmc_mode_funcs = {
 static int hibmc_kms_init(struct hibmc_drm_private *priv)
 {
 	struct drm_device *dev = &priv->dev;
+	struct drm_encoder *encoder;
+	u32 clone_mask = 0;
 	int ret;
 
 	ret = drmm_mode_config_init(dev);
@@ -154,6 +156,12 @@ static int hibmc_kms_init(struct hibmc_drm_private *priv)
 		return ret;
 	}
 
+	drm_for_each_encoder(encoder, dev)
+		clone_mask |= drm_encoder_mask(encoder);
+
+	drm_for_each_encoder(encoder, dev)
+		encoder->possible_clones = clone_mask;
+
 	return 0;
 }
 
-- 
2.33.0
Re: [PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together
Posted by Dmitry Baryshkov 3 months, 1 week ago
On Fri, Jun 20, 2025 at 05:31:01PM +0800, Yongbang Shi wrote:
> From: Baihan Li <libaihan@huawei.com>
> 
> If VGA and DP connected together, there will be only one can get crtc.
> Add encoder possible_clones to support two connectors enable.
> 
> Fixes: 0ab6ea261c1f ("drm/hisilicon/hibmc: add dp module in hibmc")
> Fixes: 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")
> Signed-off-by: Baihan Li <libaihan@huawei.com>
> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com>
> ---
> ChangeLog:
> v1 -> v2:
>   - don't tie VGA and DP status, suggested by Dmitry Baryshkov.
>   - use crtc clone to let 2 connectors can display simultaneous

How does this help? I had an impression that your hw can actually
display only either to DP or to VGA. Can it send the same (aka cloned)
video stream to both connectors at the same time?

> ---
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

-- 
With best wishes
Dmitry
Re: [PATCH v2 drm-dp 07/10] drm/hisilicon/hibmc: fix dp and vga cannot show together
Posted by Yongbang Shi 3 months, 1 week ago
> On Fri, Jun 20, 2025 at 05:31:01PM +0800, Yongbang Shi wrote:
>> From: Baihan Li <libaihan@huawei.com>
>>
>> If VGA and DP connected together, there will be only one can get crtc.
>> Add encoder possible_clones to support two connectors enable.
>>
>> Fixes: 0ab6ea261c1f ("drm/hisilicon/hibmc: add dp module in hibmc")
>> Fixes: 3c7623fb5bb6 ("drm/hisilicon/hibmc: Enable this hot plug detect of irq feature")
>> Signed-off-by: Baihan Li <libaihan@huawei.com>
>> Signed-off-by: Yongbang Shi <shiyongbang@huawei.com>
>> ---
>> ChangeLog:
>> v1 -> v2:
>>    - don't tie VGA and DP status, suggested by Dmitry Baryshkov.
>>    - use crtc clone to let 2 connectors can display simultaneous
> How does this help? I had an impression that your hw can actually
> display only either to DP or to VGA. Can it send the same (aka cloned)
> video stream to both connectors at the same time?

Right, we support it. We support using KVM remotely operated, and
local maintenance using DP at the same time. KVM and VGA are both
using VDAC connector in driver. Actually, there are three outputs showing
at the same time.

Thanks,
Baihan.


>> ---
>>   drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>