summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c4
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c12
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.h2
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c2
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/gmc_v7_0.c2
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/gmc_v8_0.c2
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c2
-rw-r--r--sys/dev/pci/drm/include/drm/ttm/ttm_set_memory.h4
-rw-r--r--sys/dev/pci/drm/include/generated/autoconf.h12
-rw-r--r--sys/dev/pci/drm/radeon/radeon_device.c2
-rw-r--r--sys/dev/pci/drm/radeon/radeon_gart.c4
-rw-r--r--sys/dev/pci/drm/ttm/ttm_bo_util.c2
12 files changed, 23 insertions, 27 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c
index 85326b2aaa1..51b5e977ca8 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_ib.c
@@ -187,7 +187,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
if (job && ring->funcs->init_cond_exec)
patch_offset = amdgpu_ring_init_cond_exec(ring);
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (!(adev->flags & AMD_IS_APU))
#endif
{
@@ -224,7 +224,7 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
if (ring->funcs->emit_tmz)
amdgpu_ring_emit_tmz(ring, false);
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (!(adev->flags & AMD_IS_APU))
#endif
amdgpu_asic_invalidate_hdp(adev, ring);
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c
index b2f93eb5ac9..30ed93252bf 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c
@@ -420,18 +420,6 @@ fail:
return false;
}
-#ifdef __amd64__
-#define CONFIG_X86 1
-#define CONFIG_X86_64 1
-#define CONFIG_X86_PAT 1
-#endif
-
-#ifdef __i386__
-#define CONFIG_X86 1
-#define CONFIG_X86_32 1
-#define CONFIG_X86_PAT 1
-#endif
-
static int amdgpu_bo_do_create(struct amdgpu_device *adev,
struct amdgpu_bo_param *bp,
struct amdgpu_bo **bo_ptr)
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.h b/sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.h
index a4a52484370..efb824f393f 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.h
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_virt.h
@@ -270,7 +270,7 @@ struct amdgpu_virt {
static inline bool is_virtual_machine(void)
{
-#if defined(__amd64__) || defined(__i386__)
+#ifdef CONFIG_X86
return boot_cpu_has(X86_FEATURE_HYPERVISOR);
#else
return false;
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c
index 6bec75d65f3..d04371d8303 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vm.c
@@ -3033,7 +3033,7 @@ void amdgpu_vm_manager_init(struct amdgpu_device *adev)
/* If not overridden by the user, by default, only in large BAR systems
* Compute VM tables will be updated by CPU
*/
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (amdgpu_vm_update_mode == -1) {
if (amdgpu_gmc_vram_full_visible(&adev->gmc))
adev->vm_manager.vm_update_mode =
diff --git a/sys/dev/pci/drm/amd/amdgpu/gmc_v7_0.c b/sys/dev/pci/drm/amd/amdgpu/gmc_v7_0.c
index 2685032dbd3..cbfb2811be1 100644
--- a/sys/dev/pci/drm/amd/amdgpu/gmc_v7_0.c
+++ b/sys/dev/pci/drm/amd/amdgpu/gmc_v7_0.c
@@ -376,7 +376,7 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
adev->gmc.aper_base = adev->fb_aper_offset;
adev->gmc.aper_size = adev->fb_aper_size;
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (adev->flags & AMD_IS_APU) {
adev->gmc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
adev->gmc.aper_size = adev->gmc.real_vram_size;
diff --git a/sys/dev/pci/drm/amd/amdgpu/gmc_v8_0.c b/sys/dev/pci/drm/amd/amdgpu/gmc_v8_0.c
index 9aeb237b674..f0bf28baa60 100644
--- a/sys/dev/pci/drm/amd/amdgpu/gmc_v8_0.c
+++ b/sys/dev/pci/drm/amd/amdgpu/gmc_v8_0.c
@@ -578,7 +578,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
adev->gmc.aper_base = adev->fb_aper_offset;
adev->gmc.aper_size = adev->fb_aper_size;
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (adev->flags & AMD_IS_APU) {
adev->gmc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
adev->gmc.aper_size = adev->gmc.real_vram_size;
diff --git a/sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c b/sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c
index c58bfffb74d..c76aff18e63 100644
--- a/sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c
+++ b/sys/dev/pci/drm/amd/amdgpu/gmc_v9_0.c
@@ -746,7 +746,7 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev)
adev->gmc.aper_base = adev->fb_aper_offset;
adev->gmc.aper_size = adev->fb_aper_size;
-#ifdef __amd64__
+#ifdef CONFIG_X86_64
if (adev->flags & AMD_IS_APU) {
adev->gmc.aper_base = gfxhub_v1_0_get_mc_fb_offset(adev);
adev->gmc.aper_size = adev->gmc.real_vram_size;
diff --git a/sys/dev/pci/drm/include/drm/ttm/ttm_set_memory.h b/sys/dev/pci/drm/include/drm/ttm/ttm_set_memory.h
index c1cb9054c0b..035fc418152 100644
--- a/sys/dev/pci/drm/include/drm/ttm/ttm_set_memory.h
+++ b/sys/dev/pci/drm/include/drm/ttm/ttm_set_memory.h
@@ -33,10 +33,6 @@
#include <linux/mm.h>
-#if defined(__amd64__) || defined(__i386__)
-#define CONFIG_X86
-#endif
-
#ifdef CONFIG_X86
#include <asm/set_memory.h>
diff --git a/sys/dev/pci/drm/include/generated/autoconf.h b/sys/dev/pci/drm/include/generated/autoconf.h
index 110849b5e32..d6bec05d76d 100644
--- a/sys/dev/pci/drm/include/generated/autoconf.h
+++ b/sys/dev/pci/drm/include/generated/autoconf.h
@@ -35,3 +35,15 @@
#if defined(__amd64__) || defined(__i386__)
#define CONFIG_DMI 1
#endif
+
+#ifdef __amd64__
+#define CONFIG_X86 1
+#define CONFIG_X86_64 1
+#define CONFIG_X86_PAT 1
+#endif
+
+#ifdef __i386__
+#define CONFIG_X86 1
+#define CONFIG_X86_32 1
+#define CONFIG_X86_PAT 1
+#endif
diff --git a/sys/dev/pci/drm/radeon/radeon_device.c b/sys/dev/pci/drm/radeon/radeon_device.c
index 67cd6d06352..b130f53dfa4 100644
--- a/sys/dev/pci/drm/radeon/radeon_device.c
+++ b/sys/dev/pci/drm/radeon/radeon_device.c
@@ -640,7 +640,7 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc)
*/
bool radeon_device_is_virtual(void)
{
-#if defined(__amd64__) || defined(__i386__)
+#ifdef CONFIG_X86
return (cpu_ecxfeature & CPUIDECX_HV);
#else
return false;
diff --git a/sys/dev/pci/drm/radeon/radeon_gart.c b/sys/dev/pci/drm/radeon/radeon_gart.c
index 3c1a6191d72..ae6202eadfa 100644
--- a/sys/dev/pci/drm/radeon/radeon_gart.c
+++ b/sys/dev/pci/drm/radeon/radeon_gart.c
@@ -70,7 +70,7 @@ int radeon_gart_table_ram_alloc(struct radeon_device *rdev)
struct drm_dmamem *dmah;
int flags = 0;
-#if defined(__amd64__) || defined(__i386__)
+#ifdef CONFIG_X86
if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 ||
rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
flags |= BUS_DMA_NOCACHE;
@@ -102,7 +102,7 @@ void radeon_gart_table_ram_free(struct radeon_device *rdev)
if (rdev->gart.ptr == NULL) {
return;
}
-#ifdef CONFIG_X86
+#if defined (CONFIG_X86) && defined(__linux__)
if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480 ||
rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
set_memory_wb((unsigned long)rdev->gart.ptr,
diff --git a/sys/dev/pci/drm/ttm/ttm_bo_util.c b/sys/dev/pci/drm/ttm/ttm_bo_util.c
index 7bfff6285c4..5307a269b41 100644
--- a/sys/dev/pci/drm/ttm/ttm_bo_util.c
+++ b/sys/dev/pci/drm/ttm/ttm_bo_util.c
@@ -272,7 +272,7 @@ static int ttm_copy_io_page(void *dst, void *src, unsigned long page)
return 0;
}
-#ifdef CONFIG_X86
+#if defined(CONFIG_X86) && defined(__linux__)
#define __ttm_kmap_atomic_prot(__page, __prot) kmap_atomic_prot(__page, __prot)
#define __ttm_kunmap_atomic(__addr) kunmap_atomic(__addr)
#else