Remove deprecated implementation of hsaKmtMapGraphicHandle

The KFD implementation has been removed and will not be upstreamed.
This API has been superseded by hsaKmtRegisterGraphicsHandleToNodes.

Change-Id: I5f2d8da3260974618cdb6ea3fdcd77d37b82c9cb
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Amber Lin <Amber.Lin@amd.com>


[ROCm/ROCR-Runtime commit: 374bd89d8c]
Tá an tiomantas seo le fáil i:
Felix Kuehling
2017-05-26 15:24:11 -04:00
tiomanta ag Amber Lin
tuismitheoir dd782c86c0
tiomantas fce3048015
D'athraigh 4 comhad le 7 breiseanna agus 106 scriosta
-59
Féach ar an gComhad
@@ -1235,65 +1235,6 @@ void *fmm_allocate_host(uint32_t node_id, uint64_t MemorySizeInBytes,
return fmm_allocate_host_cpu(MemorySizeInBytes, flags);
}
void *fmm_open_graphic_handle(uint32_t gpu_id,
int32_t graphic_device_handle,
uint32_t graphic_handle,
uint64_t MemorySizeInBytes)
{
void *mem = NULL;
int32_t i = gpu_mem_find_by_gpu_id(gpu_id);
struct kfd_ioctl_open_graphic_handle_args open_graphic_handle_args;
struct kfd_ioctl_unmap_memory_from_gpu_args unmap_args;
/* If not found or aperture isn't properly initialized/supported */
if (i < 0 || !aperture_is_valid(gpu_mem[i].gpuvm_aperture.base,
gpu_mem[i].gpuvm_aperture.limit))
return NULL;
pthread_mutex_lock(&gpu_mem[i].gpuvm_aperture.fmm_mutex);
/* Allocate address space */
mem = aperture_allocate_area(&gpu_mem[i].gpuvm_aperture,
MemorySizeInBytes, GPUVM_APP_OFFSET);
if (!mem)
goto out;
/* Allocate local memory */
open_graphic_handle_args.gpu_id = gpu_id;
open_graphic_handle_args.graphic_device_fd = graphic_device_handle;
open_graphic_handle_args.graphic_handle = graphic_handle;
open_graphic_handle_args.va_addr =
VOID_PTRS_SUB(mem, gpu_mem[i].gpuvm_aperture.base);
if (kmtIoctl(kfd_fd, AMDKFD_IOC_OPEN_GRAPHIC_HANDLE,
&open_graphic_handle_args))
goto release_area;
/* Allocate object */
if (!aperture_allocate_object(&gpu_mem[i].gpuvm_aperture, mem,
open_graphic_handle_args.handle,
MemorySizeInBytes, 0))
goto release_mem;
pthread_mutex_unlock(&gpu_mem[i].gpuvm_aperture.fmm_mutex);
/* That's all. Just return the new address */
return mem;
release_mem:
unmap_args.handle = open_graphic_handle_args.handle;
unmap_args.device_ids_array_ptr = 0;
unmap_args.device_ids_array_size = 0;
kmtIoctl(kfd_fd, AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU, &unmap_args);
release_area:
aperture_release_area(&gpu_mem[i].gpuvm_aperture, mem,
MemorySizeInBytes);
out:
pthread_mutex_unlock(&gpu_mem[i].gpuvm_aperture.fmm_mutex);
return NULL;
}
static void __fmm_release(void *address, manageable_aperture_t *aperture)
{
struct kfd_ioctl_free_memory_of_gpu_args args;
-4
Féach ar an gComhad
@@ -53,10 +53,6 @@ void *fmm_allocate_device(uint32_t gpu_id, uint64_t MemorySizeInBytes, HsaMemFla
void *fmm_allocate_doorbell(uint32_t gpu_id, uint64_t MemorySizeInBytes, uint64_t doorbell_offset);
void *fmm_allocate_host(uint32_t node_id, uint64_t MemorySizeInBytes,
HsaMemFlags flags);
void *fmm_open_graphic_handle(uint32_t gpu_id,
int32_t graphic_device_handle,
uint32_t graphic_handle,
uint64_t MemorySizeInBytes);
void fmm_print(uint32_t node);
bool fmm_is_inside_some_aperture(void *address);
void fmm_release(void *address);
+6 -24
Féach ar an gComhad
@@ -460,30 +460,12 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtMapGraphicHandle(HSAuint32 NodeId,
HSAuint64 GraphicResourceSize,
HSAuint64 *FlatMemoryAddress)
{
CHECK_KFD_OPEN();
HSAKMT_STATUS result;
uint32_t gpu_id;
void *graphic_handle;
if (GraphicResourceOffset != 0)
return HSAKMT_STATUS_NOT_IMPLEMENTED;
result = validate_nodeid(NodeId, &gpu_id);
if (result != HSAKMT_STATUS_SUCCESS)
return result;
graphic_handle = fmm_open_graphic_handle(gpu_id,
GraphicDeviceHandle,
GraphicResourceHandle,
GraphicResourceSize);
*FlatMemoryAddress = PORT_VPTR_TO_UINT64(graphic_handle);
if (*FlatMemoryAddress)
return HSAKMT_STATUS_SUCCESS;
else
return HSAKMT_STATUS_NO_MEMORY;
/* This API was only ever implemented in KFD for Kaveri and
* was never upstreamed. There are no open-source users of
* this interface. It has been superseded by
* RegisterGraphicsHandleToNodes.
*/
return HSAKMT_STATUS_NOT_IMPLEMENTED;
}
HSAKMT_STATUS HSAKMTAPI hsaKmtUnmapGraphicHandle(HSAuint32 NodeId,