diff mbox series

[2/3] drm/i915: reorder if chain to have last gen first

Message ID 20190404230426.15837-3-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series Trivial comments and small changes | expand

Commit Message

Lucas De Marchi April 4, 2019, 11:04 p.m. UTC
Reorder if/else so we check for gen >= 11 first, similar to most of
other checks in the driver.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

Comments

Rodrigo Vivi April 8, 2019, 10:36 p.m. UTC | #1
On Thu, Apr 04, 2019 at 04:04:25PM -0700, Lucas De Marchi wrote:
> Reorder if/else so we check for gen >= 11 first, similar to most of
> other checks in the driver.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index 0e05ee1f3ea0..25eff3728fcd 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -4367,15 +4367,16 @@ skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
>  		return 0;
>  	}
>  
> -	if (INTEL_GEN(dev_priv) < 11)
> +	if (INTEL_GEN(dev_priv) >= 11)
> +		total_data_rate =
> +			icl_get_total_relative_data_rate(cstate,
> +							 plane_data_rate);
> +	else
>  		total_data_rate =
>  			skl_get_total_relative_data_rate(cstate,
>  							 plane_data_rate,
>  							 uv_plane_data_rate);
> -	else
> -		total_data_rate =
> -			icl_get_total_relative_data_rate(cstate,
> -							 plane_data_rate);
> +
>  
>  	skl_ddb_get_pipe_allocation_limits(dev_priv, cstate, total_data_rate,
>  					   ddb, alloc, &num_active);
> -- 
> 2.21.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 0e05ee1f3ea0..25eff3728fcd 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4367,15 +4367,16 @@  skl_allocate_pipe_ddb(struct intel_crtc_state *cstate,
 		return 0;
 	}
 
-	if (INTEL_GEN(dev_priv) < 11)
+	if (INTEL_GEN(dev_priv) >= 11)
+		total_data_rate =
+			icl_get_total_relative_data_rate(cstate,
+							 plane_data_rate);
+	else
 		total_data_rate =
 			skl_get_total_relative_data_rate(cstate,
 							 plane_data_rate,
 							 uv_plane_data_rate);
-	else
-		total_data_rate =
-			icl_get_total_relative_data_rate(cstate,
-							 plane_data_rate);
+
 
 	skl_ddb_get_pipe_allocation_limits(dev_priv, cstate, total_data_rate,
 					   ddb, alloc, &num_active);