On Tue, 25 Sep 2018 10:26:57 +0200, Chris Wilson
<chris@xxxxxxxxxxxxxxxxxx> wrote:
Quoting Chris Wilson (2018-09-25 09:01:06)
Quoting Tvrtko Ursulin (2018-09-24 11:29:52)
>
> On 19/09/2018 20:55, Chris Wilson wrote:
> > diff --git a/drivers/gpu/drm/i915/i915_scheduler.h
b/drivers/gpu/drm/i915/i915_scheduler.h
> > index 7edfad0abfd7..93e43e263d8c 100644
> > --- a/drivers/gpu/drm/i915/i915_scheduler.h
> > +++ b/drivers/gpu/drm/i915/i915_scheduler.h
> > @@ -19,12 +19,14 @@ enum {
> > I915_PRIORITY_INVALID = INT_MIN
> > };
> >
> > -#define I915_USER_PRIORITY_SHIFT 0
> > +#define I915_USER_PRIORITY_SHIFT 1
> > #define I915_USER_PRIORITY(x) ((x) << I915_USER_PRIORITY_SHIFT)
> >
> > #define I915_PRIORITY_COUNT BIT(I915_USER_PRIORITY_SHIFT)
> > #define I915_PRIORITY_MASK (-I915_PRIORITY_COUNT)
> >
> > +#define I915_PRIORITY_NEWCLIENT ((u8)BIT(0))
>
> Is the cast important and why?
Unreliable memory says there was something iffy about the code
generation
at one point.
drivers/gpu/drm/i915/intel_lrc.c: In function
‘__unwind_incomplete_requests’:
drivers/gpu/drm/i915/intel_lrc.c:272:13: error: overflow in conversion
from ‘long unsigned int’ to ‘int’ changes value from
‘18446744071562067969’ to ‘-2147483647’ [-Werror=overflow]
int prio = I915_PRIORITY_INVALID | I915_PRIORITY_NEWCLIENT;
If you plan to use I915_PRIORITY_NEWCLIENT in 'int' vars then
you should not use BIT macro that returns 'unsigned int long'
As I915_USER_PRIORITY is already using explicit shift, maybe the
same can be done for I915_PRIORITY_NEWCLIENT:
#define I915_PRIORITY_NEWCLIENT (1 << 0)
Michal
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx