Re: [PATCH v2 1/7] Revert "drm/i915: Kill GEN_FOREVER"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 06, 2018 at 01:51:17PM -0800, Lucas De Marchi wrote:
> This reverts commit 5bc0e89ff1bee1566bd2fbd1142dce001c068aeb.
> 
> The macro was added and then never used so it was removed. However
> after removal it was noticed that it was actually something that should
> indeed be useful to out gen check macros to make use of.
> 
> Let's get the define back and start using it in follow up changes.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_drv.h | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 2a88a7eb871b..8839a34f7648 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2360,12 +2360,20 @@ intel_info(const struct drm_i915_private *dev_priv)
>  #define REVID_FOREVER		0xff
>  #define INTEL_REVID(dev_priv)	((dev_priv)->drm.pdev->revision)
>  
> +#define GEN_FOREVER (0)
> +
>  #define INTEL_GEN_MASK(s, e) ( \
>  	BUILD_BUG_ON_ZERO(!__builtin_constant_p(s)) + \
>  	BUILD_BUG_ON_ZERO(!__builtin_constant_p(e)) + \
> -	GENMASK((e) - 1, (s) - 1))
> +	GENMASK((e) != GEN_FOREVER ? (e) - 1 : BITS_PER_LONG - 1, \
> +		(s) != GEN_FOREVER ? (s) - 1 : 0) \

As I mentioned before I don't like the forever as start, but this could
be removed later so this can be a pure revert?!

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

> +)
>  
> -/* Returns true if Gen is in inclusive range [Start, End] */
> +/*
> + * Returns true if Gen is in inclusive range [Start, End].
> + *
> + * Use GEN_FOREVER for unbound start and or end.
> + */
>  #define IS_GEN(dev_priv, s, e) \
>  	(!!((dev_priv)->info.gen_mask & INTEL_GEN_MASK((s), (e))))
>  
> -- 
> 2.19.1.1.g56c4683e68
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux