From nobody Wed Dec 17 08:08:54 2025 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 6090522301 for ; Tue, 16 Jan 2024 22:22:37 +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=1705443758; cv=none; b=FxqnMQdt031GDrdcIR8iXS0XN57U9b5aUmDTEfNusqPt7zYF9hCwEZ6yCaKHnNI4yEiU68QFLCk9qGxokVA4rUPCexCi7+q8x05PR0/ahF5mX4Be+VvVccoCyUT7qctSy8qX2cFc4V/BBVWZI98pQA4lXVe57/CNXgL0/jqP5AU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443758; c=relaxed/simple; bh=FiYzZ9AnVho9qS5eyIx3V1JsUjnlxCXhj8N/Niy4d3w=; h=Received:DKIM-Signature:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Originating-IP: X-ClientProxiedBy:X-QCInternal:X-Proofpoint-Virus-Version: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=E0nMf705C2JBKxcy5hyc+wSFT9vp3afe5P6F4GHcRqRNAK7qiJ6XLYRCk7Ke0khWGbiMr3tGrj5xtxVRXpl1f5AsoUbqjBMCXCXNJlLwskIdYWodvIbv/qx+nWCMoU97Q1oIW1LLzGedhTK53eKEG0WDQLRbO1GyRImhFQuII88= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=YRcq8vxz; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="YRcq8vxz" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40GKuUi3019595; Tue, 16 Jan 2024 22:22:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=MFPWM5GBpWmAY6Bf2jzybp2l/7nikz060YYsWvLndjo =; b=YRcq8vxzgE5wgiQ8rjD1Tc7ghDWC8P2CN4R+q/9WVoSUBcooyZ6aMoYyu8H UK3WBzjd+IFiEmLVbMfLffeM8QqlLhKGp3vQ+YlmqyyiQ4ipRMkeMXYddhtCT1Bm KYGcqS7lSc1aK9p12VargWeOo5mgZAb+AZS5+D2sgY22Oh0Sa2wdNTvAd7Y6htvS wvwjWURcTZd9xZrfsMaAfCIrgzp5dmbbjCiE1fXxq7dCro6iRVkh+79QhruvGnda CA0G7AtEtyMVEGon/ASQnU3rqrEmrvsFffVI5UmgX3pBmsoLCbLtiCjohso1bhQM DKoMB7zv4ndc+P+VMNQpQfnFl4g== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vnymj0eyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:25 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40GMMOR7023919 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:24 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 14:22:24 -0800 From: Jessica Zhang Date: Tue, 16 Jan 2024 14:22:04 -0800 Subject: [PATCH RFC 1/4] drm/panel: add driver for simulated panel 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: <20240116-jz-test-sim-panel-v1-1-f9511f46c9c7@quicinc.com> References: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> In-Reply-To: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> To: Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: , , , Jessica Zhang X-Mailer: b4 0.13-dev-f0463 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705443743; l=6259; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=FiYzZ9AnVho9qS5eyIx3V1JsUjnlxCXhj8N/Niy4d3w=; b=XY7EXkLGbwnxZ9o8g4Ez/2xZdVEWsZ4Hom74ZsOJ3SpDOtUTm0OVZ9fQjDd8FjJBvyL33l7oG 4K5q5PvPZPfAwc8R320oPKBzVqo9jJrmiCOYYyVbTZ7gR1d64tjXen8 X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: gskj7KkfCmh0ED-vnJ0rtu5yw5vChADm X-Proofpoint-GUID: gskj7KkfCmh0ED-vnJ0rtu5yw5vChADm X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_01,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 malwarescore=0 phishscore=0 suspectscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160174 Add a driver for simulating panels. This module also supports a mode parameter for users to specify a custom mode. If no custom mode is set, it will fall back to a custom, hard-coded mode. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/panel/Kconfig | 9 ++ drivers/gpu/drm/panel/Makefile | 1 + drivers/gpu/drm/panel/panel-simulation.c | 147 +++++++++++++++++++++++++++= ++++ 3 files changed, 157 insertions(+) diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig index 99e14dc212ecb..d711ec170c586 100644 --- a/drivers/gpu/drm/panel/Kconfig +++ b/drivers/gpu/drm/panel/Kconfig @@ -107,6 +107,15 @@ config DRM_PANEL_SIMPLE that it can be automatically turned off when the panel goes into a low power state. =20 +config DRM_PANEL_SIMULATION + tristate "support for simulation panels" + depends on DRM_MIPI_DSI + help + DRM panel driver for simulated DSI panels. Enabling this config will + cause the physical panel driver to not be attached to the DT panel + node. After the kernel boots, users can load the module and specify a + custom mode using the driver modparams. + config DRM_PANEL_EDP tristate "support for simple Embedded DisplayPort panels" depends on OF diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile index d10c3de51c6db..5bc55357714ad 100644 --- a/drivers/gpu/drm/panel/Makefile +++ b/drivers/gpu/drm/panel/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_DRM_PANEL_BOE_TV101WUM_NL6) +=3D panel-boe-tv1= 01wum-nl6.o obj-$(CONFIG_DRM_PANEL_DSI_CM) +=3D panel-dsi-cm.o obj-$(CONFIG_DRM_PANEL_LVDS) +=3D panel-lvds.o obj-$(CONFIG_DRM_PANEL_SIMPLE) +=3D panel-simple.o +obj-$(CONFIG_DRM_PANEL_SIMULATION) +=3D panel-simulation.o obj-$(CONFIG_DRM_PANEL_EDP) +=3D panel-edp.o obj-$(CONFIG_DRM_PANEL_EBBG_FT8719) +=3D panel-ebbg-ft8719.o obj-$(CONFIG_DRM_PANEL_ELIDA_KD35T133) +=3D panel-elida-kd35t133.o diff --git a/drivers/gpu/drm/panel/panel-simulation.c b/drivers/gpu/drm/pan= el/panel-simulation.c new file mode 100644 index 0000000000000..081c03bea188d --- /dev/null +++ b/drivers/gpu/drm/panel/panel-simulation.c @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved. + +#include +#include + +#include +#include +#include +#include +#include + +static char sim_panel_mode[PATH_MAX]; + +module_param_string(mode, sim_panel_mode, sizeof(sim_panel_mode), 0644); +MODULE_PARM_DESC(mode, "Sim panel mode"); + +struct panel_simulation { + struct drm_panel base; + struct platform_device *platform; +} *sim_panel; + +static struct drm_display_mode panel_simulation_mode =3D { + .clock =3D 345830, + .hdisplay =3D 1080, + .hsync_start =3D 1175, + .hsync_end =3D 1176, + .htotal =3D 1216, + .vdisplay =3D 2340, + .vsync_start =3D 2365, + .vsync_end =3D 2366, + .vtotal =3D 2370, + .width_mm =3D 0, + .height_mm =3D 0, + .type =3D DRM_MODE_TYPE_DRIVER, +}; + +static int panel_simulation_parse_mode(void) +{ + int count; + struct drm_display_mode user_mode =3D { 0 }; + unsigned int vrefresh; + + if (sim_panel_mode[0] =3D=3D '\0') + return 0; + + count =3D sscanf(sim_panel_mode, "%hu,%hu,%hu,%hu,%hu,%hu,%hu,%hu-%u", + &user_mode.hdisplay, &user_mode.hsync_start, + &user_mode.hsync_end, &user_mode.htotal, + &user_mode.vdisplay, &user_mode.vsync_start, + &user_mode.vsync_end, &user_mode.vtotal, &vrefresh); + + if (count !=3D 9) + return -EINVAL; + + user_mode.clock =3D user_mode.htotal * user_mode.vtotal * vrefresh / 1000; + memcpy(&panel_simulation_mode, &user_mode, sizeof(struct drm_display_mode= )); + + return 0; +} + +static int panel_simulation_get_modes(struct drm_panel *panel, + struct drm_connector *connector) +{ + struct drm_display_mode *mode; + int ret; + + ret =3D panel_simulation_parse_mode(); + + mode =3D drm_mode_duplicate(connector->dev, &panel_simulation_mode); + if (!mode) + return -ENOMEM; + + drm_mode_set_name(mode); + mode->type =3D DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED; + connector->display_info.width_mm =3D mode->width_mm; + connector->display_info.height_mm =3D mode->height_mm; + drm_mode_probed_add(connector, mode); + + return 1; +} + +static const struct drm_panel_funcs panel_simulation_funcs =3D { + .get_modes =3D panel_simulation_get_modes, +}; + +static int panel_simulation_probe(struct mipi_dsi_device *dsi) +{ + struct panel_simulation *panel; + struct device *dev =3D &dsi->dev; + int ret; + + panel =3D devm_kzalloc(dev, sizeof(*panel), GFP_KERNEL); + if (!panel) + return -ENOMEM; + + mipi_dsi_set_drvdata(dsi, panel); + + dsi->lanes =3D 4; + dsi->format =3D MIPI_DSI_FMT_RGB888; + dsi->mode_flags =3D MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS; + + drm_panel_init(&panel->base, dev, &panel_simulation_funcs, DRM_MODE_CONNE= CTOR_DSI); + drm_panel_add(&panel->base); + + ret =3D mipi_dsi_attach(dsi); + if (ret) + drm_panel_remove(&panel->base); + + return ret; +} + +static void panel_simulation_remove(struct mipi_dsi_device *dsi) +{ + struct panel_simulation *panel =3D mipi_dsi_get_drvdata(dsi); + int err; + + err =3D mipi_dsi_detach(dsi); + if (err < 0) + dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", err); + + drm_panel_remove(&panel->base); + drm_panel_disable(&panel->base); + drm_panel_unprepare(&panel->base); +} + +static void panel_simulation_shutdown(struct mipi_dsi_device *dsi) +{ + struct panel_simulation *panel =3D dev_get_drvdata(&dsi->dev); + + drm_panel_disable(&panel->base); + drm_panel_unprepare(&panel->base); +} + +static struct mipi_dsi_driver panel_simulation_driver =3D { + .driver =3D { + .name =3D "panel_simulation", + }, + .probe =3D panel_simulation_probe, + .remove =3D panel_simulation_remove, + .shutdown =3D panel_simulation_shutdown, +}; +module_mipi_dsi_driver(panel_simulation_driver); + +MODULE_AUTHOR("Jessica Zhang "); +MODULE_DESCRIPTION("DRM Driver for Simulated Panels"); +MODULE_LICENSE("GPL"); --=20 2.43.0 From nobody Wed Dec 17 08:08:54 2025 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 5F21A2209F for ; Tue, 16 Jan 2024 22:22:37 +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=1705443758; cv=none; b=btEBX4lbMatGBvQ9eIMG5y15YtfqUX0sKJpuRUMmEKLymcsSGKhAm/62lXKhedYruYA2icAsfLiSEHv7EgqTzUblMEmu5RQxyBVeBjR/59eUZlhV3WTcO250sFdjlhYY1tTXzdj+TvyUXIGM7Qckdyk9qtG3QoNQlI4U8ToUnaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443758; c=relaxed/simple; bh=4exVjp7sl3jEyHqi/O64KXlGDRIagRnzpF/Qkfnhe10=; h=Received:DKIM-Signature:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Originating-IP: X-ClientProxiedBy:X-QCInternal:X-Proofpoint-Virus-Version: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=irAoZI6IfJJDoGdPQfBkSy6s6WO5JGoPQVazl0CPp9fZ4FCiktTkhpa5SikAl5A8J8xOosxUXQFnPZdXwYKeGE5BwR+caR6pojm7ekEh1zyi/gD31QOHmuFZjuNgTIBgmXuCj69ULf7SKeB9WPise8KlHV+fEzO2iwazppVTjdc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=KSq1LBJr; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KSq1LBJr" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40GLK9x0001662; Tue, 16 Jan 2024 22:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=X7pudHFbPhvig+cOVdw0OfswUXgRDwB047Kg839LXIg =; b=KSq1LBJrdL4bPUL5dRBgyyVhF0G0KbH+GPcclo8g1ojzdqhxTlgTgmF4WLP 8cp6UtQdnMF6j/lnb/0fqoxhpmGWv1wbg2tppMPEmsNdQF4pZmaY4zMV6lQvsY3p GDSgJSiLh+haZpt8g5C6QoXfgstOAjaI0GCil3K3rj+nh1NNoGEOwTCniA90FZXb mAkY25H1SYa6xKmmBePuzFnuqHJCClWaMbqD71e2lXJ/oEhjfUvSXjPwT47+wZ9O 3F5UMjdbMMObeWsgtgw8963fROeORCNrkTbdDf63Z6SKgOFFWwtlVcSnRje2fum+ oEE3712GHfHqe4UxbBsTNwyiY9g== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vnnajj3s8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:26 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40GMMO46001543 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:24 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 14:22:24 -0800 From: Jessica Zhang Date: Tue, 16 Jan 2024 14:22:05 -0800 Subject: [PATCH RFC 2/4] drm/dsi: Add API to register simulated DSI panel 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: <20240116-jz-test-sim-panel-v1-2-f9511f46c9c7@quicinc.com> References: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> In-Reply-To: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> To: Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: , , , Jessica Zhang X-Mailer: b4 0.13-dev-f0463 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705443743; l=2397; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=4exVjp7sl3jEyHqi/O64KXlGDRIagRnzpF/Qkfnhe10=; b=s+bAYnBaboUd1+InwjYXBosjD+zhAarjEiwUpa26kWQUIQJMRjqpzxuz9+CDjxRyilnNf3VkP Ykj3M2Voiq4D0NoRSu/VIbhdfgxAOK/Y5Fv4mmgwkPnfkn7s9wyphuQ X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: eC_wffRwQnb7km1OuZgQX2uX-BTEglnb X-Proofpoint-ORIG-GUID: eC_wffRwQnb7km1OuZgQX2uX-BTEglnb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 phishscore=0 bulkscore=0 mlxlogscore=968 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160174 Add new APIs to register a simulated panel. For drivers that want to support a simulated panel, they must call mipi_dsi_host_register_sim_panel(). Signed-off-by: Jessica Zhang --- drivers/gpu/drm/drm_mipi_dsi.c | 30 ++++++++++++++++++++++++++++++ include/drm/drm_mipi_dsi.h | 1 + 2 files changed, 31 insertions(+) diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c index 843a6dbda93a0..6996014990979 100644 --- a/drivers/gpu/drm/drm_mipi_dsi.c +++ b/drivers/gpu/drm/drm_mipi_dsi.c @@ -153,6 +153,24 @@ static int mipi_dsi_device_add(struct mipi_dsi_device = *dsi) return device_add(&dsi->dev); } =20 +#if IS_ENABLED(CONFIG_DRM_PANEL_SIMULATION) +static struct mipi_dsi_device *mipi_dsi_device_add_sim_panel(struct mipi_d= si_host *host) +{ + struct mipi_dsi_device_info info =3D { }; + + info.channel =3D 0; + info.node =3D NULL; + strscpy(info.type, "panel_simulation", sizeof(info.type)); + + return mipi_dsi_device_register_full(host, &info); +} +#else +static struct mipi_dsi_device *mipi_dsi_device_add_sim_panel(struct mipi_d= si_host *host) +{ + return ERR_PTR(-ENODEV); +} +#endif + #if IS_ENABLED(CONFIG_OF) static struct mipi_dsi_device * of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct device_node *nod= e) @@ -324,6 +342,18 @@ struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(st= ruct device_node *node) } EXPORT_SYMBOL(of_find_mipi_dsi_host_by_node); =20 +int mipi_dsi_host_register_sim_panel(struct mipi_dsi_host *host) +{ + mipi_dsi_device_add_sim_panel(host); + + mutex_lock(&host_lock); + list_add_tail(&host->list, &host_list); + mutex_unlock(&host_lock); + + return 0; +} +EXPORT_SYMBOL(mipi_dsi_host_register_sim_panel); + int mipi_dsi_host_register(struct mipi_dsi_host *host) { struct device_node *node; diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h index c0aec0d4d664e..4ca44b7b3efdb 100644 --- a/include/drm/drm_mipi_dsi.h +++ b/include/drm/drm_mipi_dsi.h @@ -107,6 +107,7 @@ struct mipi_dsi_host { struct list_head list; }; =20 +int mipi_dsi_host_register_sim_panel(struct mipi_dsi_host *host); int mipi_dsi_host_register(struct mipi_dsi_host *host); void mipi_dsi_host_unregister(struct mipi_dsi_host *host); struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *no= de); --=20 2.43.0 From nobody Wed Dec 17 08:08:54 2025 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 61EF722304 for ; Tue, 16 Jan 2024 22:22:37 +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=1705443758; cv=none; b=eeWH4HbEPeAc4NYbayio43DG6XQTK8hx4+31h1yykC/dNSO4oExX2/iSliFuh4XG1gMNr3NFO0fQIhtPEoiWjLlkHVI7UVNPEcRNYRweS5CXrySqZ/+qXa/UjLpx6FkS/n3+k68k8aEOxqqdFzm75SECQbSj4rQ2kDtSLlNnagE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443758; c=relaxed/simple; bh=YHox5H/93RZKO+ux/ZK/BUHphi1XV9Rb6lfG5SlsGPk=; h=Received:DKIM-Signature:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Originating-IP: X-ClientProxiedBy:X-QCInternal:X-Proofpoint-Virus-Version: X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=uOLCeyD5ofNzFGzOQIAe8+MYd2QUEYWalqRThFRUbYOPprq97Ldh1aK8qBSuidI15SrZDOvwS0FUf2SOGMkNFmrpBrR2PH42MelDmKxEGCc8tz/D9JlRbPfJ5Pn1HmylRrMidQrXEvyuYEKZYAwo4G9+XVyGysOMg6pFsMLGEBU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=Id9BOSD/; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Id9BOSD/" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40GLVFQk026055; Tue, 16 Jan 2024 22:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=854SqBsgeysKQXfyNn7Vkf0hrKCxp+OzdVC5nhRI4IE =; b=Id9BOSD/n2SykiqydoJytzrhNMHGquL7S7Wta1KLhYcOkgeM0s23KZDTNUd 3vjfztNGrAwE7OYBc1M4RJ8AnK3rs4+lpC6TwcbE8o7W9eMTmryneLvgwrFZfCis akUhSXX15VPAmM24AVHGgC9balJmK1xFI6APVkgjz3fxyirG+DAij/Wgr5hx6F2Y IKfXcnLWiQp3qLNv+qpdPGNTzaXt6F/DVbhLX7ZH2rywn/FcglyYvpkxMuT4+t/a MHlyiOo/SyRA9gOTCbCpq4EBosY9hb0014XKFK1QyBad7W/gPVZGf1BUUQPIgw5s YJaAZoc+j3XyooWN9ZI8Td0t4wA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vnnhmt4rb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:25 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40GMMOgQ001553 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:24 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 14:22:24 -0800 From: Jessica Zhang Date: Tue, 16 Jan 2024 14:22:06 -0800 Subject: [PATCH RFC 3/4] drm/panel: Introduce simulated panel bridge API 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: <20240116-jz-test-sim-panel-v1-3-f9511f46c9c7@quicinc.com> References: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> In-Reply-To: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> To: Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: , , , Jessica Zhang X-Mailer: b4 0.13-dev-f0463 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705443743; l=3852; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=YHox5H/93RZKO+ux/ZK/BUHphi1XV9Rb6lfG5SlsGPk=; b=28BQc2j6P7jSyGgeYvg37r1ZFOz3sQGWldrTxngOdp2PRfm8J0EHA7sW/AhINVl9+AkbUy0XN AH5IUluoNfcBchRlM3p+4y3qc8qvEZ2ADp8KLQllpUOMB+faNR1kKyf X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: IAcjjadV8E5X2K8vHTttE8BsOsX3NDXy X-Proofpoint-GUID: IAcjjadV8E5X2K8vHTttE8BsOsX3NDXy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 bulkscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 phishscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160174 Add separate bridge and drm_panel API for getting the simulated panel. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/bridge/panel.c | 24 ++++++++++++++++++++++++ drivers/gpu/drm/drm_panel.c | 33 +++++++++++++++++++++++++++++++++ include/drm/drm_bridge.h | 1 + include/drm/drm_panel.h | 1 + 4 files changed, 59 insertions(+) diff --git a/drivers/gpu/drm/bridge/panel.c b/drivers/gpu/drm/bridge/panel.c index e48823a4f1ede..87a83f4ce68a1 100644 --- a/drivers/gpu/drm/bridge/panel.c +++ b/drivers/gpu/drm/bridge/panel.c @@ -499,6 +499,30 @@ struct drm_connector *drm_panel_bridge_connector(struc= t drm_bridge *bridge) } EXPORT_SYMBOL(drm_panel_bridge_connector); =20 +/** + * drm_get_sim_panel_bridge - return the simulated panel bridge + * @dev: device to tie the bridge lifetime to + * + * This function will return a bridge for the simulated panel. + * + * Returns a pointer to the bridge if successful, or an error pointer + * otherwise. + */ +struct drm_bridge *drm_get_sim_panel_bridge(struct device *dev) +{ + struct drm_bridge *bridge; + struct drm_panel *panel; + + panel =3D drm_find_sim_panel(); + if (IS_ERR(panel)) + return ERR_PTR(-EPROBE_DEFER); + + bridge =3D devm_drm_panel_bridge_add(dev, panel); + + return bridge; +} +EXPORT_SYMBOL(drm_get_sim_panel_bridge); + #ifdef CONFIG_OF /** * devm_drm_of_get_bridge - Return next bridge in the chain diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index e814020bbcd3b..062541505fa74 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -290,6 +290,39 @@ int drm_panel_get_modes(struct drm_panel *panel, } EXPORT_SYMBOL(drm_panel_get_modes); =20 +/** + * drm_find_sim_panel - look up the simulated panel + * + * Searches for the simulated panel in the panel list. + * + * Return: A pointer to the simulated panel or an ERR_PTR() if the simulat= ed + * panel was not found in the panel list. + * + * Possible error codes returned by this function: + * - EPROBE_DEFER: the panel device has not been probed yet, and the caller + * should retry later +*/ +struct drm_panel *drm_find_sim_panel(void) +{ + struct drm_panel *panel; + + mutex_lock(&panel_lock); + + list_for_each_entry(panel, &panel_list, list) { + bool is_sim_panel =3D !strncmp(panel->dev->driver->name, + "panel_simulation", + strlen("panel_simulation")); + if (is_sim_panel) { + mutex_unlock(&panel_lock); + return panel; + } + } + + mutex_unlock(&panel_lock); + return ERR_PTR(-EPROBE_DEFER); +} +EXPORT_SYMBOL(drm_find_sim_panel); + #ifdef CONFIG_OF /** * of_drm_find_panel - look up a panel using a device tree node diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h index e39da5807ba71..941f1f825e2c6 100644 --- a/include/drm/drm_bridge.h +++ b/include/drm/drm_bridge.h @@ -927,6 +927,7 @@ static inline int drm_panel_bridge_set_orientation(stru= ct drm_connector *connect } #endif =20 +struct drm_bridge *drm_get_sim_panel_bridge(struct device *dev); #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL_BRIDGE) struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, struct devic= e_node *node, u32 port, u32 endpoint); diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 10015891b056f..c3a5944c35a91 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h @@ -283,6 +283,7 @@ int drm_panel_enable(struct drm_panel *panel); int drm_panel_disable(struct drm_panel *panel); =20 int drm_panel_get_modes(struct drm_panel *panel, struct drm_connector *con= nector); +struct drm_panel *drm_find_sim_panel(void); =20 #if defined(CONFIG_OF) && defined(CONFIG_DRM_PANEL) struct drm_panel *of_drm_find_panel(const struct device_node *np); --=20 2.43.0 From nobody Wed Dec 17 08:08:54 2025 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 5DB182209E for ; Tue, 16 Jan 2024 22:22:37 +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=1705443760; cv=none; b=bZhGNOTT7BxXQuE5GLeMKA9fSMFcCsJa53aguX40pIgY2vwPNdeF4mszj1vq1B+Of9GMZeKrJchLEJMbj6MLrGD4Hn++E0SMgET5t3GOLu4jU9GqktOAXHV4VWXWUwv7Q2yRGbszKYxe7a3CCxBrkMnhDoPrhUqZP2npVGggMKY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705443760; c=relaxed/simple; bh=G6H7BdeN/Ihqcy5woTkqJ3iH1GBNpVprDUyaGOsUtM0=; h=Received:DKIM-Signature:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Originating-IP: X-ClientProxiedBy:X-QCInternal:X-Proofpoint-Virus-Version: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=qPONokGh2FUKA36oO+H9CkYQUBXh5BQ5MvF4sET9w4UgfNgneXcc1epNQt53XHCq534QU5LzfIasanikFGbZuKL94i3gJGoaNhQg/MTtAVLMWfrw4o4EMJNGfroa5j559dRAr0LWXe/afDUfoom71Mn2g9y84mdgLaTwjxywTVc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=k4yF9wXf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="k4yF9wXf" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40GMHVC8018853; Tue, 16 Jan 2024 22:22:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=qcppdkim1; bh=hUoQUsfqmmEa3pzrtXgZQhTbgJ2D9+Maj4v0QuaJ2d0 =; b=k4yF9wXfntbrrHMEe/FPk7x4aR7R7gG2wnPeCSZx7gnljxDeXpTXhDPSRsH fnlS7uKvesFZnyHWzWVyyKxBPvaJ6evUQrgkULtyUvEmFt/7beRJ5RBkEJxBS5x8 zZvPrQK1aybKL4Igc64BkqADvIhvCTYJsFibgfVQwvtGCEAoQk55zAGWkpr4myy8 0rIszAF11PA2JtZMPboZv/3j00Li2a+ZHxUMqQgwPjoE0WehRVcnnSIZ2vyyKWVk MhkM1E/9ws29Q43OXHSHDr5FV5y3QRUBAVdE8HGvmebxa2V4nv/BQCWAHhBI1f3c IWY4uVyCXfQ0g7VB4kfeTMqW3Tg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vnmq0j53a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:26 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40GMMP3d013083 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Jan 2024 22:22:25 GMT Received: from jesszhan-linux.qualcomm.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 16 Jan 2024 14:22:24 -0800 From: Jessica Zhang Date: Tue, 16 Jan 2024 14:22:07 -0800 Subject: [PATCH RFC 4/4] drm/msm/dsi: Add simulated panel support 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: <20240116-jz-test-sim-panel-v1-4-f9511f46c9c7@quicinc.com> References: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> In-Reply-To: <20240116-jz-test-sim-panel-v1-0-f9511f46c9c7@quicinc.com> To: Neil Armstrong , Sam Ravnborg , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter CC: , , , Jessica Zhang X-Mailer: b4 0.13-dev-f0463 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705443743; l=2811; i=quic_jesszhan@quicinc.com; s=20230329; h=from:subject:message-id; bh=G6H7BdeN/Ihqcy5woTkqJ3iH1GBNpVprDUyaGOsUtM0=; b=qbG5XZZuJGvZKisIkwxFZNK1JX2l6Z9/mdYeFL9rVdsxD6AcIXXSXJlQHvVixFtRXUsEjLFKV pfCtSXBekMmCEsimCGU8yS2qJKh6Gj+ITSCIaaAcgeqV+8nuE7JrnFP X-Developer-Key: i=quic_jesszhan@quicinc.com; a=ed25519; pk=gAUCgHZ6wTJOzQa3U0GfeCDH7iZLlqIEPo4rrjfDpWE= X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 47l8lmtJLXXM-rGSFh8Gl5bZAQh4G-T- X-Proofpoint-ORIG-GUID: 47l8lmtJLXXM-rGSFh8Gl5bZAQh4G-T- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401160173 Introduce the sim_panel_enabled module parameter. When set, this parameter will force DSI to select the simulated panel instead of the physical panel. Signed-off-by: Jessica Zhang --- drivers/gpu/drm/msm/dsi/dsi.c | 4 ++++ drivers/gpu/drm/msm/dsi/dsi_host.c | 9 ++++++++- drivers/gpu/drm/msm/dsi/dsi_manager.c | 8 +++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index c6bd7bf15605c..daea84f5e3c0c 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -5,6 +5,10 @@ =20 #include "dsi.h" =20 +bool sim_panel_enabled; +MODULE_PARM_DESC(sim_panel_enabled, "Use simulated panel"); +module_param(sim_panel_enabled, bool, 0444); + bool msm_dsi_is_cmd_mode(struct msm_dsi *msm_dsi) { unsigned long host_flags =3D msm_dsi_host_get_mode_flags(msm_dsi->host); diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/d= si_host.c index deeecdfd6c4e4..fa0cab09fff71 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -35,6 +35,8 @@ =20 #define DSI_RESET_TOGGLE_DELAY_MS 20 =20 +extern bool sim_panel_enabled; + static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct d= rm_dsc_config *dsc); =20 static int dsi_get_version(const void __iomem *base, u32 *major, u32 *mino= r) @@ -2009,7 +2011,12 @@ int msm_dsi_host_register(struct mipi_dsi_host *host) if (!msm_host->registered) { host->dev =3D &msm_host->pdev->dev; host->ops =3D &dsi_host_ops; - ret =3D mipi_dsi_host_register(host); + + if (sim_panel_enabled) + ret =3D mipi_dsi_host_register_sim_panel(host); + else + ret =3D mipi_dsi_host_register(host); + if (ret) return ret; =20 diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/ds= i/dsi_manager.c index 896f369fdd535..e33e6be7309f2 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -30,6 +30,8 @@ struct msm_dsi_manager { =20 static struct msm_dsi_manager msm_dsim_glb; =20 +extern bool sim_panel_enabled; + #define IS_BONDED_DSI() (msm_dsim_glb.is_bonded_dsi) #define IS_SYNC_NEEDED() (msm_dsim_glb.is_sync_needed) #define IS_MASTER_DSI_LINK(id) (msm_dsim_glb.master_dsi_link_id =3D=3D id) @@ -507,7 +509,11 @@ int msm_dsi_manager_ext_bridge_init(u8 id) int ret; =20 int_bridge =3D msm_dsi->bridge; - ext_bridge =3D devm_drm_of_get_bridge(&msm_dsi->pdev->dev, + + if (sim_panel_enabled) + ext_bridge =3D drm_get_sim_panel_bridge(&msm_dsi->pdev->dev); + else + ext_bridge =3D devm_drm_of_get_bridge(&msm_dsi->pdev->dev, msm_dsi->pdev->dev.of_node, 1, 0); if (IS_ERR(ext_bridge)) return PTR_ERR(ext_bridge); --=20 2.43.0