diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_device.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 995a8b1770dd..0ec65168f331 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -377,6 +377,37 @@ void radeon_doorbell_free(struct radeon_device *rdev, u32 doorbell) | |||
377 | __clear_bit(doorbell, rdev->doorbell.used); | 377 | __clear_bit(doorbell, rdev->doorbell.used); |
378 | } | 378 | } |
379 | 379 | ||
380 | /** | ||
381 | * radeon_doorbell_get_kfd_info - Report doorbell configuration required to | ||
382 | * setup KFD | ||
383 | * | ||
384 | * @rdev: radeon_device pointer | ||
385 | * @aperture_base: output returning doorbell aperture base physical address | ||
386 | * @aperture_size: output returning doorbell aperture size in bytes | ||
387 | * @start_offset: output returning # of doorbell bytes reserved for radeon. | ||
388 | * | ||
389 | * Radeon and the KFD share the doorbell aperture. Radeon sets it up, | ||
390 | * takes doorbells required for its own rings and reports the setup to KFD. | ||
391 | * Radeon reserved doorbells are at the start of the doorbell aperture. | ||
392 | */ | ||
393 | void radeon_doorbell_get_kfd_info(struct radeon_device *rdev, | ||
394 | phys_addr_t *aperture_base, | ||
395 | size_t *aperture_size, | ||
396 | size_t *start_offset) | ||
397 | { | ||
398 | /* The first num_doorbells are used by radeon. | ||
399 | * KFD takes whatever's left in the aperture. */ | ||
400 | if (rdev->doorbell.size > rdev->doorbell.num_doorbells * sizeof(u32)) { | ||
401 | *aperture_base = rdev->doorbell.base; | ||
402 | *aperture_size = rdev->doorbell.size; | ||
403 | *start_offset = rdev->doorbell.num_doorbells * sizeof(u32); | ||
404 | } else { | ||
405 | *aperture_base = 0; | ||
406 | *aperture_size = 0; | ||
407 | *start_offset = 0; | ||
408 | } | ||
409 | } | ||
410 | |||
380 | /* | 411 | /* |
381 | * radeon_wb_*() | 412 | * radeon_wb_*() |
382 | * Writeback is the the method by which the the GPU updates special pages | 413 | * Writeback is the the method by which the the GPU updates special pages |
@@ -1273,6 +1304,7 @@ int radeon_device_init(struct radeon_device *rdev, | |||
1273 | mutex_init(&rdev->pm.mutex); | 1304 | mutex_init(&rdev->pm.mutex); |
1274 | mutex_init(&rdev->gpu_clock_mutex); | 1305 | mutex_init(&rdev->gpu_clock_mutex); |
1275 | mutex_init(&rdev->srbm_mutex); | 1306 | mutex_init(&rdev->srbm_mutex); |
1307 | mutex_init(&rdev->grbm_idx_mutex); | ||
1276 | init_rwsem(&rdev->pm.mclk_lock); | 1308 | init_rwsem(&rdev->pm.mclk_lock); |
1277 | init_rwsem(&rdev->exclusive_lock); | 1309 | init_rwsem(&rdev->exclusive_lock); |
1278 | init_waitqueue_head(&rdev->irq.vblank_queue); | 1310 | init_waitqueue_head(&rdev->irq.vblank_queue); |