From 42b9e7680e34b3214ec51c3b065e3083283f2a17 Mon Sep 17 00:00:00 2001 From: Chaoyi Chen Date: Mon, 23 Oct 2023 16:24:23 +0800 Subject: [PATCH] drm/rockchip: lvds: using readable connector name when dual lvds enabled When we enable Dual LVDS, there will be the following output in the VOP summary node: $ cat /sys/kernel/debug/dri/0/summary ... Video Port1: ACTIVE Connector: LVDS-1 ... The connector information here is not clear enough. When Dual LVDS is enabled, both LVDS-0 and LVDS-1 will be enabled (but we will only expose one connector to user space for operation, which can shield the underlying differences). In addition, if only LVDS1 is enabled instead of using Dual LVDS, "LVDS-1" will also be printed here. In order to express this information more accurately, we will change the corresponding connector name to "LVDS-DUAL" when using Dual LVDS: $ cat /sys/kernel/debug/dri/0/summary ... Video Port1: ACTIVE Connector: LVDS-DUAL ... Change-Id: I9621338c8bdec4b32772c3558d55b5b426d3ccc4 Signed-off-by: Chaoyi Chen --- drivers/gpu/drm/rockchip/rockchip_lvds.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 2ebaa4ace104..805027ab6c60 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -731,6 +731,15 @@ static int rockchip_lvds_bind(struct device *dev, struct device *master, goto err_free_encoder; } + if (lvds->secondary) { + kfree(connector->name); + connector->name = kasprintf(GFP_KERNEL, "LVDS-DUAL"); + if (!connector->name) { + ret = -ENOMEM; + goto err_free_connector; + } + } + drm_connector_helper_add(connector, &rockchip_lvds_connector_helper_funcs);