MGS-5261 [#imx-1771] fix dummy draw hang for 8MM GPU
authorXianzhong <xianzhong.li@nxp.com>
Wed, 30 Oct 2019 14:57:20 +0000 (22:57 +0800)
committerXianzhong <xianzhong.li@nxp.com>
Wed, 30 Oct 2019 17:45:37 +0000 (01:45 +0800)
dummy draw is required for 8MM GPU errata - HBN1285,
this fix shall be applied for GPU power-up transition,
otherwise GPU shader hang with the unnecessary flush.

check GPU MMU state to enable dummy draw fix only.

Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit f3f44f213eb1c5210aa4fe723256a2e1e699a4dc)

drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c

index 651e719..bd96297 100644 (file)
@@ -4750,6 +4750,9 @@ gckHARDWARE_SetMMU(
                        "Setting page table to 0x%08X",
                        address);
 
+        /* Trigger a possible dummy draw. */
+        Hardware->kernel->command->dummyDraw = gcvTRUE;
+
         /* Write the AQMemoryFePageTable register. */
         gcmkONERROR(
             gckOS_WriteRegisterEx(Hardware->os,
@@ -5066,6 +5069,9 @@ gckHARDWARE_SetMMU(
  ~0U : (~(~0U << ((1 ? 0:0) - (0 ? 0:0) + 1))))))) << (0 ? 0:0)))
                     ));
             }
+
+            /* Trigger a possible dummy draw. */
+            Hardware->kernel->command->dummyDraw = gcvTRUE;
         }
     }
 
@@ -9439,9 +9445,6 @@ _PmInitializeGPU(
     /* Force the command queue to reload the next context. */
     Command->currContext = gcvNULL;
 
-    /* Trigger a possible dummy draw. */
-    Command->dummyDraw = gcvTRUE;
-
 OnError:
     return status;
 }