drm/i915: Set num_qgv_points to zero if we can't query the actual points
diff mbox series

Message ID 20200116114544.16118-1-ville.syrjala@linux.intel.com
State New
Headers show
Series
  • drm/i915: Set num_qgv_points to zero if we can't query the actual points
Related show

Commit Message

Ville Syrjala Jan. 16, 2020, 11:45 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

If the pcode fails to give us the goods on any of the QGV points just
declare that we have none so that we'll properly ignore the bw limits.

Cc: Clinton A Taylor <clinton.a.taylor@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Matt Roper Jan. 17, 2020, 9:32 p.m. UTC | #1
On Thu, Jan 16, 2020 at 01:45:44PM +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> If the pcode fails to give us the goods on any of the QGV points just
> declare that we have none so that we'll properly ignore the bw limits.

Should we also try to sanitize that the actual point info returned is
sane?  E.g., if the pcode read didn't fail, but we just received a
zeroed out QGV point structure, we'd probably want to disregard it as
well?


Matt

> 
> Cc: Clinton A Taylor <clinton.a.taylor@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bw.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
> index b228671d5a5d..eb9281e1831c 100644
> --- a/drivers/gpu/drm/i915/display/intel_bw.c
> +++ b/drivers/gpu/drm/i915/display/intel_bw.c
> @@ -129,8 +129,10 @@ static int icl_get_qgv_points(struct drm_i915_private *dev_priv,
>  		struct intel_qgv_point *sp = &qi->points[i];
>  
>  		ret = icl_pcode_read_qgv_point_info(dev_priv, sp, i);
> -		if (ret)
> +		if (ret) {
> +			qi->num_points = 0;
>  			return ret;
> +		}
>  
>  		DRM_DEBUG_KMS("QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n",
>  			      i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras,
> -- 
> 2.24.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index b228671d5a5d..eb9281e1831c 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -129,8 +129,10 @@  static int icl_get_qgv_points(struct drm_i915_private *dev_priv,
 		struct intel_qgv_point *sp = &qi->points[i];
 
 		ret = icl_pcode_read_qgv_point_info(dev_priv, sp, i);
-		if (ret)
+		if (ret) {
+			qi->num_points = 0;
 			return ret;
+		}
 
 		DRM_DEBUG_KMS("QGV %d: DCLK=%d tRP=%d tRDPRE=%d tRAS=%d tRCD=%d tRC=%d\n",
 			      i, sp->dclk, sp->t_rp, sp->t_rdpre, sp->t_ras,