From b1ee6aaa4f100778935952f047f8dd89aa0b1f8d Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Mon, 20 Apr 2015 11:53:39 +0300 Subject: [PATCH] drm/i915: fill scratch page Fill scratch page other than zeroes to limit the damage when gpu wanders into scratch land. Signed-off-by: Mika Kuoppala --- drivers/gpu/drm/i915/i915_gem_gtt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 9041f3d..9214d79 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c @@ -2313,6 +2313,7 @@ static int setup_scratch_page(struct drm_device *dev) struct drm_i915_private *dev_priv = dev->dev_private; struct page *page; dma_addr_t dma_addr; + u32 *vaddr; page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO); if (page == NULL) @@ -2327,6 +2328,11 @@ static int setup_scratch_page(struct drm_device *dev) #else dma_addr = page_to_phys(page); #endif + + vaddr = kmap_atomic(page); + memset(vaddr, 0xff, PAGE_SIZE); + kunmap_atomic(vaddr); + dev_priv->gtt.base.scratch.page = page; dev_priv->gtt.base.scratch.addr = dma_addr; -- 1.9.1