Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65bd342f authored by Michel Thierry's avatar Michel Thierry Committed by Daniel Vetter
Browse files

drm/i915: object size needs to be u64



In a 48b world, users can try to allocate buffers bigger than 4GB; in
these cases it is important that size is a 64b variable.

v2: Drop the warning about bind with size 0, it shouldn't happen anyway.
Signed-off-by: default avatarMichel Thierry <michel.thierry@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent ea91e401
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -3355,7 +3355,8 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
{
{
	struct drm_device *dev = obj->base.dev;
	struct drm_device *dev = obj->base.dev;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_private *dev_priv = dev->dev_private;
	u32 size, fence_size, fence_alignment, unfenced_alignment;
	u32 fence_alignment, unfenced_alignment;
	u64 size, fence_size;
	u64 start =
	u64 start =
		flags & PIN_OFFSET_BIAS ? flags & PIN_OFFSET_MASK : 0;
		flags & PIN_OFFSET_BIAS ? flags & PIN_OFFSET_MASK : 0;
	u64 end =
	u64 end =
@@ -3414,7 +3415,7 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
	 * attempt to find space.
	 * attempt to find space.
	 */
	 */
	if (size > end) {
	if (size > end) {
		DRM_DEBUG("Attempting to bind an object (view type=%u) larger than the aperture: size=%u > %s aperture=%llu\n",
		DRM_DEBUG("Attempting to bind an object (view type=%u) larger than the aperture: size=%llu > %s aperture=%llu\n",
			  ggtt_view ? ggtt_view->type : 0,
			  ggtt_view ? ggtt_view->type : 0,
			  size,
			  size,
			  flags & PIN_MAPPABLE ? "mappable" : "total",
			  flags & PIN_MAPPABLE ? "mappable" : "total",