public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 1/5] drm/i915: Assert that the partial VMA fits within the object
@ 2016-12-22 10:56 Chris Wilson
  2016-12-22 10:56 ` [PATCH 2/5] drm/i915: Convert i915_ggtt_view to use an anonymous union Chris Wilson
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Chris Wilson @ 2016-12-22 10:56 UTC (permalink / raw)
  To: intel-gfx

When creating a partial VMA assert that it first fits with the parent
object, and that if it covers the whole of the parent a normal view was
created instead.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index cfec4222b04e..3229f37eabea 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -95,8 +95,13 @@ __i915_vma_create(struct drm_i915_gem_object *obj,
 	if (view) {
 		vma->ggtt_view = *view;
 		if (view->type == I915_GGTT_VIEW_PARTIAL) {
+			GEM_BUG_ON(range_overflows_t(u64,
+						     view->params.partial.offset,
+						     view->params.partial.size,
+						     obj->base.size >> PAGE_SHIFT));
 			vma->size = view->params.partial.size;
 			vma->size <<= PAGE_SHIFT;
+			GEM_BUG_ON(vma->size >= obj->base.size);
 		} else if (view->type == I915_GGTT_VIEW_ROTATED) {
 			vma->size =
 				intel_rotation_info_size(&view->params.rotated);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-12-22 18:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-22 10:56 [PATCH 1/5] drm/i915: Assert that the partial VMA fits within the object Chris Wilson
2016-12-22 10:56 ` [PATCH 2/5] drm/i915: Convert i915_ggtt_view to use an anonymous union Chris Wilson
2016-12-22 11:24   ` Joonas Lahtinen
2016-12-22 10:56 ` [PATCH 3/5] drm/i915: Eliminate superfluous i915_ggtt_view_rotated Chris Wilson
2016-12-22 11:20   ` Joonas Lahtinen
2016-12-22 10:56 ` [PATCH 4/5] drm/i915: Eliminate superfluous i915_ggtt_view_normal Chris Wilson
2016-12-22 11:09   ` Joonas Lahtinen
2016-12-22 10:56 ` [PATCH 5/5] drm/i915: Extact compute_partial_view() Chris Wilson
2016-12-22 11:14   ` Joonas Lahtinen
2016-12-22 11:02 ` [PATCH 1/5] drm/i915: Assert that the partial VMA fits within the object Joonas Lahtinen
2016-12-22 11:55 ` kbuild test robot
2016-12-22 18:08 ` ✗ Fi.CI.BAT: failure for series starting with [1/5] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox