From 3930833ef2781427cccc0860a86525498d646f72 Mon Sep 17 00:00:00 2001
From: Qiang Yu <yuq825@gmail.com>
Date: Thu, 31 May 2018 16:19:07 +0800
Subject: [PATCH 070/146] drm/lima: clear vm page table when alloc

ttm_bo_type_kernel will not be cleared when alloc.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
---
 drivers/gpu/drm/lima/lima_vm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/lima/lima_vm.c b/drivers/gpu/drm/lima/lima_vm.c
index ab7438685234..514115df4e4c 100644
--- a/drivers/gpu/drm/lima/lima_vm.c
+++ b/drivers/gpu/drm/lima/lima_vm.c
@@ -98,6 +98,7 @@ static int lima_vm_map_page_table(struct lima_vm *vm, dma_addr_t *dma,
 				err = PTR_ERR(bt);
 				goto err_out;
 			}
+			memset(bt, 0, LIMA_PAGE_SIZE << LIMA_VM_NUM_PT_PER_BT_SHIFT);
 
 			vm->bts[pbe] = bt_bo;
 			pd = lima_bo_kmap(vm->pd);
@@ -286,6 +287,7 @@ struct lima_vm *lima_vm_create(struct lima_device *dev)
 	pd = lima_bo_kmap(vm->pd);
 	if (IS_ERR(pd))
 		goto err_out1;
+	memset(pd, 0, LIMA_PAGE_SIZE);
 
 	if (dev->dlbu_cpu) {
 		int err = lima_vm_map_page_table(
-- 
2.17.1