From patchwork Thu Mar 28 14:40:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 783681 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9E91683A14; Thu, 28 Mar 2024 14:35:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636524; cv=none; b=U+v1QotvCPHo9yBvGtXBs04YkomFTdUdRJMLyBJVByaxQVgP0H7fzb027TjwypJj+hnLkwxv3yxP848eFCMJB91p9Y3Ujw2LDU7NXEfrRiwLd3A1vfoHh9neJH5R3PxDnVLMHjvQUUznEIVDus7IDv3piBAr415VLNx1FEUfQNc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636524; c=relaxed/simple; bh=qX+y/C0y9wroOwogb2KVMotUMDlmKrr2lqvWjHDmCwo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oGBCD2KZekawD4T+rlepeLMJ5xXhyIpmhSmLKHvJBXR19hM6wy7H/0KsdhNZTSa4TidYZg0MBcfeD5aB64x5BBZBT6hcrO/ncPbGOBYnc5BT2/GT55tWU15j1OTNqPT9V4KvtzVhLRs0xeADYhlg3GM1LFroul1hnBZx+t1K8lU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N/g6lUw/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N/g6lUw/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A2D2C43390; Thu, 28 Mar 2024 14:35:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711636524; bh=qX+y/C0y9wroOwogb2KVMotUMDlmKrr2lqvWjHDmCwo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=N/g6lUw/V5+Dn1CyziswhSJowu97u4s2RhHaKs24ha2wzOFHMoqhlqX2BSDHlRbnm sxw1PaqaqkBiZgk1IpkoVwIj47Q3DkNeVIAuP6fz+GGqC8pD6Dkcup8s7+jAdEZqhe 4QuVCV8VWhWafV3IRoz+tDEa1zogRKjZTbeptgp1+uYgHl/VkEUcoQ2XAW83PP1uSs WIJD30mQp+kr4HcqcJB2vUV4oxy4ZzDnchBxXdDnJZfJPfFfdJlFNRr3hBxiRSS9oS VIhScfqaP+TDrsKW8V/z1ezUpqX+HNsg+gsarvUgHqEFPKQo50PYZvZJFT1uFYVgS3 idaUjqX6hqWqg== From: Bjorn Andersson Date: Thu, 28 Mar 2024 07:40:00 -0700 Subject: [PATCH v2 1/6] drm/msm/dp: Drop unused dp_debug struct Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240328-msm-dp-cleanup-v2-1-a5aed9798d32@quicinc.com> References: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> In-Reply-To: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=5776; i=quic_bjorande@quicinc.com; h=from:subject:message-id; bh=gRF6CjyySMH8PFcvFDTXJIE5Z9XcpS26yBa7sMbPb1U=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBmBYFI0fEm6X/VhX6veAPV4GpPT5Pp0nKWhL7cJ GG6nfMN+g2JAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZgWBSBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcUijA//aLsOsxPQ4eBuQRlVBBO95JgSvcrEFoWsa8unR7u mZuelXjP6It8vFchV3wbS8nmeQcHONIo3LChOtkRW8Aqna2FXN0tzsyexU4bZWloYJgR/ycOfyx BLSqYot6KxTWnSZ9RiPq9Ntk0fdHj99isEnvaxRfjHEBCBQdohkfxqtSXXWdmlVM3k0kVGk247C t7PqiW7vC98HwNwjMT4IkZIGq6yfssP5Vjomm6e/97LBLKDkXprx75NTyISIbp3aBNbhxrDQh69 cIZ4TOtEo8A/FAlSlNiWpZQEV3DGeN5igqwjxK9fNroZwtJMSPdPlH509B1EGnLEW5o0sHfdN0w iXSFzjoZY8L7fLRC6bRAP5dx6+q1EiqKXvfzi7IP/r4wjrbRcyTzlckhdzpJsya6pXPhsWko4/c +ClMlN8nJfG5BedVa7nVUHqt0CVmQUq2EZQYok04NsuzyHCXnkrjD3LAuanB8rXl0OGd9m7JhY3 cmIMXJLyhfi/ZHnTcu3IGl45RJB/scuyl31PGN7Difgpt+SE0XmzZjgjP2JMSF7MTDZBDIgkazm 512UIWqbkA+FfVLjkKIs4ysOimrzcfjL14d6PVp4Kn0mAvJ2J/SVq3OkKQsJsQzn5yRY/c5doyD 6z4SYIMiFot3JUaFZUe/S6azMvlSdOMPyVWeZzVgFRSw= X-Developer-Key: i=quic_bjorande@quicinc.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 From: Bjorn Andersson The members of struct dp_debug are no longer used, so the only purpose of this struct is as a type of the return value of dp_debug_get(), to signal success/error. Drop the struct in favor of signalling the result of initialization using an int, then merge dp_debug_get() with dp_debug_init() to avoid the unnecessar boilerplate code. Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_debug.c | 59 +++++++++++-------------------------- drivers/gpu/drm/msm/dp/dp_debug.h | 38 +++++++----------------- drivers/gpu/drm/msm/dp/dp_display.c | 10 ++----- 3 files changed, 31 insertions(+), 76 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_debug.c b/drivers/gpu/drm/msm/dp/dp_debug.c index eca5a02f9003..b8611f6d2296 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.c +++ b/drivers/gpu/drm/msm/dp/dp_debug.c @@ -21,8 +21,6 @@ struct dp_debug_private { struct dp_link *link; struct dp_panel *panel; struct drm_connector *connector; - - struct dp_debug dp_debug; }; static int dp_debug_show(struct seq_file *seq, void *p) @@ -199,10 +197,24 @@ static const struct file_operations test_active_fops = { .write = dp_test_active_write }; -static void dp_debug_init(struct dp_debug *dp_debug, struct dentry *root, bool is_edp) +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, bool is_edp) { - struct dp_debug_private *debug = container_of(dp_debug, - struct dp_debug_private, dp_debug); + struct dp_debug_private *debug; + + if (!dev || !panel || !link) { + DRM_ERROR("invalid input\n"); + return -EINVAL; + } + + debug = devm_kzalloc(dev, sizeof(*debug), GFP_KERNEL); + if (!debug) + return -ENOMEM; + + debug->link = link; + debug->panel = panel; debugfs_create_file("dp_debug", 0444, root, debug, &dp_debug_fops); @@ -220,41 +232,6 @@ static void dp_debug_init(struct dp_debug *dp_debug, struct dentry *root, bool i root, debug, &dp_test_type_fops); } -} -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, bool is_edp) -{ - struct dp_debug_private *debug; - struct dp_debug *dp_debug; - int rc; - - if (!dev || !panel || !link) { - DRM_ERROR("invalid input\n"); - rc = -EINVAL; - goto error; - } - - debug = devm_kzalloc(dev, sizeof(*debug), GFP_KERNEL); - if (!debug) { - rc = -ENOMEM; - goto error; - } - - debug->dp_debug.debug_en = false; - debug->link = link; - debug->panel = panel; - - dp_debug = &debug->dp_debug; - dp_debug->vdisplay = 0; - dp_debug->hdisplay = 0; - dp_debug->vrefresh = 0; - - dp_debug_init(dp_debug, root, is_edp); - - return dp_debug; - error: - return ERR_PTR(rc); + return 0; } diff --git a/drivers/gpu/drm/msm/dp/dp_debug.h b/drivers/gpu/drm/msm/dp/dp_debug.h index 9b3b2e702f65..7e1aa892fc09 100644 --- a/drivers/gpu/drm/msm/dp/dp_debug.h +++ b/drivers/gpu/drm/msm/dp/dp_debug.h @@ -9,22 +9,6 @@ #include "dp_panel.h" #include "dp_link.h" -/** - * struct dp_debug - * @debug_en: specifies whether debug mode enabled - * @vdisplay: used to filter out vdisplay value - * @hdisplay: used to filter out hdisplay value - * @vrefresh: used to filter out vrefresh value - * @tpg_state: specifies whether tpg feature is enabled - */ -struct dp_debug { - bool debug_en; - int aspect_ratio; - int vdisplay; - int hdisplay; - int vrefresh; -}; - #if defined(CONFIG_DEBUG_FS) /** @@ -41,22 +25,22 @@ struct dp_debug { * This function sets up the debug module and provides a way * for debugfs input to be communicated with existing modules */ -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, - bool is_edp); +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, + bool is_edp); #else static inline -struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, - struct dp_link *link, - struct drm_connector *connector, - struct dentry *root, - bool is_edp) +int dp_debug_init(struct device *dev, struct dp_panel *panel, + struct dp_link *link, + struct drm_connector *connector, + struct dentry *root, + bool is_edp) { - return ERR_PTR(-EINVAL); + return -EINVAL; } #endif /* defined(CONFIG_DEBUG_FS) */ diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index c4cb82af5c2f..ba658c1637d1 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -93,7 +93,6 @@ struct dp_display_private { struct dp_link *link; struct dp_panel *panel; struct dp_ctrl *ctrl; - struct dp_debug *debug; struct dp_display_mode dp_mode; struct msm_dp dp_display; @@ -1431,14 +1430,9 @@ void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, boo dp = container_of(dp_display, struct dp_display_private, dp_display); dev = &dp->dp_display.pdev->dev; - dp->debug = dp_debug_get(dev, dp->panel, - dp->link, dp->dp_display.connector, - root, is_edp); - if (IS_ERR(dp->debug)) { - rc = PTR_ERR(dp->debug); + rc = dp_debug_init(dev, dp->panel, dp->link, dp->dp_display.connector, root, is_edp); + if (rc) DRM_ERROR("failed to initialize debug, rc = %d\n", rc); - dp->debug = NULL; - } } int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev, From patchwork Thu Mar 28 14:40:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 783680 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8A91312D771; Thu, 28 Mar 2024 14:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636526; cv=none; b=SRbRSpCHOS+w12//TF39+nb2B9P3A3/ksG5uqWS4VXKzw7h2mv6cMSaTzdTkN79CbfRHNdt+WjXQjVie9kM9/wovEFkyK9HvEm1OP4GVwXNbf/wsex0T6ZN39v9yBYskA2gY+zHxkgpItlIxiHN0DMuaADp8qQfHldwqCST4yNg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636526; c=relaxed/simple; bh=yM2ucf0TnrjTp+U0YtZ+wfFkMW3Re72cfSq+gd+m6/U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MRhLgbvK7gWdZToxwWkiQAMvIzgQM5YolxsDwbeTbpVJCLgVSWdFqHuddvPRqL0wFMlbXMyYU59awPQPVatdU5P3ydkuu0BlhzHFXrX4iwicXitXuN+ojE1nE3+xkQH5YaVw0pKW8xGe8oO4N0FVa4w937Oa/H6o39zRj8HMz5M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WGlJX8vJ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WGlJX8vJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55B6FC433A6; Thu, 28 Mar 2024 14:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711636526; bh=yM2ucf0TnrjTp+U0YtZ+wfFkMW3Re72cfSq+gd+m6/U=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WGlJX8vJ6uxCa5BgFtsUbUk5KfEOvZiAL9ncudbzRd9QAR8PdbVGYpS4cQjvd4bpk UX2uTnL8q/dOW+MQGLUX1hdFAcdpZgAhy9k1V1CghVaxWeo7mQFuhWddV5bya8S7+/ eqtL8T4XmYv1CDXsja0Svlu4die3rvVOt+elIAf6gobcm6L0aUI5MmSkyOVvTD19F7 +SFIbCuYo3fXaADWThENhdhLg8q5bu1ZdBrgXqXd0Bzna9tqX6psJTbfXZeGtS1cLa 1BIDnp/hv6Y98sH+xjpPXczHwTw5cgCbVMPQ9JCPFQaNgpnMjdBakq0xFAvewxDzup +G4ETAtFQq9KQ== From: Bjorn Andersson Date: Thu, 28 Mar 2024 07:40:02 -0700 Subject: [PATCH v2 3/6] drm/msm/dp: Remove unused defines and members Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240328-msm-dp-cleanup-v2-3-a5aed9798d32@quicinc.com> References: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> In-Reply-To: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=7434; i=quic_bjorande@quicinc.com; h=from:subject:message-id; bh=5e2Fgymk3p/LFIGuh5+30CkTONXaMlCwzGSvUAA6jyI=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBmBYFIFqlYo8ILDtFQPo6J8SX9eOA6ADBz9cHPm HFC0y82qZKJAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZgWBSBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcX58Q//VhgxoD8FmIQv3T+lSfL7e54mJ3fqx+FxUFr54D8 /6oLkMfJ55NxUzSJA2pF0Pjnyje9fIQZPZzIXztU7bA1Gz5bcYZRlOHPWxMcx1wkfRA5UiTldDz 8jDetKlfZM8MfyUR/0uv6hp8zCBYNPWsVMwNXyfKRYxDfyQh46NycTjkX6iShctKbfuKljO1+mU hxE7xaWXsnC5yaSCbjJVoTEopsXFoUi/g0v8dAjmGI+FN0g3RJNZkPagOVPmyDdchCVzfyLYYPP /Dw0jW8T9g/Be/pCb1pjhyaONga80ktlO4/KsBsNOrpSjwd+WPpepTWH5XDEDuS46Ohr1kx+ob2 B/5aEpwzjl+3/fFuBNksLCbVCf5Lmsk06MeowDEVRl4iNqXJ+Rrn2rwMBpdjlT2yQEkXUE2HKG7 gUTc3CuzU7DH/DK90M/sECI0hC+PIWePfKcs4RfxZ7lqHsUj5J5UWVGgsuBuLm1s5GT9lLe+hPF SPNg6BwZ8mVp0Woz33kIYK4H1csK82GwfCWV1MNfYEE1iC3VKkDlWiV0XanhtfW6UyR5NBNOjwa z5M9eLnZ1VHZXErevnbKTeCillfCl0hIwbie/KkjoJr4DMoHQTRaqxnA0p7fm3MuBq0C0YcgxMR RPC4TLiGsacOI3WAhRqNj9U7XRE9arIOIQkw9gQeElLo= X-Developer-Key: i=quic_bjorande@quicinc.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 From: Bjorn Andersson Throughout the Qualcomm Displayport driver a number of defines and struct members has become unused, but lingers in the code. Remove these. Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_audio.c | 5 ----- drivers/gpu/drm/msm/dp/dp_catalog.c | 1 - drivers/gpu/drm/msm/dp/dp_catalog.h | 17 ----------------- drivers/gpu/drm/msm/dp/dp_ctrl.h | 1 - drivers/gpu/drm/msm/dp/dp_display.c | 5 ----- drivers/gpu/drm/msm/dp/dp_display.h | 3 --- drivers/gpu/drm/msm/dp/dp_drm.c | 2 -- drivers/gpu/drm/msm/dp/dp_link.c | 4 ---- drivers/gpu/drm/msm/dp/dp_link.h | 1 - drivers/gpu/drm/msm/dp/dp_panel.h | 2 -- 10 files changed, 41 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_audio.c b/drivers/gpu/drm/msm/dp/dp_audio.c index 7634e4b74208..7fd0c1793ba3 100644 --- a/drivers/gpu/drm/msm/dp/dp_audio.c +++ b/drivers/gpu/drm/msm/dp/dp_audio.c @@ -22,9 +22,7 @@ struct dp_audio_private { struct platform_device *pdev; struct drm_device *drm_dev; struct dp_catalog *catalog; - struct dp_panel *panel; - bool engine_on; u32 channels; struct dp_audio dp_audio; @@ -356,8 +354,6 @@ static void dp_audio_enable(struct dp_audio_private *audio, bool enable) catalog->audio_data = enable; dp_catalog_audio_enable(catalog); - - audio->engine_on = enable; } static struct dp_audio_private *dp_audio_get_data(struct platform_device *pdev) @@ -571,7 +567,6 @@ struct dp_audio *dp_audio_get(struct platform_device *pdev, } audio->pdev = pdev; - audio->panel = panel; audio->catalog = catalog; dp_audio = &audio->dp_audio; diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c index 8c72d532d96b..55114a6aba7e 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.c +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c @@ -81,7 +81,6 @@ struct dp_catalog_private { struct dss_io_data io; u32 (*audio_map)[DP_AUDIO_SDP_HEADER_MAX]; struct dp_catalog dp_catalog; - u8 aux_lut_cfg_index[PHY_AUX_CFG_MAX]; }; void dp_catalog_snapshot(struct dp_catalog *dp_catalog, struct msm_disp_state *disp_state) diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h index b85ad6bdb2e7..2c2dbeee7634 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.h +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h @@ -28,26 +28,9 @@ #define DP_INTR_FRAME_END BIT(6) #define DP_INTR_CRC_UPDATED BIT(9) -#define DP_AUX_CFG_MAX_VALUE_CNT 3 - #define DP_HW_VERSION_1_0 0x10000000 #define DP_HW_VERSION_1_2 0x10020000 -/* PHY AUX config registers */ -enum dp_phy_aux_config_type { - PHY_AUX_CFG0, - PHY_AUX_CFG1, - PHY_AUX_CFG2, - PHY_AUX_CFG3, - PHY_AUX_CFG4, - PHY_AUX_CFG5, - PHY_AUX_CFG6, - PHY_AUX_CFG7, - PHY_AUX_CFG8, - PHY_AUX_CFG9, - PHY_AUX_CFG_MAX, -}; - enum dp_catalog_audio_sdp_type { DP_AUDIO_SDP_STREAM, DP_AUDIO_SDP_TIMESTAMP, diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.h b/drivers/gpu/drm/msm/dp/dp_ctrl.h index fa014cee7e21..ffcbd9a25748 100644 --- a/drivers/gpu/drm/msm/dp/dp_ctrl.h +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.h @@ -12,7 +12,6 @@ #include "dp_catalog.h" struct dp_ctrl { - atomic_t aborted; bool wide_bus_en; }; diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index ba658c1637d1..6f6ff13844cf 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -74,7 +74,6 @@ struct dp_event { }; struct dp_display_private { - char *name; int irq; unsigned int id; @@ -82,11 +81,9 @@ struct dp_display_private { /* state variables */ bool core_initialized; bool phy_initialized; - bool hpd_irq_on; bool audio_supported; struct drm_device *drm_dev; - struct dentry *root; struct dp_catalog *catalog; struct drm_dp_aux *aux; @@ -800,7 +797,6 @@ static int dp_display_set_mode(struct msm_dp *dp_display, drm_mode_copy(&dp->panel->dp_mode.drm_mode, &mode->drm_mode); dp->panel->dp_mode.bpp = mode->bpp; - dp->panel->dp_mode.capabilities = mode->capabilities; dp->panel->dp_mode.out_fmt_is_yuv_420 = mode->out_fmt_is_yuv_420; dp_panel_init_panel_info(dp->panel); return 0; @@ -1260,7 +1256,6 @@ static int dp_display_probe(struct platform_device *pdev) return -EINVAL; dp->dp_display.pdev = pdev; - dp->name = "drm_dp"; dp->id = desc->id; dp->dp_display.connector_type = desc->connector_type; dp->wide_bus_supported = desc->wide_bus_supported; diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h index 234dada88687..ec7fa67e0569 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.h +++ b/drivers/gpu/drm/msm/dp/dp_display.h @@ -16,7 +16,6 @@ struct msm_dp { struct drm_device *drm_dev; struct platform_device *pdev; struct device *codec_dev; - struct drm_bridge *bridge; struct drm_connector *connector; struct drm_bridge *next_bridge; bool link_ready; @@ -28,8 +27,6 @@ struct msm_dp { hdmi_codec_plugged_cb plugged_cb; - bool wide_bus_en; - struct dp_audio *dp_audio; bool psr_supported; }; diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c index a819a4ff76a9..1b9be5bd97f1 100644 --- a/drivers/gpu/drm/msm/dp/dp_drm.c +++ b/drivers/gpu/drm/msm/dp/dp_drm.c @@ -347,8 +347,6 @@ int dp_bridge_init(struct msm_dp *dp_display, struct drm_device *dev, } } - dp_display->bridge = bridge; - return 0; } diff --git a/drivers/gpu/drm/msm/dp/dp_link.c b/drivers/gpu/drm/msm/dp/dp_link.c index 49dfac1fd1ef..b94da000014a 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.c +++ b/drivers/gpu/drm/msm/dp/dp_link.c @@ -36,7 +36,6 @@ struct dp_link_request { struct dp_link_private { u32 prev_sink_count; - struct device *dev; struct drm_device *drm_dev; struct drm_dp_aux *aux; struct dp_link dp_link; @@ -804,8 +803,6 @@ int dp_link_psm_config(struct dp_link *dp_link, if (ret) DRM_ERROR("Failed to %s low power mode\n", enable ? "enter" : "exit"); - else - dp_link->psm_enabled = enable; mutex_unlock(&link->psm_mutex); return ret; @@ -1226,7 +1223,6 @@ struct dp_link *dp_link_get(struct device *dev, struct drm_dp_aux *aux) if (!link) return ERR_PTR(-ENOMEM); - link->dev = dev; link->aux = aux; mutex_init(&link->psm_mutex); diff --git a/drivers/gpu/drm/msm/dp/dp_link.h b/drivers/gpu/drm/msm/dp/dp_link.h index 83da170bc56b..f04407fe7375 100644 --- a/drivers/gpu/drm/msm/dp/dp_link.h +++ b/drivers/gpu/drm/msm/dp/dp_link.h @@ -74,7 +74,6 @@ struct dp_link_phy_params { struct dp_link { u32 sink_request; u32 test_response; - bool psm_enabled; u8 sink_count; struct dp_link_test_video test_video; diff --git a/drivers/gpu/drm/msm/dp/dp_panel.h b/drivers/gpu/drm/msm/dp/dp_panel.h index 9afd99e00b0c..4ea42fa936ae 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.h +++ b/drivers/gpu/drm/msm/dp/dp_panel.h @@ -15,7 +15,6 @@ struct edid; struct dp_display_mode { struct drm_display_mode drm_mode; - u32 capabilities; u32 bpp; u32 h_active_low; u32 v_active_low; @@ -47,7 +46,6 @@ struct dp_panel { bool video_test; bool vsc_sdp_supported; - u32 vic; u32 max_dp_lanes; u32 max_dp_link_rate; From patchwork Thu Mar 28 14:40:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 783679 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 31F5212F36D; Thu, 28 Mar 2024 14:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636528; cv=none; b=DmDwwm3hGYWfYnvQapXOnMrjGLipk5o7Q56KLBLv6s6gAMQ2YcUievymaNCXCm31dBFQ1NG9/X7972dhoUt8ubwgeowYPEBDqQcgSjiwhfXei4Fh72fWLQsLWDjwL8zfZtlXtdNtYsad9J1+HlK+ks2UjgkTLOcG7o8y5rVHVdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711636528; c=relaxed/simple; bh=Dqd+kXEvsLwgGeIQGSkViQKw4HO+Q93TaZM7h2qYbzc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CeDsIIpr5Z3ESzpM6gjZJDU4Z9ZQ1/SE2Oho3wH+FVSbAgz/XAm5wG0j2CQ90a+NRdH+g723+SxRwLxt/lJ6XJv/LyNO+ius0bDkez6F13FB3lyQVW4WEyHT6ZUFZJ2gCvOCw626TPuIA2cJTY8doW6Apf26A1zgh0ubf49U5xA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lJGFbr1S; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lJGFbr1S" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43B46C433A6; Thu, 28 Mar 2024 14:35:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711636528; bh=Dqd+kXEvsLwgGeIQGSkViQKw4HO+Q93TaZM7h2qYbzc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lJGFbr1Smyq57XfdbLxau75pFzhb5Yw1TIDCKuR9EiGIFy6ciJ+uevKVncaj/nCor PGK85Pb+0fEpRhfu1DQ8HtqgxQlbAqLrzjwdNf+aC+KmkfEPDeEL0H4L1zCLOyldyR g7Gxf4sCBJrabDtDiLy40/sIq7/dYfy4RwfbXvzxpBfQoMfY+DjnMQ41ghCvi65O+s K7R21TIGR6+EyaDX2i0pmJfbUdk1eVmKFsrK+95P4L9N1v6e6vSKFlEXNiR340VN3V z0IT9L9A4E4lOm+meq7x1TAP9a66/H0EZ60AouOXxXmUBglEc0w5/6cdBUUFM8iEky BomUQkvz9WgbA== From: Bjorn Andersson Date: Thu, 28 Mar 2024 07:40:04 -0700 Subject: [PATCH v2 5/6] drm/msm/dp: Use function arguments for timing configuration Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240328-msm-dp-cleanup-v2-5-a5aed9798d32@quicinc.com> References: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> In-Reply-To: <20240328-msm-dp-cleanup-v2-0-a5aed9798d32@quicinc.com> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Bjorn Andersson X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=4629; i=quic_bjorande@quicinc.com; h=from:subject:message-id; bh=p6zl39KBq28yg/YN5707OZTxRbZDEkda5d4ZGgyTaKA=; b=owEBgwJ8/ZANAwAIAQsfOT8Nma3FAcsmYgBmBYFIiZW3sGxpGa3yGwbDxqhKCDH2SDbeZ/e5A Gsvw0H9Pp6JAkkEAAEIADMWIQQF3gPMXzXqTwlm1SULHzk/DZmtxQUCZgWBSBUcYW5kZXJzc29u QGtlcm5lbC5vcmcACgkQCx85Pw2ZrcX+Ag//ewq4SKTTS7mL6qxsVF0flZEDbLJ1vcO84q/jIxO Hb9NbLJR1suRb+Lazia/lDPg1S4dNoSBWPMs+9kvxIhCwUj8tuVYL+WeVEbC2tI4IVgaGai/kKa 9g+ixmpn8XEEUTtQCwvRMNl+St5fmeN+VNZyPnlKl7pINc2lf+qt7L0SLX1HRHAg+GpsGAZWlNW /tyAbPNXBWa5fPbw6O4lY0OAg0JXMQvc+/HmoedHkgZaKaks6Q837gr0PGccW9SOczJ1MQRLbw7 wuGKUjXBy4PfgJ9usAzfnzGL/mK/3lvNeZEgmYnX+2odTgGrQhqJuBuITvpL4rnpLHOmFSRe6Hc 1d+2GmYRNGTYM2mViz+1nHyLTbBgT82YT3EOi1mC8W0mHRxZcosoL/691AgEqDjmETgGuIIvv+G Zlva023YB/kZiIRHLwaJoWiZbU3z2uo+4mQOZrWW44jcQrlhdLRKKau7BbCeKaRuFz/uPMs/qW5 bwSGhfpF63cydmex9g2uT8m8WwsksEL4D021GF/f32T7EzE+GhUYWxm/Kzkhryz3RvNdEWcK2Wl QyArioKHiHN82nlx4MbJglvn9l5RsAbh+jwUEOc0I4/9zzbGEATj3v+rEPk7erFJWj8+3NLVPsW 2RTD4S/Qf7TJOucn1h0AtebMKkevFJm6qfNvl+UAmPGU= X-Developer-Key: i=quic_bjorande@quicinc.com; a=openpgp; fpr=05DE03CC5F35EA4F0966D5250B1F393F0D99ADC5 From: Bjorn Andersson dp_catalog_panel_timing_cfg() takes 4 arguments, which are passed from the calling function through members of struct dp_catalog. No state is maintained other than across this call, so switch to function arguments to clean up the code. Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson --- drivers/gpu/drm/msm/dp/dp_catalog.c | 14 ++++++-------- drivers/gpu/drm/msm/dp/dp_catalog.h | 7 ++----- drivers/gpu/drm/msm/dp/dp_panel.c | 14 +++++++++----- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c index 295bd4cb72cc..00ad3ebaa5a1 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.c +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c @@ -880,19 +880,17 @@ u32 dp_catalog_ctrl_read_phy_pattern(struct dp_catalog *dp_catalog) } /* panel related catalog functions */ -int dp_catalog_panel_timing_cfg(struct dp_catalog *dp_catalog) +int dp_catalog_panel_timing_cfg(struct dp_catalog *dp_catalog, u32 total, + u32 sync_start, u32 width_blanking, u32 dp_active) { struct dp_catalog_private *catalog = container_of(dp_catalog, struct dp_catalog_private, dp_catalog); u32 reg; - dp_write_link(catalog, REG_DP_TOTAL_HOR_VER, - dp_catalog->total); - dp_write_link(catalog, REG_DP_START_HOR_VER_FROM_SYNC, - dp_catalog->sync_start); - dp_write_link(catalog, REG_DP_HSYNC_VSYNC_WIDTH_POLARITY, - dp_catalog->width_blanking); - dp_write_link(catalog, REG_DP_ACTIVE_HOR_VER, dp_catalog->dp_active); + dp_write_link(catalog, REG_DP_TOTAL_HOR_VER, total); + dp_write_link(catalog, REG_DP_START_HOR_VER_FROM_SYNC, sync_start); + dp_write_link(catalog, REG_DP_HSYNC_VSYNC_WIDTH_POLARITY, width_blanking); + dp_write_link(catalog, REG_DP_ACTIVE_HOR_VER, dp_active); reg = dp_read_p0(catalog, MMSS_DP_INTF_CONFIG); diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.h b/drivers/gpu/drm/msm/dp/dp_catalog.h index 290ef8180c12..a82ab4856b50 100644 --- a/drivers/gpu/drm/msm/dp/dp_catalog.h +++ b/drivers/gpu/drm/msm/dp/dp_catalog.h @@ -48,10 +48,6 @@ enum dp_catalog_audio_header_type { }; struct dp_catalog { - u32 total; - u32 sync_start; - u32 width_blanking; - u32 dp_active; enum dp_catalog_audio_sdp_type sdp_type; enum dp_catalog_audio_header_type sdp_header; u32 audio_data; @@ -106,7 +102,8 @@ void dp_catalog_ctrl_send_phy_pattern(struct dp_catalog *dp_catalog, u32 dp_catalog_ctrl_read_phy_pattern(struct dp_catalog *dp_catalog); /* DP Panel APIs */ -int dp_catalog_panel_timing_cfg(struct dp_catalog *dp_catalog); +int dp_catalog_panel_timing_cfg(struct dp_catalog *dp_catalog, u32 total, + u32 sync_start, u32 width_blanking, u32 dp_active); void dp_catalog_panel_enable_vsc_sdp(struct dp_catalog *dp_catalog, struct dp_sdp *vsc_sdp); void dp_catalog_panel_disable_vsc_sdp(struct dp_catalog *dp_catalog); void dp_catalog_dump_regs(struct dp_catalog *dp_catalog); diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c index 8e7069453952..07db8f37cd06 100644 --- a/drivers/gpu/drm/msm/dp/dp_panel.c +++ b/drivers/gpu/drm/msm/dp/dp_panel.c @@ -353,6 +353,10 @@ int dp_panel_timing_cfg(struct dp_panel *dp_panel) struct dp_catalog *catalog; struct dp_panel_private *panel; struct drm_display_mode *drm_mode; + u32 width_blanking; + u32 sync_start; + u32 dp_active; + u32 total; panel = container_of(dp_panel, struct dp_panel_private, dp_panel); catalog = panel->catalog; @@ -376,13 +380,13 @@ int dp_panel_timing_cfg(struct dp_panel *dp_panel) data <<= 16; data |= total_hor; - catalog->total = data; + total = data; data = (drm_mode->vtotal - drm_mode->vsync_start); data <<= 16; data |= (drm_mode->htotal - drm_mode->hsync_start); - catalog->sync_start = data; + sync_start = data; data = drm_mode->vsync_end - drm_mode->vsync_start; data <<= 16; @@ -390,15 +394,15 @@ int dp_panel_timing_cfg(struct dp_panel *dp_panel) data |= drm_mode->hsync_end - drm_mode->hsync_start; data |= (panel->dp_panel.dp_mode.h_active_low << 15); - catalog->width_blanking = data; + width_blanking = data; data = drm_mode->vdisplay; data <<= 16; data |= drm_mode->hdisplay; - catalog->dp_active = data; + dp_active = data; - dp_catalog_panel_timing_cfg(catalog); + dp_catalog_panel_timing_cfg(catalog, total, sync_start, width_blanking, dp_active); if (dp_panel->dp_mode.out_fmt_is_yuv_420) dp_panel_setup_vsc_sdp_yuv_420(dp_panel);