* [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
@ 2016-12-02 13:23 Matthew Auld
2016-12-02 13:34 ` Ville Syrjälä
2016-12-02 13:54 ` Chris Wilson
0 siblings, 2 replies; 11+ messages in thread
From: Matthew Auld @ 2016-12-02 13:23 UTC (permalink / raw)
To: intel-gfx
In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, this
will enable us to freely add warnings which our CI will hopefully catch
but without fear of impacting production machines.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/i915_gem.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 51ec793f2e20..04c777e6d0bf 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -27,8 +27,10 @@
#ifdef CONFIG_DRM_I915_DEBUG_GEM
#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_WARN_ON(expr) WARN_ON(expr)
#else
#define GEM_BUG_ON(expr) do { } while (0)
+#define GEM_WARN_ON(expr) do { } while (0)
#endif
#define I915_NUM_ENGINES 5
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-02 13:23 [PATCH 1/2] " Matthew Auld
@ 2016-12-02 13:34 ` Ville Syrjälä
2016-12-02 13:54 ` Chris Wilson
1 sibling, 0 replies; 11+ messages in thread
From: Ville Syrjälä @ 2016-12-02 13:34 UTC (permalink / raw)
To: Matthew Auld; +Cc: intel-gfx
On Fri, Dec 02, 2016 at 01:23:13PM +0000, Matthew Auld wrote:
> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, this
> will enable us to freely add warnings which our CI will hopefully catch
> but without fear of impacting production machines.
Impacting performance?
>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
> index 51ec793f2e20..04c777e6d0bf 100644
> --- a/drivers/gpu/drm/i915/i915_gem.h
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -27,8 +27,10 @@
>
> #ifdef CONFIG_DRM_I915_DEBUG_GEM
> #define GEM_BUG_ON(expr) BUG_ON(expr)
> +#define GEM_WARN_ON(expr) WARN_ON(expr)
> #else
> #define GEM_BUG_ON(expr) do { } while (0)
> +#define GEM_WARN_ON(expr) do { } while (0)
> #endif
>
> #define I915_NUM_ENGINES 5
> --
> 2.9.3
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-02 13:23 [PATCH 1/2] " Matthew Auld
2016-12-02 13:34 ` Ville Syrjälä
@ 2016-12-02 13:54 ` Chris Wilson
2016-12-02 15:11 ` Matthew Auld
1 sibling, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2016-12-02 13:54 UTC (permalink / raw)
To: Matthew Auld; +Cc: intel-gfx
On Fri, Dec 02, 2016 at 01:23:13PM +0000, Matthew Auld wrote:
> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, this
> will enable us to freely add warnings which our CI will hopefully catch
> but without fear of impacting production machines.
>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
> index 51ec793f2e20..04c777e6d0bf 100644
> --- a/drivers/gpu/drm/i915/i915_gem.h
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -27,8 +27,10 @@
>
> #ifdef CONFIG_DRM_I915_DEBUG_GEM
> #define GEM_BUG_ON(expr) BUG_ON(expr)
> +#define GEM_WARN_ON(expr) WARN_ON(expr)
> #else
> #define GEM_BUG_ON(expr) do { } while (0)
> +#define GEM_WARN_ON(expr) do { } while (0)
#define GEM_WARN_ON 0
i.e. so that if (GEM_WARN_ON(insane_condition()) compiles out correctly
without DEBUG_GEM enabled.
-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] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-02 13:54 ` Chris Wilson
@ 2016-12-02 15:11 ` Matthew Auld
2016-12-02 15:25 ` Chris Wilson
0 siblings, 1 reply; 11+ messages in thread
From: Matthew Auld @ 2016-12-02 15:11 UTC (permalink / raw)
To: Chris Wilson, Matthew Auld, Intel Graphics Development
On 2 December 2016 at 13:54, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Fri, Dec 02, 2016 at 01:23:13PM +0000, Matthew Auld wrote:
>> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, this
>> will enable us to freely add warnings which our CI will hopefully catch
>> but without fear of impacting production machines.
>>
>> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_gem.h | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
>> index 51ec793f2e20..04c777e6d0bf 100644
>> --- a/drivers/gpu/drm/i915/i915_gem.h
>> +++ b/drivers/gpu/drm/i915/i915_gem.h
>> @@ -27,8 +27,10 @@
>>
>> #ifdef CONFIG_DRM_I915_DEBUG_GEM
>> #define GEM_BUG_ON(expr) BUG_ON(expr)
>> +#define GEM_WARN_ON(expr) WARN_ON(expr)
>> #else
>> #define GEM_BUG_ON(expr) do { } while (0)
>> +#define GEM_WARN_ON(expr) do { } while (0)
>
> #define GEM_WARN_ON 0
Oops. As an alternative, would you be offended with something like:
#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
Then the compiler will still check the validity of the expression, but
will still compile everything out, and then we don't accidentally
break the build when compiling without DEBUG_GEM ?
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-02 15:11 ` Matthew Auld
@ 2016-12-02 15:25 ` Chris Wilson
0 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2016-12-02 15:25 UTC (permalink / raw)
To: Matthew Auld; +Cc: Intel Graphics Development, Matthew Auld
On Fri, Dec 02, 2016 at 03:11:05PM +0000, Matthew Auld wrote:
> On 2 December 2016 at 13:54, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Fri, Dec 02, 2016 at 01:23:13PM +0000, Matthew Auld wrote:
> >> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, this
> >> will enable us to freely add warnings which our CI will hopefully catch
> >> but without fear of impacting production machines.
> >>
> >> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> >> ---
> >> drivers/gpu/drm/i915/i915_gem.h | 2 ++
> >> 1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
> >> index 51ec793f2e20..04c777e6d0bf 100644
> >> --- a/drivers/gpu/drm/i915/i915_gem.h
> >> +++ b/drivers/gpu/drm/i915/i915_gem.h
> >> @@ -27,8 +27,10 @@
> >>
> >> #ifdef CONFIG_DRM_I915_DEBUG_GEM
> >> #define GEM_BUG_ON(expr) BUG_ON(expr)
> >> +#define GEM_WARN_ON(expr) WARN_ON(expr)
> >> #else
> >> #define GEM_BUG_ON(expr) do { } while (0)
> >> +#define GEM_WARN_ON(expr) do { } while (0)
> >
> > #define GEM_WARN_ON 0
> Oops. As an alternative, would you be offended with something like:
>
> #define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
>
> Then the compiler will still check the validity of the expression, but
> will still compile everything out, and then we don't accidentally
> break the build when compiling without DEBUG_GEM ?
Ooh, new shiny. Uses sizeof()! Can you prepare a patch to fixup
GEM_BUG_ON as well?
-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] 11+ messages in thread
* [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
@ 2016-12-13 16:00 Matthew Auld
2016-12-13 16:00 ` [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind Matthew Auld
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Matthew Auld @ 2016-12-13 16:00 UTC (permalink / raw)
To: intel-gfx
In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, with the
simple goal of expressing warnings which are truly insane, and so are
only really useful for CI where we have some abusive tests.
v2:
- use BUILD_BUG_ON_INVALID for !DEBUG_GEM
- clarify commit message
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/i915_gem.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.h b/drivers/gpu/drm/i915/i915_gem.h
index 8801a14a78a2..a585d47c420a 100644
--- a/drivers/gpu/drm/i915/i915_gem.h
+++ b/drivers/gpu/drm/i915/i915_gem.h
@@ -27,8 +27,10 @@
#ifdef CONFIG_DRM_I915_DEBUG_GEM
#define GEM_BUG_ON(expr) BUG_ON(expr)
+#define GEM_WARN_ON(expr) WARN_ON(expr)
#else
#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
+#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
#endif
#define I915_NUM_ENGINES 5
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind
2016-12-13 16:00 [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Matthew Auld
@ 2016-12-13 16:00 ` Matthew Auld
2016-12-13 16:41 ` Chris Wilson
2016-12-13 16:25 ` [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Joonas Lahtinen
2016-12-13 18:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2 siblings, 1 reply; 11+ messages in thread
From: Matthew Auld @ 2016-12-13 16:00 UTC (permalink / raw)
To: intel-gfx
If we move the sanity checking from gen8_alloc_va_range_3lvl and
gen6_alloc_va_range into i915_vma_bind, we will increase our coverage to
now both callbacks. We also convert each WARN_ON over to a GEM_WARN_ON.
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 12 ------------
drivers/gpu/drm/i915/i915_vma.c | 6 ++++++
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index ef00d36680c9..4f405b445b6c 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1303,15 +1303,6 @@ static int gen8_alloc_va_range_3lvl(struct i915_address_space *vm,
uint32_t pdpes = I915_PDPES_PER_PDP(dev_priv);
int ret;
- /* Wrap is never okay since we can only represent 48b, and we don't
- * actually use the other side of the canonical address space.
- */
- if (WARN_ON(start + length < start))
- return -ENODEV;
-
- if (WARN_ON(start + length > vm->total))
- return -ENODEV;
-
ret = alloc_gen8_temp_bitmaps(&new_page_dirs, &new_page_tables, pdpes);
if (ret)
return ret;
@@ -1929,9 +1920,6 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
uint32_t pde;
int ret;
- if (WARN_ON(start_in + length_in > ppgtt->base.total))
- return -ENODEV;
-
start = start_save = start_in;
length = length_save = length_in;
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 37c3eebe8316..9e121222c5eb 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -176,6 +176,12 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
if (bind_flags == 0)
return 0;
+ if (GEM_WARN_ON(vma->node.start + vma->node.size < vma->node.start))
+ return -ENODEV;
+
+ if (GEM_WARN_ON(vma->node.start + vma->node.size > vma->vm->total))
+ return -ENODEV;
+
if (vma_flags == 0 && vma->vm->allocate_va_range) {
trace_i915_va_alloc(vma);
ret = vma->vm->allocate_va_range(vma->vm,
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-13 16:00 [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Matthew Auld
2016-12-13 16:00 ` [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind Matthew Auld
@ 2016-12-13 16:25 ` Joonas Lahtinen
2016-12-13 16:52 ` Matthew Auld
2016-12-13 18:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
2 siblings, 1 reply; 11+ messages in thread
From: Joonas Lahtinen @ 2016-12-13 16:25 UTC (permalink / raw)
To: Matthew Auld, intel-gfx
On ti, 2016-12-13 at 16:00 +0000, Matthew Auld wrote:
> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, with the
> simple goal of expressing warnings which are truly insane, and so are
> only really useful for CI where we have some abusive tests.
>
> v2:
> - use BUILD_BUG_ON_INVALID for !DEBUG_GEM
> - clarify commit message
>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
<SNIP>
> +++ b/drivers/gpu/drm/i915/i915_gem.h
> @@ -27,8 +27,10 @@
>
> #ifdef CONFIG_DRM_I915_DEBUG_GEM
> #define GEM_BUG_ON(expr) BUG_ON(expr)
> +#define GEM_WARN_ON(expr) WARN_ON(expr)
> #else
> #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
> +#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
+#define GEM_WARN_ON(expr) GEM_BUG_ON(expr)
Should be enough in the #else branch just like in linux/mmdebug.h
Regards, joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind
2016-12-13 16:00 ` [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind Matthew Auld
@ 2016-12-13 16:41 ` Chris Wilson
0 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2016-12-13 16:41 UTC (permalink / raw)
To: Matthew Auld; +Cc: intel-gfx
On Tue, Dec 13, 2016 at 04:00:59PM +0000, Matthew Auld wrote:
> If we move the sanity checking from gen8_alloc_va_range_3lvl and
> gen6_alloc_va_range into i915_vma_bind, we will increase our coverage to
> now both callbacks. We also convert each WARN_ON over to a GEM_WARN_ON.
>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 12 ------------
> drivers/gpu/drm/i915/i915_vma.c | 6 ++++++
> 2 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index ef00d36680c9..4f405b445b6c 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -1303,15 +1303,6 @@ static int gen8_alloc_va_range_3lvl(struct i915_address_space *vm,
> uint32_t pdpes = I915_PDPES_PER_PDP(dev_priv);
> int ret;
>
> - /* Wrap is never okay since we can only represent 48b, and we don't
> - * actually use the other side of the canonical address space.
> - */
> - if (WARN_ON(start + length < start))
> - return -ENODEV;
> -
> - if (WARN_ON(start + length > vm->total))
> - return -ENODEV;
> -
> ret = alloc_gen8_temp_bitmaps(&new_page_dirs, &new_page_tables, pdpes);
> if (ret)
> return ret;
> @@ -1929,9 +1920,6 @@ static int gen6_alloc_va_range(struct i915_address_space *vm,
> uint32_t pde;
> int ret;
>
> - if (WARN_ON(start_in + length_in > ppgtt->base.total))
> - return -ENODEV;
> -
> start = start_save = start_in;
> length = length_save = length_in;
>
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 37c3eebe8316..9e121222c5eb 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -176,6 +176,12 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
> if (bind_flags == 0)
> return 0;
#define range_overfows(start, size, max) ({
typeof(start) start__ = (start);
typeof(size) size__ = (size);
typeof(max) max__ = (max);
(void)(&start__ == &size__);
(void)(&start__ == &max__);
start > max || size > max - start;
})
if (GEM_WARN_ON(range_overflows(vma->node.start,
vma->node.size,
vma->vm->total))
return -ENODEV;
Then look at pread/pwrite for where we can reuse range_overflows(), e.g.
if (range_overflows(args->offset, args->size, obj->base.size)) {
Might need a range_overflows_t();
-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] 11+ messages in thread
* Re: [PATCH 1/2] drm/i915: introduce GEM_WARN_ON
2016-12-13 16:25 ` [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Joonas Lahtinen
@ 2016-12-13 16:52 ` Matthew Auld
0 siblings, 0 replies; 11+ messages in thread
From: Matthew Auld @ 2016-12-13 16:52 UTC (permalink / raw)
To: Joonas Lahtinen; +Cc: Intel Graphics Development, Matthew Auld
On 13 December 2016 at 16:25, Joonas Lahtinen
<joonas.lahtinen@linux.intel.com> wrote:
> On ti, 2016-12-13 at 16:00 +0000, Matthew Auld wrote:
>> In a similar spirit to GEM_BUG_ON we now also have GEM_WARN_ON, with the
>> simple goal of expressing warnings which are truly insane, and so are
>> only really useful for CI where we have some abusive tests.
>>
>> v2:
>> - use BUILD_BUG_ON_INVALID for !DEBUG_GEM
>> - clarify commit message
>>
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
>
> <SNIP>
>
>> +++ b/drivers/gpu/drm/i915/i915_gem.h
>> @@ -27,8 +27,10 @@
>>
>> #ifdef CONFIG_DRM_I915_DEBUG_GEM
>> #define GEM_BUG_ON(expr) BUG_ON(expr)
>> +#define GEM_WARN_ON(expr) WARN_ON(expr)
>> #else
>> #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
>> +#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
>
> +#define GEM_WARN_ON(expr) GEM_BUG_ON(expr)
>
> Should be enough in the #else branch just like in linux/mmdebug.h
BUILD_BUG_INVALID(expr) will do a (void) cast to discard the result of
the sizeof operation, but then we don't end up ignoring said result if
we use it in the context of an if condition, which will make the
compiler very unhappy.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
* ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: introduce GEM_WARN_ON
2016-12-13 16:00 [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Matthew Auld
2016-12-13 16:00 ` [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind Matthew Auld
2016-12-13 16:25 ` [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Joonas Lahtinen
@ 2016-12-13 18:15 ` Patchwork
2 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2016-12-13 18:15 UTC (permalink / raw)
To: Matthew Auld; +Cc: intel-gfx
== Series Details ==
Series: series starting with [1/2] drm/i915: introduce GEM_WARN_ON
URL : https://patchwork.freedesktop.org/series/16750/
State : success
== Summary ==
Series 16750v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16750/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2600)
fi-bdw-5557u total:247 pass:233 dwarn:0 dfail:0 fail:0 skip:14
fi-bsw-n3050 total:247 pass:208 dwarn:0 dfail:0 fail:0 skip:39
fi-bxt-t5700 total:247 pass:220 dwarn:0 dfail:0 fail:0 skip:27
fi-byt-j1900 total:247 pass:220 dwarn:0 dfail:0 fail:0 skip:27
fi-byt-n2820 total:247 pass:216 dwarn:0 dfail:0 fail:0 skip:31
fi-hsw-4770 total:247 pass:228 dwarn:0 dfail:0 fail:0 skip:19
fi-hsw-4770r total:247 pass:228 dwarn:0 dfail:0 fail:0 skip:19
fi-ilk-650 total:247 pass:195 dwarn:0 dfail:0 fail:0 skip:52
fi-ivb-3520m total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21
fi-ivb-3770 total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21
fi-kbl-7500u total:247 pass:226 dwarn:0 dfail:0 fail:0 skip:21
fi-skl-6260u total:247 pass:234 dwarn:0 dfail:0 fail:0 skip:13
fi-skl-6700hq total:247 pass:227 dwarn:0 dfail:0 fail:0 skip:20
fi-skl-6700k total:247 pass:224 dwarn:3 dfail:0 fail:0 skip:20
fi-skl-6770hq total:247 pass:234 dwarn:0 dfail:0 fail:0 skip:13
fi-snb-2520m total:247 pass:216 dwarn:0 dfail:0 fail:0 skip:31
fi-snb-2600 total:247 pass:215 dwarn:0 dfail:0 fail:0 skip:32
c596a6521837b06a740e894030d11024f391bd6e drm-tip: 2016y-12m-13d-15h-48m-22s UTC integration manifest
622d9a7 drm/i915: move vma sanity checking into i915_vma_bind
1a6db28 drm/i915: introduce GEM_WARN_ON
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3278/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-12-13 18:15 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 16:00 [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Matthew Auld
2016-12-13 16:00 ` [PATCH 2/2] drm/i915: move vma sanity checking into i915_vma_bind Matthew Auld
2016-12-13 16:41 ` Chris Wilson
2016-12-13 16:25 ` [PATCH 1/2] drm/i915: introduce GEM_WARN_ON Joonas Lahtinen
2016-12-13 16:52 ` Matthew Auld
2016-12-13 18:15 ` ✓ Fi.CI.BAT: success for series starting with [1/2] " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2016-12-02 13:23 [PATCH 1/2] " Matthew Auld
2016-12-02 13:34 ` Ville Syrjälä
2016-12-02 13:54 ` Chris Wilson
2016-12-02 15:11 ` Matthew Auld
2016-12-02 15:25 ` Chris Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox