From: Daniel Vetter Date: Mon, 7 Oct 2013 20:15:45 +0000 (-0300) Subject: drm/i915: check that the i965g/gm 4G limit is really obeyed X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3bbbe706e8e6dac36ae893dc23bdb378dd4f4413;p=linux-beck.git drm/i915: check that the i965g/gm 4G limit is really obeyed In truly crazy circumstances shmem might give us the wrong type of page. So be a bit paranoid and double check this. Reviewer: Damien Lespiau Cc: Rob Clark References: http://lkml.org/lkml/2011/7/11/238 Signed-off-by: Daniel Vetter Signed-off-by: Rodrigo Vivi Reviewed-by: Damien Lespiau Signed-off-by: Daniel Vetter --- diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index ed9311aaabe7..71dd0305eb32 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1902,6 +1902,9 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) sg->length += PAGE_SIZE; } last_pfn = page_to_pfn(page); + + /* Check that the i965g/gm workaround works. */ + WARN_ON((gfp & __GFP_DMA32) && (last_pfn >= 0x00100000UL)); } #ifdef CONFIG_SWIOTLB if (!swiotlb_nr_tbl())