[Intel-gfx] [PATCH] drm/i915/tgl: Fix missing parentheses on TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT

Chris Wilson chris at chris-wilson.co.uk
Mon Aug 12 18:13:04 UTC 2019


Quoting José Roberto de Souza (2019-08-12 18:54:05)
> In this case we want to apply the mask and then shift so the
> parentheses is needed.
> 
> SPANK! SPANK! SPANK! Naughty programmer!
> 
> Fixes: 9749a5b6c09f ("drm/i915/tgl: Fix the read of the DDI that transcoder is attached to")
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 4a947bd0a294..def6dbdc7e2e 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -9433,7 +9433,7 @@ enum skl_power_gate {
>  #define  TRANS_DDI_SELECT_PORT(x)      ((x) << TRANS_DDI_PORT_SHIFT)
>  #define  TGL_TRANS_DDI_SELECT_PORT(x)  (((x) + 1) << TGL_TRANS_DDI_PORT_SHIFT)
>  #define  TRANS_DDI_FUNC_CTL_VAL_TO_PORT(val)    (((val) & TRANS_DDI_PORT_MASK) >> TRANS_DDI_PORT_SHIFT)
> -#define  TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT(val) (((val) & TGL_TRANS_DDI_PORT_MASK >> TGL_TRANS_DDI_PORT_SHIFT) - 1)
> +#define  TGL_TRANS_DDI_FUNC_CTL_VAL_TO_PORT(val) ((((val) & TGL_TRANS_DDI_PORT_MASK) >> TGL_TRANS_DDI_PORT_SHIFT) - 1)

That makes the most sense in the possible variations of (:)
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list