]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Make sure fb gtt offsets stay within 32bits
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 23 Oct 2018 16:02:01 +0000 (19:02 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 29 Nov 2018 20:00:49 +0000 (22:00 +0200)
commit9c38f6160bf9e57ce88d66b88a239c50e58f01f3
tree823443e8209e54948685dbe97cbe863723b71433
parent90f0682228ec2f5f7dca2ab017b49a15a836bf38
drm/i915: Make sure fb gtt offsets stay within 32bits

Let's try to make sure the fb offset computations never hit
an integer overflow by making sure the entire fb stays
below 32bits. framebuffer_check() in the core already does
the same check, but as it doesn't know about tiling some things
can slip through. Repeat the check in the driver with tiling
taken into account.

v2: Use add_overflows() after massaging it to work for me (Chris)
v3: Call it add_overflow_t() to match min_t() & co. (Chris)

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181023160201.9840-1-ville.syrjala@linux.intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_utils.h
drivers/gpu/drm/i915/intel_display.c