]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ArmPlatformPkg/ArmVExpressPkg/Library/HdLcdArmVExpressLib/HdLcdArmVExpress.c
ArmPlatformPkg/HdLcdArmVExpressLib: use write-combine mapping for VRAM
[mirror_edk2.git] / ArmPlatformPkg / ArmVExpressPkg / Library / HdLcdArmVExpressLib / HdLcdArmVExpress.c
index 67b2f14beee3b42dbb59a14d93cdb145f34bdad2..b1106ee19b98cebac01820924514eac79b97d0d5 100644 (file)
 #include <Library/IoLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/DebugLib.h>\r
+#include <Library/DxeServicesTableLib.h>\r
 #include <Library/LcdPlatformLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 \r
-#include <Protocol/Cpu.h>\r
 #include <Protocol/EdidDiscovered.h>\r
 #include <Protocol/EdidActive.h>\r
 \r
@@ -119,7 +119,6 @@ LcdPlatformGetVram (
   )\r
 {\r
   EFI_STATUS              Status;\r
-  EFI_CPU_ARCH_PROTOCOL  *Cpu;\r
   EFI_ALLOCATE_TYPE       AllocationType;\r
 \r
   // Set the vram size\r
@@ -138,12 +137,9 @@ LcdPlatformGetVram (
     return Status;\r
   }\r
 \r
-  // Ensure the Cpu architectural protocol is already installed\r
-  Status = gBS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID **)&Cpu);\r
-  ASSERT_EFI_ERROR(Status);\r
-\r
-  // Mark the VRAM as un-cacheable. The VRAM is inside the DRAM, which is cacheable.\r
-  Status = Cpu->SetMemoryAttributes (Cpu, *VramBaseAddress, *VramSize, EFI_MEMORY_UC);\r
+  // Mark the VRAM as write-combining. The VRAM is inside the DRAM, which is cacheable.\r
+  Status = gDS->SetMemorySpaceAttributes (*VramBaseAddress, *VramSize,\r
+                  EFI_MEMORY_WC);\r
   ASSERT_EFI_ERROR(Status);\r
   if (EFI_ERROR(Status)) {\r
     gBS->FreePages (*VramBaseAddress, EFI_SIZE_TO_PAGES (*VramSize));\r