intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression
@ 2016-11-11 10:40 Joonas Lahtinen
  2016-11-11 11:05 ` Chris Wilson
  2016-11-11 11:16 ` ✓ Fi.CI.BAT: success for " Patchwork
  0 siblings, 2 replies; 4+ messages in thread
From: Joonas Lahtinen @ 2016-11-11 10:40 UTC (permalink / raw)
  To: Intel graphics driver community testing & development
  Cc: Daniel Vetter, Arnd Bergmann

Evaluate GEM_BUG_ON expression similar to actual BUG_ON even if
DEBUG_GEM is disabled.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 51ec793..d141676 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -28,7 +28,7 @@
 #ifdef CONFIG_DRM_I915_DEBUG_GEM
 #define GEM_BUG_ON(expr) BUG_ON(expr)
 #else
-#define GEM_BUG_ON(expr) do { } while (0)
+#define GEM_BUG_ON(expr) do { if (expr) {} } while(0)
 #endif
 
 #define I915_NUM_ENGINES 5
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression
  2016-11-11 10:40 [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression Joonas Lahtinen
@ 2016-11-11 11:05 ` Chris Wilson
  2016-11-11 12:09   ` Tvrtko Ursulin
  2016-11-11 11:16 ` ✓ Fi.CI.BAT: success for " Patchwork
  1 sibling, 1 reply; 4+ messages in thread
From: Chris Wilson @ 2016-11-11 11:05 UTC (permalink / raw)
  To: Joonas Lahtinen
  Cc: Daniel Vetter,
	Intel graphics driver community testing & development,
	Arnd Bergmann

On Fri, Nov 11, 2016 at 12:40:45PM +0200, Joonas Lahtinen wrote:
> Evaluate GEM_BUG_ON expression similar to actual BUG_ON even if
> DEBUG_GEM is disabled.
> 
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
> index 51ec793..d141676 100644
> --- a/drivers/gpu/drm/i915/i915_gem.h
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -28,7 +28,7 @@
>  #ifdef CONFIG_DRM_I915_DEBUG_GEM
>  #define GEM_BUG_ON(expr) BUG_ON(expr)
>  #else
> -#define GEM_BUG_ON(expr) do { } while (0)
> +#define GEM_BUG_ON(expr) do { if (expr) {} } while(0)
>  #endif

Mentioned on irc, that I'm not that keen on having the side-effects
around. Suggestion was while (0) do { if (expr) {} } while (0)

But spot the dev who touched gem code without enabling the debug :-p
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Always evaluate GEM_BUG_ON expression
  2016-11-11 10:40 [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression Joonas Lahtinen
  2016-11-11 11:05 ` Chris Wilson
@ 2016-11-11 11:16 ` Patchwork
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2016-11-11 11:16 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Always evaluate GEM_BUG_ON expression
URL   : https://patchwork.freedesktop.org/series/15156/
State : success

== Summary ==

Series 15156v1 drm/i915: Always evaluate GEM_BUG_ON expression
https://patchwork.freedesktop.org/api/1.0/series/15156/revisions/1/mbox/


fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
fi-ivb-3520m     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 

0ecf26a8d5fc565fca1da9d66f65863de5e00ead drm-intel-nightly: 2016y-11m-11d-08h-21m-01s UTC integration manifest
9dd4d06 drm/i915: Always evaluate GEM_BUG_ON expression

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2965/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression
  2016-11-11 11:05 ` Chris Wilson
@ 2016-11-11 12:09   ` Tvrtko Ursulin
  0 siblings, 0 replies; 4+ messages in thread
From: Tvrtko Ursulin @ 2016-11-11 12:09 UTC (permalink / raw)
  To: Chris Wilson, Joonas Lahtinen,
	Intel graphics driver community testing & development,
	Arnd Bergmann, Daniel Vetter


On 11/11/2016 11:05, Chris Wilson wrote:
> On Fri, Nov 11, 2016 at 12:40:45PM +0200, Joonas Lahtinen wrote:
>> Evaluate GEM_BUG_ON expression similar to actual BUG_ON even if
>> DEBUG_GEM is disabled.
>>
>> Cc: Arnd Bergmann <arnd@arndb.de>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_gem.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
>> index 51ec793..d141676 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.h
>> +++ b/drivers/gpu/drm/i915/i915_gem.h
>> @@ -28,7 +28,7 @@
>>  #ifdef CONFIG_DRM_I915_DEBUG_GEM
>>  #define GEM_BUG_ON(expr) BUG_ON(expr)
>>  #else
>> -#define GEM_BUG_ON(expr) do { } while (0)
>> +#define GEM_BUG_ON(expr) do { if (expr) {} } while(0)
>>  #endif
>
> Mentioned on irc, that I'm not that keen on having the side-effects
> around. Suggestion was while (0) do { if (expr) {} } while (0)

Sounds good to me.

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-11 12:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-11 10:40 [PATCH] drm/i915: Always evaluate GEM_BUG_ON expression Joonas Lahtinen
2016-11-11 11:05 ` Chris Wilson
2016-11-11 12:09   ` Tvrtko Ursulin
2016-11-11 11:16 ` ✓ Fi.CI.BAT: success for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).