Skip to contentSkip to conversation

drm/msm/dpu: INTF CRC configuration cleanups and fix

PATCH Superseded Jessica Zhang 3 participants 8 messages Dec 13, 2023

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover drm/msm/dpu: INTF CRC configuration cleanups and fix

This series drops the frame_count and enable parameters (as they're always set to the same value). It also sets input_sel=0x1 for INTF.

---
Changes in v2:
- Switched patch order
- Changed input_sel parameter from bool to u8
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Jessica Zhang (2):
drm/msm/dpu: Set input_sel bit for INTF
drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h   |  3 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 20 ++++++++------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  8 +++-----
 8 files changed, 25 insertions(+), 30 deletions(-)

---
base-commit: 0d9372c346d4cdf347354382e0659de8c1cc0236
change-id: 20231122-encoder-fixup-61c190b16085

Best regards,

Signature · 1 line
Jessica Zhang <[email protected]>
#1 lore raw

PATCH v2 1/2 drm/msm/dpu: Set input_sel bit for INTF

Set the input_sel bit for encoders as it was missed in the initial implementation.

Fixes 91143873a05d ("drm/msm/dpu: Add MISR register support for interface")
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 10 ++++++++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  3 ++-
 4 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1 -1
index 0b6a0a7dcc39..226133af7840 100644
@@ -322,7 +322,7 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 
 static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
 {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
 }
 
 static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +1 -1
index 25af52ab602f..bbc9756ecde9 100644
@@ -85,7 +85,7 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 
 static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
 {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
 }
 
 static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +8 -2
index 0b05061e3e62..87716a60332e 100644
@@ -477,7 +477,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count)
+		bool enable, u32 frame_count,
+		u32 input_sel)
 {
 	u32 config = 0;
 
@@ -487,8 +488,13 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 	wmb();
 
 	if (enable) {
+		/*
+		 * note: Aside from encoders, input_sel should be
+		 * set to 0x0 by default
+		 */
 		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK;
+			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+			((input_sel & 0xF) << 24);
 
 		DPU_REG_WRITE(c, misr_ctrl_offset, config);
 	} else {
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +2 -1
index fe083b2e5696..761056be272b 100644
@@ -357,7 +357,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
 		bool enable,
-		u32 frame_count);
+		u32 frame_count,
+		u32 input_sel);
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/2] drm/msm/dpu: Set input_sel bit for INTF

Quoted 74 lines · Jessica Zhang

Set the input_sel bit for encoders as it was missed in the initial implementation.

Fixes 91143873a05d ("drm/msm/dpu: Add MISR register support for interface")
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 10 ++++++++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  3 ++-
  4 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1 -1
index 0b6a0a7dcc39..226133af7840 100644
@@ -322,7 +322,7 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 
  static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
  {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
  }
 
  static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +1 -1
index 25af52ab602f..bbc9756ecde9 100644
@@ -85,7 +85,7 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 
  static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
  {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
  }
 
  static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +8 -2
index 0b05061e3e62..87716a60332e 100644
@@ -477,7 +477,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
  		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count)
+		bool enable, u32 frame_count,
+		u32 input_sel)
  {
  	u32 config = 0;
 
@@ -487,8 +488,13 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
  	wmb();
 
  	if (enable) {
+		/*
+		 * note: Aside from encoders, input_sel should be
+		 * set to 0x0 by default
+		 */
  		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK;
+			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+			((input_sel & 0xF) << 24);
 
  		DPU_REG_WRITE(c, misr_ctrl_offset, config);
  	} else {
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +0 -0
index fe083b2e5696..761056be272b 100644

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset, · line 361

Quoted 6 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +2 -1
@@ -357,7 +357,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
  		u32 misr_ctrl_offset,
  		bool enable,
-		u32 frame_count);
+		u32 frame_count,
+		u32 input_sel);

u8 for input_sel?

Quoted 4 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +0 -0
  int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
  		u32 misr_ctrl_offset,
 
#3 lore raw

Re: [PATCH v2 1/2] drm/msm/dpu: Set input_sel bit for INTF

In reply to Jessica Zhang
Quoted 56 lines · Jessica Zhang

Set the input_sel bit for encoders as it was missed in the initial implementation.

Fixes 91143873a05d ("drm/msm/dpu: Add MISR register support for interface")
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 10 ++++++++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  3 ++-
 4 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1 -1
index 0b6a0a7dcc39..226133af7840 100644
@@ -322,7 +322,7 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 
 static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
 {
-       dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count);
+       dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
 }
 
 static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +1 -1
index 25af52ab602f..bbc9756ecde9 100644
@@ -85,7 +85,7 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 
 static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
 {
-       dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count);
+       dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
 }
 
 static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +2 -1
index 0b05061e3e62..87716a60332e 100644
@@ -477,7 +477,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
                u32 misr_ctrl_offset,
-               bool enable, u32 frame_count)
+               bool enable, u32 frame_count,
+               u32 input_sel)
 {
        u32 config = 0;
 

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, · line 494

Quoted 7 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +4 -0
@@ -487,8 +488,13 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
        wmb();
 
        if (enable) {
+               /*
+                * note: Aside from encoders, input_sel should be
+                * set to 0x0 by default
+                */

Even if it is not a proper kernedoc, please move this comment before the function.

Quoted 25 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +2 -1
                config = (frame_count & MISR_FRAME_COUNT_MASK) |
-                       MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK;
+                       MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+                       ((input_sel & 0xF) << 24);
 
                DPU_REG_WRITE(c, misr_ctrl_offset, config);
        } else {
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +2 -2
index fe083b2e5696..761056be272b 100644
@@ -357,7 +357,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
                u32 misr_ctrl_offset,
                bool enable,
-               u32 frame_count);
+               u32 frame_count,
+               u32 input_sel);
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
                u32 misr_ctrl_offset,
 
--

2.43.0

Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

Re: [PATCH v2 1/2] drm/msm/dpu: Set input_sel bit for INTF

Quoted 59 lines · Dmitry Baryshkov
Quoted 58 lines · Jessica Zhang

Set the input_sel bit for encoders as it was missed in the initial implementation.

Fixes 91143873a05d ("drm/msm/dpu: Add MISR register support for interface")
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  2 +-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 10 ++++++++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  3 ++-
  4 files changed, 12 insertions(+), 5 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +1 -1
index 0b6a0a7dcc39..226133af7840 100644
@@ -322,7 +322,7 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 
  static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
  {
-       dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count);
+       dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
  }
 
  static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +1 -1
index 25af52ab602f..bbc9756ecde9 100644
@@ -85,7 +85,7 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 
  static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
  {
-       dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count);
+       dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
  }
 
  static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +2 -1
index 0b05061e3e62..87716a60332e 100644
@@ -477,7 +477,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
                 u32 misr_ctrl_offset,
-               bool enable, u32 frame_count)
+               bool enable, u32 frame_count,
+               u32 input_sel)
  {
         u32 config = 0;
 
@@ -487,8 +488,13 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
         wmb();
 
Quoted 8 lines

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c, · line 494

Quoted 5 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +4 -0
         if (enable) {
+               /*
+                * note: Aside from encoders, input_sel should be
+                * set to 0x0 by default
+                */

Even if it is not a proper kernedoc, please move this comment before the function.

Acked.

Quoted 31 lines
Quoted 26 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +2 -1
                 config = (frame_count & MISR_FRAME_COUNT_MASK) |
-                       MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK;
+                       MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+                       ((input_sel & 0xF) << 24);
 
                 DPU_REG_WRITE(c, misr_ctrl_offset, config);
         } else {
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +2 -2
index fe083b2e5696..761056be272b 100644
@@ -357,7 +357,8 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
                 u32 misr_ctrl_offset,
                 bool enable,
-               u32 frame_count);
+               u32 frame_count,
+               u32 input_sel);
 
  int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
                 u32 misr_ctrl_offset,
 
--

2.43.0

Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

PATCH v2 2/2 drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

In reply to Jessica Zhang

Drop the enable and frame_count parameters from dpu_hw_setup_misr() as they are always set to the same values.

In addition, replace MISR_FRAME_COUNT_MASK with MISR_FRAME_COUNT as frame_count is always set to the same value.

Fixes 7b37523fb1d1 ("drm/msm/dpu: Move MISR methods to dpu_hw_util")
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h |  4 ++--
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  6 +++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h   |  3 ++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 26 ++++++++------------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  9 +++------
 8 files changed, 25 insertions(+), 37 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -2
index 8ebed048a193..555182201b8e 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
  * Copyright (C) 2013 Red Hat
  * Author: Rob Clark <[email protected]>
@@ -114,7 +114,7 @@ static void dpu_crtc_setup_lm_misr(struct dpu_crtc_state *crtc_state)
 			continue;
 
 		/* Calculate MISR over 1 frame */
-		m->hw_lm->ops.setup_misr(m->hw_lm, true, 1);
+		m->hw_lm->ops.setup_misr(m->hw_lm);
 	}
 }
 
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2 -2
index aa1a1646b322..1d8eb3b509b4 100644
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2013 Red Hat
  * Copyright (c) 2014-2018, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Author: Rob Clark <[email protected]>
  */
@@ -258,7 +258,7 @@ void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc)
 		if (!phys->hw_intf || !phys->hw_intf->ops.setup_misr)
 			continue;
 
-		phys->hw_intf->ops.setup_misr(phys->hw_intf, true, 1);
+		phys->hw_intf->ops.setup_misr(phys->hw_intf);
 	}
 }
 
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +3 -3
index 226133af7840..6bba531d6dc4 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 
@@ -320,9 +320,9 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
 	return DPU_REG_READ(c, INTF_LINE_COUNT);
 }
 
-static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
+static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf)
 {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, 0x1);
 }
 
 static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +2 -2
index 215401bb042e..0bd57a32144a 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 
@@ -95,7 +95,7 @@ struct dpu_hw_intf_ops {
 
 	void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
 			const enum dpu_pingpong pp);
-	void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_intf *intf);
 	int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value);
 
 	// Tearcheck on INTF since DPU 5.0.0
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +3 -3
index bbc9756ecde9..1d3ccf3228c6 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -83,9 +83,9 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
 	}
 }
 
-static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
+static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx)
 {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, 0x0);
 }
 
 static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h +2 -1
index 8835fd106413..0a3381755249 100644
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -57,7 +58,7 @@ struct dpu_hw_lm_ops {
 	/**
 	 * setup_misr: Enable/disable MISR
 	 */
-	void (*setup_misr)(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_mixer *ctx);
 
 	/**
 	 * collect_misr: Read MISR signature
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +8 -18
index 87716a60332e..3b33a60c5c6b 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
  */
 #define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__
@@ -476,9 +476,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 }
 
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count,
-		u32 input_sel)
+		u32 misr_ctrl_offset, u32 input_sel)
 {
 	u32 config = 0;
 
@@ -487,20 +485,12 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
 	/* Clear old MISR value (in case it's read before a new value is calculated)*/
 	wmb();
 
-	if (enable) {
-		/*
-		 * note: Aside from encoders, input_sel should be
-		 * set to 0x0 by default
-		 */
-		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
-			((input_sel & 0xF) << 24);
-
-		DPU_REG_WRITE(c, misr_ctrl_offset, config);
-	} else {
-		DPU_REG_WRITE(c, misr_ctrl_offset, 0);
-	}
-
+	/*
+	 * note: Aside from encoders, input_sel should be set to 0x0 by default
+	 */
+	config = MISR_FRAME_COUNT | MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+		((input_sel & 0xF) << 24);
+	DPU_REG_WRITE(c, misr_ctrl_offset, config);
 }
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +3 -6
index 761056be272b..a561720f827d 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  */
 
@@ -13,7 +13,7 @@
 #include "dpu_hw_catalog.h"
 
 #define REG_MASK(n)                     ((BIT(n)) - 1)
-#define MISR_FRAME_COUNT_MASK           0xFF
+#define MISR_FRAME_COUNT                0x1
 #define MISR_CTRL_ENABLE                BIT(8)
 #define MISR_CTRL_STATUS                BIT(9)
 #define MISR_CTRL_STATUS_CLEAR          BIT(10)
@@ -355,10 +355,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
 			   const struct dpu_hw_qos_cfg *cfg);
 
 void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable,
-		u32 frame_count,
-		u32 input_sel);
+		u32 misr_ctrl_offset, u32 input_sel);
 
 int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
 		u32 misr_ctrl_offset,
Signature · 1 line
2.43.0
#6 lore raw

Re: [PATCH v2 2/2] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

Quoted 165 lines · Jessica Zhang

Drop the enable and frame_count parameters from dpu_hw_setup_misr() as they are always set to the same values.

In addition, replace MISR_FRAME_COUNT_MASK with MISR_FRAME_COUNT as frame_count is always set to the same value.

Fixes 7b37523fb1d1 ("drm/msm/dpu: Move MISR methods to dpu_hw_util")
---
  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    |  4 ++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  4 ++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  6 +++---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h |  4 ++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  6 +++---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h   |  3 ++-
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 26 ++++++++------------------
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  9 +++------
  8 files changed, 25 insertions(+), 37 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +2 -2
index 8ebed048a193..555182201b8e 100644
@@ -1,6 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
   * Copyright (C) 2013 Red Hat
   * Author: Rob Clark <[email protected]>
@@ -114,7 +114,7 @@ static void dpu_crtc_setup_lm_misr(struct dpu_crtc_state *crtc_state)
  			continue;
 
  		/* Calculate MISR over 1 frame */
-		m->hw_lm->ops.setup_misr(m->hw_lm, true, 1);
+		m->hw_lm->ops.setup_misr(m->hw_lm);
  	}
  }
 
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +2 -2
index aa1a1646b322..1d8eb3b509b4 100644
@@ -2,7 +2,7 @@
  /*
   * Copyright (C) 2013 Red Hat
   * Copyright (c) 2014-2018, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   *
   * Author: Rob Clark <[email protected]>
   */
@@ -258,7 +258,7 @@ void dpu_encoder_setup_misr(const struct drm_encoder *drm_enc)
  		if (!phys->hw_intf || !phys->hw_intf->ops.setup_misr)
  			continue;
 
-		phys->hw_intf->ops.setup_misr(phys->hw_intf, true, 1);
+		phys->hw_intf->ops.setup_misr(phys->hw_intf);
  	}
  }
 
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +3 -3
index 226133af7840..6bba531d6dc4 100644
@@ -1,6 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
   */
 
@@ -320,9 +320,9 @@ static u32 dpu_hw_intf_get_line_count(struct dpu_hw_intf *intf)
  	return DPU_REG_READ(c, INTF_LINE_COUNT);
  }
 
-static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool enable, u32 frame_count)
+static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf)
  {
-	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 0x1);
+	dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, 0x1);
  }
 
  static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +2 -2
index 215401bb042e..0bd57a32144a 100644
@@ -1,6 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0-only */
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
   */
 
@@ -95,7 +95,7 @@ struct dpu_hw_intf_ops {
 
  	void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
  			const enum dpu_pingpong pp);
-	void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_intf *intf);
  	int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value);
 
  	// Tearcheck on INTF since DPU 5.0.0
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +3 -3
index bbc9756ecde9..1d3ccf3228c6 100644
@@ -1,6 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
   */
 
@@ -83,9 +83,9 @@ static void dpu_hw_lm_setup_border_color(struct dpu_hw_mixer *ctx,
  	}
  }
 
-static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count)
+static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx)
  {
-	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
+	dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, 0x0);
  }
 
  static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h +2 -1
index 8835fd106413..0a3381755249 100644
@@ -1,5 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0-only */
  /*
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
   */
 
@@ -57,7 +58,7 @@ struct dpu_hw_lm_ops {
  	/**
  	 * setup_misr: Enable/disable MISR
  	 */
-	void (*setup_misr)(struct dpu_hw_mixer *ctx, bool enable, u32 frame_count);
+	void (*setup_misr)(struct dpu_hw_mixer *ctx);
 
  	/**
  	 * collect_misr: Read MISR signature
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +1 -1
index 87716a60332e..3b33a60c5c6b 100644
@@ -1,6 +1,6 @@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
   */
  #define pr_fmt(fmt)	"[drm:%s:%d] " fmt, __func__, __LINE__

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset, · line 479

Quoted 7 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +1 -3
@@ -476,9 +476,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
  }
 
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable, u32 frame_count,
-		u32 input_sel)
+		u32 misr_ctrl_offset, u32 input_sel)

I thought input_sel is going to be u8 now?

Quoted 64 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +6 -14
  {
  	u32 config = 0;
 
@@ -487,20 +485,12 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
  	/* Clear old MISR value (in case it's read before a new value is calculated)*/
  	wmb();
 
-	if (enable) {
-		/*
-		 * note: Aside from encoders, input_sel should be
-		 * set to 0x0 by default
-		 */
-		config = (frame_count & MISR_FRAME_COUNT_MASK) |
-			MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
-			((input_sel & 0xF) << 24);
-
-		DPU_REG_WRITE(c, misr_ctrl_offset, config);
-	} else {
-		DPU_REG_WRITE(c, misr_ctrl_offset, 0);
-	}
-
+	/*
+	 * note: Aside from encoders, input_sel should be set to 0x0 by default
+	 */
+	config = MISR_FRAME_COUNT | MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+		((input_sel & 0xF) << 24);
+	DPU_REG_WRITE(c, misr_ctrl_offset, config);
  }
 
  int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +3 -6
index 761056be272b..a561720f827d 100644
@@ -1,6 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0-only */
  /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
   */
 
@@ -13,7 +13,7 @@
  #include "dpu_hw_catalog.h"
 
  #define REG_MASK(n)                     ((BIT(n)) - 1)
-#define MISR_FRAME_COUNT_MASK           0xFF
+#define MISR_FRAME_COUNT                0x1
  #define MISR_CTRL_ENABLE                BIT(8)
  #define MISR_CTRL_STATUS                BIT(9)
  #define MISR_CTRL_STATUS_CLEAR          BIT(10)
@@ -355,10 +355,7 @@ void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset,
  			   const struct dpu_hw_qos_cfg *cfg);
 
  void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-		u32 misr_ctrl_offset,
-		bool enable,
-		u32 frame_count,
-		u32 input_sel);
+		u32 misr_ctrl_offset, u32 input_sel);
 
  int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
  		u32 misr_ctrl_offset,
#7 lore raw

Re: [PATCH v2 2/2] drm/msm/dpu: Drop enable and frame_count parameters from dpu_hw_setup_misr()

Quoted 177 lines · Abhinav Kumar
Quoted 174 lines · Jessica Zhang

Drop the enable and frame_count parameters from dpu_hw_setup_misr() as they are always set to the same values.

In addition, replace MISR_FRAME_COUNT_MASK with MISR_FRAME_COUNT as frame_count is always set to the same value.

Fixes 7b37523fb1d1 ("drm/msm/dpu: Move MISR methods to dpu_hw_util")

---
  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c    |  4 ++--

  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c |  4 ++--
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c |  6 +++---
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h |  4 ++--

  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c   |  6 +++--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h   |  3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c | 26
++++++++------------------
  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h |  9 +++------

  8 files changed, 25 insertions(+), 37 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +0 -1
index 8ebed048a193..555182201b8e 100644
@@ -1,6 +1,6 @@
   // SPDX-License-Identifier: GPL-2.0-only
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
   * Copyright (C) 2013 Red Hat
   * Author: Rob Clark <[email protected]>

drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +1 -1
@@ -114,7 +114,7 @@ static void dpu_crtc_setup_lm_misr(struct 
 dpu_crtc_state *crtc_state)
               continue;
           /* Calculate MISR over 1 frame */
-        m->hw_lm->ops.setup_misr(m->hw_lm, true, 1);
+        m->hw_lm->ops.setup_misr(m->hw_lm);
       }
   }
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +0 -1
index aa1a1646b322..1d8eb3b509b4 100644
@@ -2,7 +2,7 @@
   /*
    * Copyright (C) 2013 Red Hat
    * Copyright (c) 2014-2018, 2020-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   *
   * Author: Rob Clark <[email protected]>
   */

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -1
@@ -258,7 +258,7 @@ void dpu_encoder_setup_misr(const struct 
 drm_encoder *drm_enc)
           if (!phys->hw_intf || !phys->hw_intf->ops.setup_misr)
               continue;
-        phys->hw_intf->ops.setup_misr(phys->hw_intf, true, 1);
+        phys->hw_intf->ops.setup_misr(phys->hw_intf);
       }
   }
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +0 -1
index 226133af7840..6bba531d6dc4 100644
@@ -1,6 +1,6 @@
   // SPDX-License-Identifier: GPL-2.0-only
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. */

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +2 -2
@@ -320,9 +320,9 @@ static u32 dpu_hw_intf_get_line_count(struct 
 dpu_hw_intf *intf)
       return DPU_REG_READ(c, INTF_LINE_COUNT);
   }
-static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf, bool 
 enable, u32 frame_count)
+static void dpu_hw_intf_setup_misr(struct dpu_hw_intf *intf)
   {
-    dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, enable, frame_count, 
 0x1);
+    dpu_hw_setup_misr(&intf->hw, INTF_MISR_CTRL, 0x1);
   }

  static int dpu_hw_intf_collect_misr(struct dpu_hw_intf *intf, u32 *misr_value)

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +0 -1
index 215401bb042e..0bd57a32144a 100644
@@ -1,6 +1,6 @@
   /* SPDX-License-Identifier: GPL-2.0-only */
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. */

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +1 -1
@@ -95,7 +95,7 @@ struct dpu_hw_intf_ops {
       void (*bind_pingpong_blk)(struct dpu_hw_intf *intf,
               const enum dpu_pingpong pp);
-    void (*setup_misr)(struct dpu_hw_intf *intf, bool enable, u32 
 frame_count);
+    void (*setup_misr)(struct dpu_hw_intf *intf);
       int (*collect_misr)(struct dpu_hw_intf *intf, u32 *misr_value);
       // Tearcheck on INTF since DPU 5.0.0
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +0 -1
index bbc9756ecde9..1d3ccf3228c6 100644
@@ -1,6 +1,6 @@
   // SPDX-License-Identifier: GPL-2.0-only
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.c +2 -2
@@ -83,9 +83,9 @@ static void dpu_hw_lm_setup_border_color(struct 
 dpu_hw_mixer *ctx,
       }
   }
-static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx, bool 
 enable, u32 frame_count)
+static void dpu_hw_lm_setup_misr(struct dpu_hw_mixer *ctx)
   {
-    dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, enable, frame_count, 0x0);
+    dpu_hw_setup_misr(&ctx->hw, LM_MISR_CTRL, 0x0);
   }
   static int dpu_hw_lm_collect_misr(struct dpu_hw_mixer *ctx, u32 *misr_value)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h +1 -0
index 8835fd106413..0a3381755249 100644
@@ -1,5 +1,6 @@
   /* SPDX-License-Identifier: GPL-2.0-only */
   /*
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All 

rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_lm.h +1 -1
@@ -57,7 +58,7 @@ struct dpu_hw_lm_ops {
       /**
        * setup_misr: Enable/disable MISR
        */
-    void (*setup_misr)(struct dpu_hw_mixer *ctx, bool enable, u32 
 frame_count);
+    void (*setup_misr)(struct dpu_hw_mixer *ctx);
       /**
        * collect_misr: Read MISR signature
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +0 -1
index 87716a60332e..3b33a60c5c6b 100644
@@ -1,6 +1,6 @@
   // SPDX-License-Identifier: GPL-2.0-only
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. */
  #define pr_fmt(fmt)    "[drm:%s:%d] " fmt, __func__, __LINE__

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +0 -0
@@ -476,9 +476,7 @@ void _dpu_hw_setup_qos_lut(struct 
 dpu_hw_blk_reg_map *c, u32 offset,
Quoted 8 lines

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c void _dpu_hw_setup_qos_lut(struct dpu_hw_blk_reg_map *c, u32 offset, · line 479

Quoted 6 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +1 -3
   }
   void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-        u32 misr_ctrl_offset,
-        bool enable, u32 frame_count,
-        u32 input_sel)
+        u32 misr_ctrl_offset, u32 input_sel)

I thought input_sel is going to be u8 now?

Ah, thanks for catching this -- had it as u32 in an older version and forgot to change to u8. Will push a v3.

Thanks,

Jessica Zhang

Quoted 64 lines
Quoted 64 lines
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c +2 -14
   {
       u32 config = 0;
@@ -487,20 +485,12 @@ void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map 
 *c,
       /* Clear old MISR value (in case it's read before a new value is calculated)*/
       wmb();
-    if (enable) {
-        /*
-         * note: Aside from encoders, input_sel should be
-         * set to 0x0 by default
-         */
-        config = (frame_count & MISR_FRAME_COUNT_MASK) |
-            MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
-            ((input_sel & 0xF) << 24);
-
-        DPU_REG_WRITE(c, misr_ctrl_offset, config);
-    } else {
-        DPU_REG_WRITE(c, misr_ctrl_offset, 0);
-    }
-
+    /*
+     * note: Aside from encoders, input_sel should be set to 0x0 by 

default
+     */
+    config = MISR_FRAME_COUNT | MISR_CTRL_ENABLE | MISR_CTRL_FREE_RUN_MASK |
+        ((input_sel & 0xF) << 24);
+    DPU_REG_WRITE(c, misr_ctrl_offset, config); }
  int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +0 -1
index 761056be272b..a561720f827d 100644
@@ -1,6 +1,6 @@
   /* SPDX-License-Identifier: GPL-2.0-only */
   /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights 

reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
   * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved. */

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h +2 -5
@@ -13,7 +13,7 @@
   #include "dpu_hw_catalog.h"
   #define REG_MASK(n)                     ((BIT(n)) - 1)
-#define MISR_FRAME_COUNT_MASK           0xFF
+#define MISR_FRAME_COUNT                0x1
   #define MISR_CTRL_ENABLE                BIT(8)
   #define MISR_CTRL_STATUS                BIT(9)
   #define MISR_CTRL_STATUS_CLEAR          BIT(10)
@@ -355,10 +355,7 @@ void _dpu_hw_setup_qos_lut(struct 
 dpu_hw_blk_reg_map *c, u32 offset,
                  const struct dpu_hw_qos_cfg *cfg);
   void dpu_hw_setup_misr(struct dpu_hw_blk_reg_map *c,
-        u32 misr_ctrl_offset,
-        bool enable,
-        u32 frame_count,
-        u32 input_sel);
+        u32 misr_ctrl_offset, u32 input_sel);
   int dpu_hw_collect_misr(struct dpu_hw_blk_reg_map *c,
           u32 misr_ctrl_offset,