From patchwork Tue May 30 16:31:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuogee Hsieh X-Patchwork-Id: 100998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2312608vqr; Tue, 30 May 2023 09:37:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6LXe+U/v8sFzY02TIsw+PagYe1SkGE3tOi+F9kFdX4yGsKYhASEoW7CVfs9qYZAbW+RbUk X-Received: by 2002:a05:6a00:2d1f:b0:63d:4752:4da3 with SMTP id fa31-20020a056a002d1f00b0063d47524da3mr3332131pfb.25.1685464668854; Tue, 30 May 2023 09:37:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685464668; cv=none; d=google.com; s=arc-20160816; b=T+0F2elk1hAP4bCAKwcjMp/UkFETaZMuDB+ubuzHTCagAVsXOnCs0IaykAexUNX2Yz 9SNA/+lSFXX6g7kN9IcO1zopDsFH+XdzsHyp6emnPg3FzvlRbF+NttU+pHgqhemPNRf5 WP36b7ok6ELG98lwBrxcqWPwac15/l+6BoxZaBzAyivESIWvTrqrKIYM8Uc+RK51vKXZ r75B6XjNWkvO3F4y6PohaxR7+VZjFOa9oxPIQ059F+Dahm42NU3EgayOo75l9CIHF8nt Zx/h1YMbBuqIjmwYIgUmx3HYcEnsP7C2+ta1TsStfKKI4xjJSLj5TTYpY78Em91+6kxJ ysIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/qk5Arae9koJJXy7bIAt35842+Qzx3zoMV+zQQQw4kI=; b=e1qEBKlGrIDK7NT5Yomsd8Q+i8jmg3lDe70T9Bu38MbH5WttraKlyVOFIQ1TDxedCX lqHjZsvL+IdCbW4A/y5RHBvLqR1gWdI5jIdqYv7QIWUG5YkeHkl7eiMGU32Y2Fd49+Tz iJ9FVRaoibZmQPfyoRd3FhwbrcvLZtDarP9X5pGi1UKnZggIZ2+Gd+elzKZrHz4Y5bZK Z8/bin2rN4sn9eiwXs7wcgnhGzgynxFMAYSiCvLoNOcRJIFwyUGbdH+abRpQKjRIiWci XGtLka2zyndBnFnnHCjh1oO+5jTgrYing4wskygJl21bsLmQvGdgT/SBefeSKtfN6HU0 6xzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=biqO9jFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020aa79a0a000000b0063b68fa0807si1964118pfj.263.2023.05.30.09.37.33; Tue, 30 May 2023 09:37:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=biqO9jFu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232634AbjE3QdY (ORCPT + 99 others); Tue, 30 May 2023 12:33:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbjE3QdQ (ORCPT ); Tue, 30 May 2023 12:33:16 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDA3DE8; Tue, 30 May 2023 09:32:42 -0700 (PDT) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34U6q4JT016736; Tue, 30 May 2023 16:32:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=/qk5Arae9koJJXy7bIAt35842+Qzx3zoMV+zQQQw4kI=; b=biqO9jFu3IfHcK/a0qeymb82oqcTsACrYzBnkkxdwodgEUh7oF2b4LxVpbwye6NniZ+O BEeZbUv+4EDx0TogbKx8WTuuMC+ftoFgXtMHr45lMB0K+ELiBzAILLTFfAWoLNwPvj1E OsN7VT3tIW31/HuheWCYnyfjZSg5h+12Ew9rWYEQs6TNO4SpIcX/qSwzE6nCdXsygaX8 L4DWx2iY2/vUMvx5gKADyAWuWtPmEYop4BlieZRoCOOhv+oNLRs1AmOx0nsNIRttHtF3 HSn7bTYsnd3IdIaJRfafnGAFuDHppOejgCT1aaNTqiqkc7NVoLKmPU9m8v1jNdYhDgdX HQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3qvws8jfb1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 May 2023 16:32:13 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 34UGWCN4014040 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 May 2023 16:32:12 GMT Received: from khsieh-linux1.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 30 May 2023 09:32:12 -0700 From: Kuogee Hsieh To: , , , , , , , , , , CC: Kuogee Hsieh , , , , , , , Subject: [PATCH v1 1/3] drm/msm/dsi: add msm_dsi_bridge_get_dsc_config() Date: Tue, 30 May 2023 09:31:56 -0700 Message-ID: <1685464318-25031-2-git-send-email-quic_khsieh@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1685464318-25031-1-git-send-email-quic_khsieh@quicinc.com> References: <1685464318-25031-1-git-send-email-quic_khsieh@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 03NlmzQi_F5c-MFnH4rhhFonno-nYrip X-Proofpoint-GUID: 03NlmzQi_F5c-MFnH4rhhFonno-nYrip X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-30_12,2023-05-30_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 suspectscore=0 mlxscore=0 adultscore=0 impostorscore=0 phishscore=0 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305300131 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767337800568591109?= X-GMAIL-MSGID: =?utf-8?q?1767337800568591109?= DSI is implemented as a DRM bridge. It is more logically to access DSI from outside world through DRM bridge structure. Add DSI bridge function msm_dsi_bridge_get_dsc_config() to retrieve DSC information. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dsi/dsi.c | 8 ++++++++ drivers/gpu/drm/msm/dsi/dsi.h | 2 ++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index baab79a..fa7fcb5 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -17,6 +17,14 @@ struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_dsi) return msm_dsi_host_get_dsc_config(msm_dsi->host); } +struct drm_dsc_config *msm_dsi_bridge_get_dsc_config(struct drm_bridge *bridge) +{ + int id = dsi_mgr_bridge_get_id(bridge); + struct msm_dsi *msm_dsi = dsi_mgr_get_dsi(id); + + return msm_dsi_host_get_dsc_config(msm_dsi->host); +} + static int dsi_get_phy(struct msm_dsi *msm_dsi) { struct platform_device *pdev = msm_dsi->pdev; diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index bd3763a..394f605 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -64,6 +64,8 @@ bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); void msm_dsi_manager_tpg_enable(void); +int dsi_mgr_bridge_get_id(struct drm_bridge *bridge); +struct msm_dsi *dsi_mgr_get_dsi(int id); /* msm dsi */ static inline bool msm_dsi_device_connected(struct msm_dsi *msm_dsi) diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 1bbac72..5a7ac338 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -60,7 +60,7 @@ static inline bool dsi_mgr_power_on_early(struct drm_bridge *bridge) } #endif -static inline struct msm_dsi *dsi_mgr_get_dsi(int id) +struct msm_dsi *dsi_mgr_get_dsi(int id) { return msm_dsim_glb.dsi[id]; } @@ -218,7 +218,7 @@ struct dsi_bridge { #define to_dsi_bridge(x) container_of(x, struct dsi_bridge, base) -static int dsi_mgr_bridge_get_id(struct drm_bridge *bridge) +int dsi_mgr_bridge_get_id(struct drm_bridge *bridge) { struct dsi_bridge *dsi_bridge = to_dsi_bridge(bridge); return dsi_bridge->id;