depot/third_party/nixpkgs/pkgs/os-specific/linux/ati-drivers/patches/15.9-mtrr.patch
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

27 lines
991 B
Diff

--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:43:22.000000000 -0400
+++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:52:07.000000000 -0400
@@ -3442,7 +3442,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(vo
int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size)
{
#ifdef CONFIG_MTRR
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+ return arch_phys_wc_add(base, size);
+#else
return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
+#endif
#else /* !CONFIG_MTRR */
return -EPERM;
#endif /* !CONFIG_MTRR */
@@ -3451,7 +3455,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionW
int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size)
{
#ifdef CONFIG_MTRR
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
+ arch_phys_wc_del(reg);
+ return reg;
+#else
return mtrr_del(reg, base, size);
+#endif
#else /* !CONFIG_MTRR */
return -EPERM;
#endif /* !CONFIG_MTRR */