diff mbox series

[1/3] drm/i915/watermark: Initialize latency variable to appropriate value

Message ID 20241111123259.1072534-1-suraj.kandpal@intel.com (mailing list archive)
State New
Headers show
Series [1/3] drm/i915/watermark: Initialize latency variable to appropriate value | expand

Commit Message

Kandpal, Suraj Nov. 11, 2024, 12:32 p.m. UTC
Initialize max_latency variable to LNL_PKG_C_LATENCY_MASK which helps
to eliminate the else block and make the whole code a lot cleaner.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/skl_watermark.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Mitul Golani Nov. 11, 2024, 1:30 p.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Suraj
> Kandpal
> Sent: 11 November 2024 18:03
> To: intel-xe@lists.freedesktop.org; intel-gfx@lists.freedesktop.org
> Cc: Govindapillai, Vinod <vinod.govindapillai@intel.com>; Kandpal, Suraj
> <suraj.kandpal@intel.com>
> Subject: [PATCH 1/3] drm/i915/watermark: Initialize latency variable to
> appropriate value
> 
> Initialize max_latency variable to LNL_PKG_C_LATENCY_MASK which helps to
> eliminate the else block and make the whole code a lot cleaner.
> 
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c
> b/drivers/gpu/drm/i915/display/skl_watermark.c
> index d3bbf335c749..a97e90ac643f 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -2850,7 +2850,7 @@ static int skl_wm_add_affected_planes(struct
> intel_atomic_state *state,  static void  skl_program_dpkgc_latency(struct
> drm_i915_private *i915, bool enable_dpkgc)  {
> -	u32 max_latency = 0;
> +	u32 max_latency = LNL_PKG_C_LATENCY_MASK;
>  	u32 clear = 0, val = 0;
>  	u32 added_wake_time = 0;
> 
> @@ -2863,9 +2863,6 @@ skl_program_dpkgc_latency(struct
> drm_i915_private *i915, bool enable_dpkgc)
>  			max_latency = LNL_PKG_C_LATENCY_MASK;
>  		added_wake_time = DSB_EXE_TIME +
>  			i915->display.sagv.block_time_us;
> -	} else {
> -		max_latency = LNL_PKG_C_LATENCY_MASK;
> -		added_wake_time = 0;

Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>

>  	}
> 
>  	clear |= LNL_ADDED_WAKE_TIME_MASK |
> LNL_PKG_C_LATENCY_MASK;
> --
> 2.34.1
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index d3bbf335c749..a97e90ac643f 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -2850,7 +2850,7 @@  static int skl_wm_add_affected_planes(struct intel_atomic_state *state,
 static void
 skl_program_dpkgc_latency(struct drm_i915_private *i915, bool enable_dpkgc)
 {
-	u32 max_latency = 0;
+	u32 max_latency = LNL_PKG_C_LATENCY_MASK;
 	u32 clear = 0, val = 0;
 	u32 added_wake_time = 0;
 
@@ -2863,9 +2863,6 @@  skl_program_dpkgc_latency(struct drm_i915_private *i915, bool enable_dpkgc)
 			max_latency = LNL_PKG_C_LATENCY_MASK;
 		added_wake_time = DSB_EXE_TIME +
 			i915->display.sagv.block_time_us;
-	} else {
-		max_latency = LNL_PKG_C_LATENCY_MASK;
-		added_wake_time = 0;
 	}
 
 	clear |= LNL_ADDED_WAKE_TIME_MASK | LNL_PKG_C_LATENCY_MASK;