[igt-dev] [PATCH i-g-t 06/14] benchmarks/gem_wsim: fix conflicting SSEU #define and enum

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Sep 26 10:51:41 UTC 2023


On 26/09/2023 09:44, Marcin Bernatowicz wrote:
> One SSEU is in enum w_step and then as #define SSEU (1 << 3).
> Fix this.
> 
> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz at linux.intel.com>
> ---
>   benchmarks/gem_wsim.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
> index aeb959364..3b01340bf 100644
> --- a/benchmarks/gem_wsim.c
> +++ b/benchmarks/gem_wsim.c
> @@ -238,7 +238,7 @@ static struct drm_i915_gem_context_param_sseu device_sseu = {
>   
>   #define SYNCEDCLIENTS	(1<<1)
>   #define DEPSYNC		(1<<2)
> -#define SSEU		(1<<3)
> +#define FLAG_SSEU	(1<<3)

Right, it worked with no side effects because enum SSEU is above the 
highest flag bit.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Prefix all flags with FLAG_ while at it?

Regards,

Tvrtko

>   
>   static const char *ring_str_map[NUM_ENGINES] = {
>   	[DEFAULT] = "DEFAULT",
> @@ -2597,7 +2597,7 @@ int main(int argc, char **argv)
>   			/* Fall through */
>   		case 'w':
>   			w_args = add_workload_arg(w_args, ++nr_w_args, optarg,
> -						  prio, flags & SSEU);
> +						  prio, flags & FLAG_SSEU);
>   			break;
>   		case 'p':
>   			prio = atoi(optarg);
> @@ -2626,7 +2626,7 @@ int main(int argc, char **argv)
>   			flags |= SYNCEDCLIENTS;
>   			break;
>   		case 's':
> -			flags ^= SSEU;
> +			flags ^= FLAG_SSEU;
>   			break;
>   		case 'd':
>   			flags |= DEPSYNC;


More information about the igt-dev mailing list