From nobody Mon Apr 6 23:59:22 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CBB13A5424 for ; Tue, 17 Mar 2026 10:27:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773743274; cv=none; b=aFX60J4MItLerl6XWscu7T2Vi+LQcAfPjFAtu7NTZffElc99Y56g8BX+eWjQFOaLfIPZe4M+zI2F7unkuLV2xIvl1B53KAqxrhSpKh079FxQ36rHeGEsVk/aT5CqRm75ist3z2qFBXGP+Y7c/ffPBqBuziFJcL7M+lMwin6Ys1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773743274; c=relaxed/simple; bh=Wv9Le7mBgyQvDEQxKS0VD06CuMcA8Yv2iRruSyYTEdc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=sWfdNxSotMnaHGyJM4brNN6RZWwLnQRiwCBPifcGsBVbcsT0iX5sc8WWYyBecwgrcunWLePbYFevwi59l94yUHUJHvt/RjK11hXIdLx50hb6h4n92fwDbyZMBBDm7+/bKnUYpKa+dka9SvmRVtSFwjW6ZSRX2NLoYwT8geMiAQc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Z5GpOGej; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=fwXgRfVO; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Z5GpOGej"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="fwXgRfVO" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 62H60QGX1622349 for ; Tue, 17 Mar 2026 10:27:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=oMe9m9KfSB/KXji7mjTpys JkU6Pplkay44063+xqQ5s=; b=Z5GpOGejCL6ldjVxCEX0JIxga7tLISIpWEVlNj LnAstR20Kz1WEa+XLbBWC4V7Z+of0gMK0RDqQUEDG8eZcDe65xQH+gVQOU+JD+D2 nSH35sI9EkSpHn2iRJ6nl/6shk1N0OlzGwo391yt4SUa9U3wR0KxqSWurorzQbvO B6DC1glYQ7WXyHMjZZJOq7saYsrdvD7xrpA7zonp4t74LRf/zPOtHtsFss1XSXl5 HAV4Yi/+VYReV5cjZEi1M5SV/lNXntBAmkp7qKmVwUts6DXWSxmT0GC3VS/TMIu+ 9IVhIUaA2vU9ldsbqUCB8/DTyuG7YmHqsmh79gvnO2MrexUg== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cxhyem5fh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 17 Mar 2026 10:27:52 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-35a032cdd78so26992058a91.1 for ; Tue, 17 Mar 2026 03:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1773743271; x=1774348071; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=oMe9m9KfSB/KXji7mjTpysJkU6Pplkay44063+xqQ5s=; b=fwXgRfVOeH6KxIJ0u7jrYBUR1LpgNpYZ9YYhQKeiew95FQaefi4ZgsgeB4Sw3lr/bI rKv3HJTjWRa0eeIjzuPtm7P3WWUrz5PXstiGC2KFfXqi1V9jcoyzOxyZ5IwF4bDnZgug 2vVQQoEDtpcaZwAl2+i8yOcRwhkXHVYbnYp0LcYAnc3DcZ05ThlSmU7unIWzeCtcUg4G 4x5RZEFwWSGalx7w0KTG6o3tL8Q/BFgt23LdBpfBtAFjuSGydBy3N1KVty9/m9lTKiRK MVoxC7LczHXVtthepoi6YJ5DvbXa5GB3vxqEDopm7Y7dBXtUOmLkSuDG3YXHuTIn20Fu rxFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773743271; x=1774348071; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oMe9m9KfSB/KXji7mjTpysJkU6Pplkay44063+xqQ5s=; b=F7+qEA+o65KhudekkFZyX19c7Ap8za7i+CPLX+bjdhqwiVOVIKFKjsNeYmOO3yVXAc vt/zj2vWmBrtMtso5ugGlwlJ1SJxdeBpeQevtsOh4D0kgbHEXwIorqPPEDZqRzf1Yk8+ Eo4QQvW3nOhc5x4MrjoGokYWYQQ+3tJ9zVV1mA6T/ogMoSU5AgTg9Z2+iyk6BjAFNjZ9 eCTcRO8AAY3PVTJ8Tt200R6iWdKHXtSp+7V+EeD98bjrxsAFTUPm9ASUqk8D0PRLW2RK AvMUCU9rZdJUI90XcX0YKPSPux99jeHPYYuKUwOravFvj7NAvfl+e7yfA59aU9tGGR14 U0Rg== X-Forwarded-Encrypted: i=1; AJvYcCXCYAqwH+25EcdmL/GxZnwi8w2ooMhZFfK+4LDXytcsCdkx9VSCcNQKccoYHsJnkAnlTcWYIEzGyN/+uxY=@vger.kernel.org X-Gm-Message-State: AOJu0YwXWpRa3fxuZtWIqXd+I/aybOFRajzQqw6+XYuM3r//i8dLnfnf O/wUfHucrnaGGpfINmjcwqpxtm2lAthN0pftqIA/GJvVUcUb/Tve/kAnBjYo1WSHsW3R0jWBmK0 mrsw6FStFaxp58xc4viIA7gpkRXxkLT8jDBQh13enqqyiQOMR7wQ5HAD8rr8Ys263GuA= X-Gm-Gg: ATEYQzz30tCAMkSwjfOmSdGXQulqcqZiKf82BRcp8OTdubJYlEnhZWX5rvgfhaYMMj5 xgjw3Y2TFHw2DMr2ilaoDUyvnhhMQbpPeSfNNzKdZSUHoyQP/psiVlDiXh0vNcZPRF8eNlMonh/ CYqGNc8SuagH3ryhBff+YoSJwT+Y9agYxdPdNzeVvUnaHS4DGqv0xflDrf2jFK2Azsr0bHKbcT4 wUUgz+pWOKYIVmpdZX0X9NvR7eC6WdEQuVS1msfGSIXAOwFbX1+u+VRUGcRM2bQ1XbxV/RFrNfq alhIdEaCI5qQX1XbArMEPByvwhTgcl8G9KcoUK4M5+39q/C+c38NGg2rG8pldoSzu9+j6WZdK3c CVU1NE7dXwv8SjX2NJj8ex5wbpGp09a6aLXqOMuNjKz9CsAHq X-Received: by 2002:a17:90b:2241:b0:35b:9894:f6d5 with SMTP id 98e67ed59e1d1-35b9894fa75mr7396172a91.31.1773743271036; Tue, 17 Mar 2026 03:27:51 -0700 (PDT) X-Received: by 2002:a17:90b:2241:b0:35b:9894:f6d5 with SMTP id 98e67ed59e1d1-35b9894fa75mr7396138a91.31.1773743270420; Tue, 17 Mar 2026 03:27:50 -0700 (PDT) Received: from hu-mahap-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35badbcdad9sm3178589a91.16.2026.03.17.03.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2026 03:27:49 -0700 (PDT) From: Mahadevan P Date: Tue, 17 Mar 2026 15:57:23 +0530 Subject: [PATCH v2] drm/msm: default separate_gpu_kms to auto selection Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260317-separate_gpu_kms-v2-1-b027ca97b9fe@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAIosuWkC/1WNwQqDMBBEf0X23Ii7Wms99T+KSNBVQ6uxWZUW8 d8b7amXgTcwb1YQdoYF8mAFx4sRYwcPdAqg6vTQsjK1Z6CI0ijGVAmP2umJy3acy0cvKkpqqpq kviIT+NnouDHvQ3kvPHdGJus+x8OCe/uTEcW7jP9kCypUnFGMfGkwzc43KxK+Zv2sbN+HPqDYt u0L9CKNbLcAAAA= X-Change-ID: 20260316-separate_gpu_kms-04d2cf4d91e2 To: Rob Clark , Sean Paul , Konrad Dybcio , Akhil P Oommen , Dmitry Baryshkov , Abhinav Kumar , Jessica Zhang , Marijn Suijten , David Airlie , Simona Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mahadevan P X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1773743265; l=7486; i=mahadevan.p@oss.qualcomm.com; s=20250923; h=from:subject:message-id; bh=Wv9Le7mBgyQvDEQxKS0VD06CuMcA8Yv2iRruSyYTEdc=; b=6rO7FArB9QUjw17Logyyusd9M+STidugTXbhzouqb/h/Mqj1Vk/DKVx1ImkNL8WFr3VFfukjA eL9P0lRYq41Ba8Go3JfgHmZYoNGuWGCFG+/RyUohxOHdDRGtj52Gm2F X-Developer-Key: i=mahadevan.p@oss.qualcomm.com; a=ed25519; pk=wed9wuAek0VbCYfkANx7ujIG4VY0XfCYrffFKPN2p0Y= X-Proofpoint-GUID: 4EH7dtMmClaN2u47hbCEE218NZhrKxPv X-Proofpoint-ORIG-GUID: 4EH7dtMmClaN2u47hbCEE218NZhrKxPv X-Authority-Analysis: v=2.4 cv=KLxXzVFo c=1 sm=1 tr=0 ts=69b92ca8 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=5TsJt5EyTeYoDRTaIssA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzE3MDA5MiBTYWx0ZWRfXyob6YRHpoX// 35KyHeToJKoB2HgXWc+8O/FIR4S+EyWj791oToW8j0tobuyNamCpDoByqq4u9gWFXHKhcxZYxQL HbWbLrMQjxaJRbKRlECIenECm7GXxkcML7rU+rNQABrY8b4NH2gafNVj6op1Zn7IfkLtdIVwnYe CIi+/DbiizdVqQ3BTp+31ZYlGvKOGDfqfqURnI7uJIJ6o2qdp9dKIaxbWXgf1WSaLUXOfRRC+Xw OGk2JweGLeoj74Rswzg0ir8vS7uiMo03qkUEDO6/FIFeiWIHTI3Y91NGoaq9hXX2oArpOEPvWEp d8JSE/xHmQz0kTFs5swBi/qru+pKoyM0XeLZFLxjizo3Hdh86Od6OWzLyZDpOKaLuycjgtsdW/s C97cWnAQXxmBbkGrCULGVfN5V/U1rjxXhcl9C+0MFt/J2o0jLEfVjB0FfcR3AGjfF+3ode+Jewj Jnwg8Y/q836h+EkWQLg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-17_01,2026-03-16_06,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1011 bulkscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2603050001 definitions=main-2603170092 On platforms with multiple display subsystems, such as SA8775P, the GPU binds to the first display subsystem that probes. This implicit binding prevents subsequent display subsystems from probing successfully, breaking multi-display support. Use the tristate separate_gpu_kms module parameter with the default value set to auto (-1). In auto mode, the driver selects the binding behavior based on the number of GPUs and display subsystems. This allows display subsystems to probe independently when required, while preserving the existing single-card behavior on simpler systems. The separate_gpu_kms module parameter has the following semantics: -1 (auto, default): Select the binding mode based on hardware topology. If exactly one GPU and one display subsystem are present, bind them together to form a single DRM device. Otherwise, expose the GPU and display subsystems as separate DRM devices. 0: Always bind the GPU and display together to form a single DRM device. 1: Always expose the GPU and display subsystems as separate DRM devices. This ensures correct probing on multi-display platforms without affecting single-display, single-GPU systems. Signed-off-by: Mahadevan P --- Changes in v2: - EDITME: describe what is new in this series revision. - EDITME: use bulletpoints and terse descriptions. - Link to v1: https://lore.kernel.org/r/20260223-seperate_gpu_kms-v1-1-e823= 1e7f1685@oss.qualcomm.com --- Depends on: https://lore.kernel.org/lkml/20260124-adreno-module-table-v1-1-9c2dbb2638= b4@oss.qualcomm.com/ When separate_gpu_kms is enabled, the GPU and display drivers are probed independently. In this configuration, the Adreno GPU driver may no longer be loaded implicitly via the display subsystem. The referenced patch adds a MODULE_DEVICE_TABLE() entry for the Adreno GPU device, ensuring proper module autoloading based on device tree matching. This is required to guarantee that the GPU driver is loaded correctly when GPU and display probing are decoupled. Changes in v2: - Drop dependency on Lemans dual-DPU device tree changes as this patch works independently (Dmitry) - Switch separate_gpu_kms to tristate and default to auto mode (Rob) - Rename msm_gpu_no_components() to msm_separate_gpu_kms_components() f= or clarity - Link to v1: https://lore.kernel.org/r/20260223-seperate_gpu_kms-v1-1-= e8231e7f1685@oss.qualcomm.com --- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +- drivers/gpu/drm/msm/msm_drv.c | 52 ++++++++++++++++++++++++++= ---- drivers/gpu/drm/msm/msm_drv.h | 4 ++- drivers/gpu/drm/msm/msm_mdss.c | 15 +++++++++ 4 files changed, 64 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/m= sm/adreno/adreno_device.c index 4edfe80c5be7..e40648c05797 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -272,7 +272,7 @@ static const struct component_ops a3xx_ops =3D { static int adreno_probe(struct platform_device *pdev) { if (of_device_is_compatible(pdev->dev.of_node, "amd,imageon") || - msm_gpu_no_components()) + msm_separate_gpu_kms_components()) return msm_gpu_probe(pdev, &a3xx_ops); =20 return component_add(&pdev->dev, &a3xx_ops); diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index e5ab1e28851d..575d1aea7927 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -54,16 +54,54 @@ static bool modeset =3D true; MODULE_PARM_DESC(modeset, "Use kernel modesetting [KMS] (1=3Don (default),= 0=3Ddisable)"); module_param(modeset, bool, 0600); =20 -static bool separate_gpu_kms; -MODULE_PARM_DESC(separate_gpu_drm, "Use separate DRM device for the GPU (0= =3Dsingle DRM device for both GPU and display (default), 1=3Dtwo DRM device= s)"); -module_param(separate_gpu_kms, bool, 0400); +/* + * separate_gpu_kms (tristate): + * -1 (default): decide automatically based on hardware topology. Split = devices + * if there is more than one GPU or more than one display = master. + * 0: force single DRM device (bind display + GPU) + * 1: force separate DRM devices + */ +static int separate_gpu_kms =3D -1; +MODULE_PARM_DESC(separate_gpu_kms, + "Use separate DRM device for the GPU (-1=3Dauto (default), 0=3Dsingle D= RM device, 1=3Dseparate DRM devices)"); +module_param(separate_gpu_kms, int, 0400); =20 DECLARE_FAULT_ATTR(fail_gem_alloc); DECLARE_FAULT_ATTR(fail_gem_iova); =20 -bool msm_gpu_no_components(void) +static const struct of_device_id msm_gpu_match[]; +static int msm_count_gpus(void) +{ + struct device_node *np; + int count =3D 0; + + for_each_matching_node(np, msm_gpu_match) { + if (of_device_is_available(np) && adreno_has_gpu(np)) + count++; + } + + return count; +} + +static bool msm_separate_gpu_kms_auto(void) +{ + int gpus =3D msm_count_gpus(); + int mdss =3D msm_mdss_count_masters(); + + if (gpus <=3D 0 || mdss <=3D 0) + return false; + + /* If exactly one GPU and one display subsystem single card */ + return (gpus > 1) || (mdss > 1); +} + +bool msm_separate_gpu_kms_components(void) { - return separate_gpu_kms; + if (separate_gpu_kms =3D=3D 1) + return true; + if (separate_gpu_kms =3D=3D 0) + return false; + return msm_separate_gpu_kms_auto(); } =20 static int msm_drm_uninit(struct device *dev, const struct component_ops *= gpu_ops) @@ -1030,7 +1068,7 @@ static int add_gpu_components(struct device *dev, static int msm_drm_bind(struct device *dev) { return msm_drm_init(dev, - msm_gpu_no_components() ? + msm_separate_gpu_kms_components() ? &msm_kms_driver : &msm_driver, NULL); @@ -1069,7 +1107,7 @@ int msm_drv_probe(struct device *master_dev, return ret; } =20 - if (!msm_gpu_no_components()) { + if (!msm_separate_gpu_kms_components()) { ret =3D add_gpu_components(master_dev, &match); if (ret) return ret; diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 6d847d593f1a..64a5ad35f7a2 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -555,6 +555,8 @@ void msm_kms_shutdown(struct platform_device *pdev); =20 bool msm_disp_drv_should_bind(struct device *dev, bool dpu_driver); =20 -bool msm_gpu_no_components(void); +bool msm_separate_gpu_kms_components(void); + +int msm_mdss_count_masters(void); =20 #endif /* __MSM_DRV_H__ */ diff --git a/drivers/gpu/drm/msm/msm_mdss.c b/drivers/gpu/drm/msm/msm_mdss.c index 9047e8d9ee89..00e3ac7dab3a 100644 --- a/drivers/gpu/drm/msm/msm_mdss.c +++ b/drivers/gpu/drm/msm/msm_mdss.c @@ -73,6 +73,21 @@ static int msm_mdss_parse_data_bus_icc_path(struct devic= e *dev, return 0; } =20 +static const struct of_device_id mdss_dt_match[]; + +int msm_mdss_count_masters(void) +{ + struct device_node *np; + int count =3D 0; + + for_each_matching_node(np, mdss_dt_match) { + if (of_device_is_available(np)) + count++; + } + + return count; +} + static void msm_mdss_irq(struct irq_desc *desc) { struct msm_mdss *msm_mdss =3D irq_desc_get_handler_data(desc); --- base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900 change-id: 20260316-separate_gpu_kms-04d2cf4d91e2 Best regards, --=20 Mahadevan P