From 7e57e8643cdc23da5ba76e846c1a942684e5208a Mon Sep 17 00:00:00 2001 From: Xianzhong Date: Thu, 3 Aug 2017 19:01:31 +0800 Subject: [PATCH] MGS-3155 [#imx-697] fix gpu hang when insmod galcore secondly gpu hang alway happen when insmod galcore secondly on i.mx8mq, this problem is related gpu mmu setup with virtual command buffer. revert the virtual command buffer change to align 6.2.2 driver. Date: Aug 03, 2017 Signed-off-by: Xianzhong --- drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 14 +++++++++++--- .../mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index adab62fb84c1..94f2a2b3dc5d 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -567,10 +567,18 @@ gckKERNEL_Construct( ; /* Initialize virtual command buffer. */ -#if gcdALLOC_CMD_FROM_RESERVE || gcdSECURITY || gcdDISABLE_GPU_VIRTUAL_ADDRESS || !USE_KERNEL_VIRTUAL_BUFFERS - kernel->virtualCommandBuffer = gcvFALSE; +#if (defined(LINUX) || defined(__QNXNTO__)) && !defined(EMULATOR) && !gcdALLOC_CMD_FROM_RESERVE + kernel->virtualCommandBuffer = gcvTRUE; #else - kernel->virtualCommandBuffer = kernel->hardware->enableMMU; + kernel->virtualCommandBuffer = gcvFALSE; +#endif + +#if defined(UNDER_CE) && USE_KERNEL_VIRTUAL_BUFFERS + kernel->virtualCommandBuffer = gcvTRUE; +#endif + +#if gcdSECURITY || gcdDISABLE_GPU_VIRTUAL_ADDRESS + kernel->virtualCommandBuffer = gcvFALSE; #endif #if gcdSHARED_PAGETABLE diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h index ae36961c6507..9e62f99a6210 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h +++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h @@ -82,7 +82,7 @@ This define enables the use of VM for gckCommand and fence buffers. #if defined(UNDER_CE) # define USE_KERNEL_VIRTUAL_BUFFERS 1 #else -# define USE_KERNEL_VIRTUAL_BUFFERS 1 +# define USE_KERNEL_VIRTUAL_BUFFERS 0 #endif #endif -- 2.17.1