[2/2] drm/msm/dpu: drop dpu_kms from _dpu_kms_initialize_writeback

Message ID 20240228194730.619204-2-quic_abhinavk@quicinc.com
State New
Headers
Series [1/2] drm/msm/dpu: drop unused dpu_kms from interface initialization |

Commit Message

Abhinav Kumar Feb. 28, 2024, 7:47 p.m. UTC
  Following the pattern of other interfaces, lets align writeback
as well by dropping the dpu_kms parameter in its _dpu_kms_initialize_*
function.

Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
  

Comments

Dmitry Baryshkov March 4, 2024, 9:46 a.m. UTC | #1
On Wed, 28 Feb 2024 at 21:47, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>
> Following the pattern of other interfaces, lets align writeback
> as well by dropping the dpu_kms parameter in its _dpu_kms_initialize_*
> function.
>
> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
  

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
index ab924ac78c9b..382ef4c8e8eb 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
@@ -620,13 +620,12 @@  static int _dpu_kms_initialize_hdmi(struct drm_device *dev,
 }
 
 static int _dpu_kms_initialize_writeback(struct drm_device *dev,
-		struct msm_drm_private *priv, struct dpu_kms *dpu_kms,
+		struct msm_drm_private *priv, u32 maxlinewidth,
 		const u32 *wb_formats, int n_formats)
 {
 	struct drm_encoder *encoder = NULL;
 	struct msm_display_info info;
 	const enum dpu_wb wb_idx = WB_2;
-	u32 maxlinewidth;
 	int rc;
 
 	memset(&info, 0, sizeof(info));
@@ -636,8 +635,6 @@  static int _dpu_kms_initialize_writeback(struct drm_device *dev,
 	info.h_tile_instance[0] = wb_idx;
 	info.intf_type = INTF_WB;
 
-	maxlinewidth = dpu_rm_get_wb(&dpu_kms->rm, info.h_tile_instance[0])->caps->maxlinewidth;
-
 	encoder = dpu_encoder_init(dev, DRM_MODE_ENCODER_VIRTUAL, &info);
 	if (IS_ERR(encoder)) {
 		DPU_ERROR("encoder init failed for dsi display\n");
@@ -690,9 +687,12 @@  static int _dpu_kms_setup_displays(struct drm_device *dev,
 	if (dpu_kms->catalog->wb_count) {
 		for (i = 0; i < dpu_kms->catalog->wb_count; i++) {
 			if (dpu_kms->catalog->wb[i].id == WB_2) {
-				rc = _dpu_kms_initialize_writeback(dev, priv, dpu_kms,
-						dpu_kms->catalog->wb[i].format_list,
-						dpu_kms->catalog->wb[i].num_formats);
+				u32 wb_maxlinewidth = dpu_kms->catalog->wb[i].maxlinewidth;
+				const u32 *wb_formats = dpu_kms->catalog->wb[i].format_list;
+				u32 n_formats = dpu_kms->catalog->wb[i].num_formats;
+
+				rc = _dpu_kms_initialize_writeback(dev, priv, wb_maxlinewidth,
+								   wb_formats, n_formats);
 				if (rc) {
 					DPU_ERROR("initialize_WB failed, rc = %d\n", rc);
 					return rc;