Commit dc102c43 authored by Andres Rodriguez's avatar Andres Rodriguez Committed by Alex Deucher

drm/amdgpu: rename rdev to adev

Rename straggler instances of r(adeon)dev to a(mdgpu)dev
Reviewed-by: default avatarEdward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAndres Rodriguez <andresx7@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8ae0d2b8
...@@ -60,9 +60,9 @@ int amdgpu_amdkfd_init(void) ...@@ -60,9 +60,9 @@ int amdgpu_amdkfd_init(void)
return ret; return ret;
} }
bool amdgpu_amdkfd_load_interface(struct amdgpu_device *rdev) bool amdgpu_amdkfd_load_interface(struct amdgpu_device *adev)
{ {
switch (rdev->asic_type) { switch (adev->asic_type) {
#ifdef CONFIG_DRM_AMDGPU_CIK #ifdef CONFIG_DRM_AMDGPU_CIK
case CHIP_KAVERI: case CHIP_KAVERI:
kfd2kgd = amdgpu_amdkfd_gfx_7_get_functions(); kfd2kgd = amdgpu_amdkfd_gfx_7_get_functions();
...@@ -86,16 +86,16 @@ void amdgpu_amdkfd_fini(void) ...@@ -86,16 +86,16 @@ void amdgpu_amdkfd_fini(void)
} }
} }
void amdgpu_amdkfd_device_probe(struct amdgpu_device *rdev) void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev)
{ {
if (kgd2kfd) if (kgd2kfd)
rdev->kfd = kgd2kfd->probe((struct kgd_dev *)rdev, adev->kfd = kgd2kfd->probe((struct kgd_dev *)adev,
rdev->pdev, kfd2kgd); adev->pdev, kfd2kgd);
} }
void amdgpu_amdkfd_device_init(struct amdgpu_device *rdev) void amdgpu_amdkfd_device_init(struct amdgpu_device *adev)
{ {
if (rdev->kfd) { if (adev->kfd) {
struct kgd2kfd_shared_resources gpu_resources = { struct kgd2kfd_shared_resources gpu_resources = {
.compute_vmid_bitmap = 0xFF00, .compute_vmid_bitmap = 0xFF00,
...@@ -103,42 +103,42 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *rdev) ...@@ -103,42 +103,42 @@ void amdgpu_amdkfd_device_init(struct amdgpu_device *rdev)
.compute_pipe_count = 4 - 1, .compute_pipe_count = 4 - 1,
}; };
amdgpu_doorbell_get_kfd_info(rdev, amdgpu_doorbell_get_kfd_info(adev,
&gpu_resources.doorbell_physical_address, &gpu_resources.doorbell_physical_address,
&gpu_resources.doorbell_aperture_size, &gpu_resources.doorbell_aperture_size,
&gpu_resources.doorbell_start_offset); &gpu_resources.doorbell_start_offset);
kgd2kfd->device_init(rdev->kfd, &gpu_resources); kgd2kfd->device_init(adev->kfd, &gpu_resources);
} }
} }
void amdgpu_amdkfd_device_fini(struct amdgpu_device *rdev) void amdgpu_amdkfd_device_fini(struct amdgpu_device *adev)
{ {
if (rdev->kfd) { if (adev->kfd) {
kgd2kfd->device_exit(rdev->kfd); kgd2kfd->device_exit(adev->kfd);
rdev->kfd = NULL; adev->kfd = NULL;
} }
} }
void amdgpu_amdkfd_interrupt(struct amdgpu_device *rdev, void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev,
const void *ih_ring_entry) const void *ih_ring_entry)
{ {
if (rdev->kfd) if (adev->kfd)
kgd2kfd->interrupt(rdev->kfd, ih_ring_entry); kgd2kfd->interrupt(adev->kfd, ih_ring_entry);
} }
void amdgpu_amdkfd_suspend(struct amdgpu_device *rdev) void amdgpu_amdkfd_suspend(struct amdgpu_device *adev)
{ {
if (rdev->kfd) if (adev->kfd)
kgd2kfd->suspend(rdev->kfd); kgd2kfd->suspend(adev->kfd);
} }
int amdgpu_amdkfd_resume(struct amdgpu_device *rdev) int amdgpu_amdkfd_resume(struct amdgpu_device *adev)
{ {
int r = 0; int r = 0;
if (rdev->kfd) if (adev->kfd)
r = kgd2kfd->resume(rdev->kfd); r = kgd2kfd->resume(adev->kfd);
return r; return r;
} }
...@@ -147,7 +147,7 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, ...@@ -147,7 +147,7 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
void **mem_obj, uint64_t *gpu_addr, void **mem_obj, uint64_t *gpu_addr,
void **cpu_ptr) void **cpu_ptr)
{ {
struct amdgpu_device *rdev = (struct amdgpu_device *)kgd; struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
struct kgd_mem **mem = (struct kgd_mem **) mem_obj; struct kgd_mem **mem = (struct kgd_mem **) mem_obj;
int r; int r;
...@@ -159,10 +159,10 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, ...@@ -159,10 +159,10 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
if ((*mem) == NULL) if ((*mem) == NULL)
return -ENOMEM; return -ENOMEM;
r = amdgpu_bo_create(rdev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_GTT, r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_GTT,
AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &(*mem)->bo); AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &(*mem)->bo);
if (r) { if (r) {
dev_err(rdev->dev, dev_err(adev->dev,
"failed to allocate BO for amdkfd (%d)\n", r); "failed to allocate BO for amdkfd (%d)\n", r);
return r; return r;
} }
...@@ -170,21 +170,21 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, ...@@ -170,21 +170,21 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size,
/* map the buffer */ /* map the buffer */
r = amdgpu_bo_reserve((*mem)->bo, true); r = amdgpu_bo_reserve((*mem)->bo, true);
if (r) { if (r) {
dev_err(rdev->dev, "(%d) failed to reserve bo for amdkfd\n", r); dev_err(adev->dev, "(%d) failed to reserve bo for amdkfd\n", r);
goto allocate_mem_reserve_bo_failed; goto allocate_mem_reserve_bo_failed;
} }
r = amdgpu_bo_pin((*mem)->bo, AMDGPU_GEM_DOMAIN_GTT, r = amdgpu_bo_pin((*mem)->bo, AMDGPU_GEM_DOMAIN_GTT,
&(*mem)->gpu_addr); &(*mem)->gpu_addr);
if (r) { if (r) {
dev_err(rdev->dev, "(%d) failed to pin bo for amdkfd\n", r); dev_err(adev->dev, "(%d) failed to pin bo for amdkfd\n", r);
goto allocate_mem_pin_bo_failed; goto allocate_mem_pin_bo_failed;
} }
*gpu_addr = (*mem)->gpu_addr; *gpu_addr = (*mem)->gpu_addr;
r = amdgpu_bo_kmap((*mem)->bo, &(*mem)->cpu_ptr); r = amdgpu_bo_kmap((*mem)->bo, &(*mem)->cpu_ptr);
if (r) { if (r) {
dev_err(rdev->dev, dev_err(adev->dev,
"(%d) failed to map bo to kernel for amdkfd\n", r); "(%d) failed to map bo to kernel for amdkfd\n", r);
goto allocate_mem_kmap_bo_failed; goto allocate_mem_kmap_bo_failed;
} }
...@@ -220,27 +220,27 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj) ...@@ -220,27 +220,27 @@ void free_gtt_mem(struct kgd_dev *kgd, void *mem_obj)
uint64_t get_vmem_size(struct kgd_dev *kgd) uint64_t get_vmem_size(struct kgd_dev *kgd)
{ {
struct amdgpu_device *rdev = struct amdgpu_device *adev =
(struct amdgpu_device *)kgd; (struct amdgpu_device *)kgd;
BUG_ON(kgd == NULL); BUG_ON(kgd == NULL);
return rdev->mc.real_vram_size; return adev->mc.real_vram_size;
} }
uint64_t get_gpu_clock_counter(struct kgd_dev *kgd) uint64_t get_gpu_clock_counter(struct kgd_dev *kgd)
{ {
struct amdgpu_device *rdev = (struct amdgpu_device *)kgd; struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
if (rdev->gfx.funcs->get_gpu_clock_counter) if (adev->gfx.funcs->get_gpu_clock_counter)
return rdev->gfx.funcs->get_gpu_clock_counter(rdev); return adev->gfx.funcs->get_gpu_clock_counter(adev);
return 0; return 0;
} }
uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd) uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd)
{ {
struct amdgpu_device *rdev = (struct amdgpu_device *)kgd; struct amdgpu_device *adev = (struct amdgpu_device *)kgd;
/* The sclk is in quantas of 10kHz */ /* The sclk is in quantas of 10kHz */
return rdev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk / 100; return adev->pm.dpm.dyn_state.max_clock_voltage_on_ac.sclk / 100;
} }
...@@ -39,15 +39,15 @@ struct kgd_mem { ...@@ -39,15 +39,15 @@ struct kgd_mem {
int amdgpu_amdkfd_init(void); int amdgpu_amdkfd_init(void);
void amdgpu_amdkfd_fini(void); void amdgpu_amdkfd_fini(void);
bool amdgpu_amdkfd_load_interface(struct amdgpu_device *rdev); bool amdgpu_amdkfd_load_interface(struct amdgpu_device *adev);
void amdgpu_amdkfd_suspend(struct amdgpu_device *rdev); void amdgpu_amdkfd_suspend(struct amdgpu_device *adev);
int amdgpu_amdkfd_resume(struct amdgpu_device *rdev); int amdgpu_amdkfd_resume(struct amdgpu_device *adev);
void amdgpu_amdkfd_interrupt(struct amdgpu_device *rdev, void amdgpu_amdkfd_interrupt(struct amdgpu_device *adev,
const void *ih_ring_entry); const void *ih_ring_entry);
void amdgpu_amdkfd_device_probe(struct amdgpu_device *rdev); void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev);
void amdgpu_amdkfd_device_init(struct amdgpu_device *rdev); void amdgpu_amdkfd_device_init(struct amdgpu_device *adev);
void amdgpu_amdkfd_device_fini(struct amdgpu_device *rdev); void amdgpu_amdkfd_device_fini(struct amdgpu_device *adev);
struct kfd2kgd_calls *amdgpu_amdkfd_gfx_7_get_functions(void); struct kfd2kgd_calls *amdgpu_amdkfd_gfx_7_get_functions(void);
struct kfd2kgd_calls *amdgpu_amdkfd_gfx_8_0_get_functions(void); struct kfd2kgd_calls *amdgpu_amdkfd_gfx_8_0_get_functions(void);
......
...@@ -1839,7 +1839,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev) ...@@ -1839,7 +1839,7 @@ static void gfx_v7_0_setup_rb(struct amdgpu_device *adev)
/** /**
* gmc_v7_0_init_compute_vmid - gart enable * gmc_v7_0_init_compute_vmid - gart enable
* *
* @rdev: amdgpu_device pointer * @adev: amdgpu_device pointer
* *
* Initialize compute vmid sh_mem registers * Initialize compute vmid sh_mem registers
* *
......
...@@ -3826,7 +3826,7 @@ static void gfx_v8_0_setup_rb(struct amdgpu_device *adev) ...@@ -3826,7 +3826,7 @@ static void gfx_v8_0_setup_rb(struct amdgpu_device *adev)
/** /**
* gfx_v8_0_init_compute_vmid - gart enable * gfx_v8_0_init_compute_vmid - gart enable
* *
* @rdev: amdgpu_device pointer * @adev: amdgpu_device pointer
* *
* Initialize compute vmid sh_mem registers * Initialize compute vmid sh_mem registers
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment