summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorOded Gabbay <oded.gabbay@amd.com>2014-10-26 20:45:45 +0200
committerOded Gabbay <oded.gabbay@amd.com>2015-01-09 22:26:07 +0200
commite27ade73fd38055bd6b374ff86fcd02c0f22b3f3 (patch)
treed40d32e0b7bfa8a0f36787adf6f80fb2042b31fd /drivers/gpu/drm/amd
parentd7a60d8ea5cd4560e0496d2683643d2e4930e609 (diff)
downloadtalos-op-linux-e27ade73fd38055bd6b374ff86fcd02c0f22b3f3.tar.gz
talos-op-linux-e27ade73fd38055bd6b374ff86fcd02c0f22b3f3.zip
drm/amd: Add new kfd-->kgd interface for gart usage
This patch adds two new functions to the kfd-->kgd interface: init_gtt_mem_allocation, which allocate a large enough buffer on the amdkfd needs, such as mqds, hpds, kernel queue, fence and runlists. This function is only called once per GPU device. The size of the allocated buffer is based on the maximum number of HSA processes and maximum number of queues per HSA process (two amdkfd kernel module parameters). free_gtt_mem, which frees a buffer that was allocated on the gart aperture. Signed-off-by: Oded Gabbay <oded.gabbay@amd.com> Reviewed-by: Alexey Skidanov <Alexey.skidanov@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/include/kgd_kfd_interface.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
index 094631f61339..3a1219005ad5 100644
--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@ -122,6 +122,11 @@ struct kgd2kfd_calls {
*
* @free_mem: Frees a buffer that was allocated by amdkfd's sa manager
*
+ * @init_gtt_mem_allocation: Allocate a buffer on the gart aperture.
+ * The buffer can be used for mqds, hpds, kernel queue, fence and runlists
+ *
+ * @free_gtt_mem: Frees a buffer that was allocated on the gart aperture
+ *
* @get_vmem_size: Retrieves (physical) size of VRAM
*
* @get_gpu_clock_counter: Retrieves GPU clock counter
@@ -168,8 +173,12 @@ struct kfd2kgd_calls {
void (*fini_sa_manager)(struct kgd_dev *kgd);
int (*allocate_mem)(struct kgd_dev *kgd, size_t size, size_t alignment,
enum kgd_memory_pool pool, struct kgd_mem **mem);
+ int (*init_gtt_mem_allocation)(struct kgd_dev *kgd, size_t size,
+ void **mem_obj, uint64_t *gpu_addr,
+ void **cpu_ptr);
void (*free_mem)(struct kgd_dev *kgd, struct kgd_mem *mem);
+ void (*free_gtt_mem)(struct kgd_dev *kgd, void *mem_obj);
uint64_t (*get_vmem_size)(struct kgd_dev *kgd);
uint64_t (*get_gpu_clock_counter)(struct kgd_dev *kgd);
OpenPOWER on IntegriCloud