[Intel-gfx] [PATCH v3 1/8] drm/i915: Make sure fb gtt offsets stay within 32bits
Chris Wilson
chris at chris-wilson.co.uk
Wed Sep 26 20:09:31 UTC 2018
Quoting Ville Syrjälä (2018-09-26 10:27:40)
> On Tue, Sep 25, 2018 at 09:29:44PM +0100, Chris Wilson wrote:
> > Quoting Ville Syrjala (2018-09-25 20:37:07)
> > > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > > + /* Catch potential overflows early */
> > > + if (add_overflows(mul_u32_u32(height, fb->pitches[color_plane]),
> > > + fb->offsets[color_plane], (u32)0)) {
> >
> > Should we just pass type? Atm we aren't using the value for anything.
> > Then it would be add_overflows_t(a, b, T) with the obvious wrapping for
> > add_overflows(a, b). Although to be consistent with min_t, perhaps
> > add_overflows_t(T, a, b).
>
> Indeed, that does seem a bit more consistent with existing stuff.
To further upset the apple cart, I spotted there is now a
include/linux/overflows.h which does everything completely different.
-Chris
More information about the Intel-gfx
mailing list