diff --git a/src/runtime_src/core/include/xrt.h b/src/runtime_src/core/include/xrt.h index 3ed3b30b6ca..ba2e3f55d74 100644 --- a/src/runtime_src/core/include/xrt.h +++ b/src/runtime_src/core/include/xrt.h @@ -634,6 +634,8 @@ XCL_DRIVER_DLLESPEC int xclGetBOProperties(xclDeviceHandle handle, xclBufferHand * This API is deprecated and will be removed in future release. * New clients should use xclGetBOProperties() instead */ +XRT_DEPRECATED +XCL_DRIVER_DLLESPEC size_t xclGetBOSize(xclDeviceHandle handle, xclBufferHandle boHandle); inline XCL_DRIVER_DLLESPEC size_t xclGetBOSize(xclDeviceHandle handle, xclBufferHandle boHandle) { struct xclBOProperties p; @@ -650,6 +652,8 @@ inline XCL_DRIVER_DLLESPEC size_t xclGetBOSize(xclDeviceHandle handle, xclBuffer * @boHandle: BO handle * @return uint64_t address of the BO on success */ +XRT_DEPRECATED +XCL_DRIVER_DLLESPEC uint64_t xclGetDeviceAddr(xclDeviceHandle handle, xclBufferHandle boHandle); inline XCL_DRIVER_DLLESPEC uint64_t xclGetDeviceAddr(xclDeviceHandle handle, xclBufferHandle boHandle) { struct xclBOProperties p; diff --git a/src/xma/src/xmaplugin/xmaplugin.cpp b/src/xma/src/xmaplugin/xmaplugin.cpp index d5c1a8d2909..58a6604aa7d 100644 --- a/src/xma/src/xmaplugin/xmaplugin.cpp +++ b/src/xma/src/xmaplugin/xmaplugin.cpp @@ -109,7 +109,17 @@ xma_plg_buffer_alloc(XmaSession s_handle, size_t size, bool device_only_buffer, return b_obj_error; } */ - b_obj.paddr = xclGetDeviceAddr(dev_handle, b_obj_handle); + + struct xclBOProperties bop; + if (xclGetBOProperties(dev_handle, b_obj_handle, &bop) != 0) { + xma_logmsg(XMA_ERROR_LOG, XMAPLUGIN_MOD, "xma_plg_buffer_alloc failed to get BO properties\n"); + xclFreeBO(dev_handle, b_obj_handle); + if (return_code) *return_code = XMA_ERROR; + return b_obj_error; + + } + b_obj.paddr = bop.paddr; + if (!device_only_buffer) { b_obj.data = (uint8_t*) xclMapBO(dev_handle, b_obj_handle, true); } @@ -201,7 +211,17 @@ XmaBufferObj xma_plg_buffer_alloc_arg_num(XmaSession s_handle, size_t size, bool } else { b_obj_handle = xclAllocBO(dev_handle, size, 0, ddr_bank); } - b_obj.paddr = xclGetDeviceAddr(dev_handle, b_obj_handle); + + struct xclBOProperties bop; + if (xclGetBOProperties(dev_handle, b_obj_handle, &bop) != 0) { + xma_logmsg(XMA_ERROR_LOG, XMAPLUGIN_MOD, "xma_plg_buffer_alloc failed to get BO properties\n"); + xclFreeBO(dev_handle, b_obj_handle); + if (return_code) *return_code = XMA_ERROR; + return b_obj_error; + + } + b_obj.paddr = bop.paddr; + if (!device_only_buffer) { b_obj.data = (uint8_t*) xclMapBO(dev_handle, b_obj_handle, true); } @@ -316,7 +336,17 @@ xma_plg_buffer_alloc_ddr(XmaSession s_handle, size_t size, bool device_only_buff return b_obj_error; } */ - b_obj.paddr = xclGetDeviceAddr(dev_handle, b_obj_handle); + + struct xclBOProperties bop; + if (xclGetBOProperties(dev_handle, b_obj_handle, &bop) != 0) { + xma_logmsg(XMA_ERROR_LOG, XMAPLUGIN_MOD, "xma_plg_buffer_alloc failed to get BO properties\n"); + xclFreeBO(dev_handle, b_obj_handle); + if (return_code) *return_code = XMA_ERROR; + return b_obj_error; + + } + b_obj.paddr = bop.paddr; + if (!device_only_buffer) { b_obj.data = (uint8_t*) xclMapBO(dev_handle, b_obj_handle, true); } diff --git a/src/xma/xma_legacy/src/xmaplugin/xmaplugin.cpp b/src/xma/xma_legacy/src/xmaplugin/xmaplugin.cpp index cf7349dceeb..f6a6dfc545e 100644 --- a/src/xma/xma_legacy/src/xmaplugin/xmaplugin.cpp +++ b/src/xma/xma_legacy/src/xmaplugin/xmaplugin.cpp @@ -66,7 +66,10 @@ xma_plg_get_paddr(XmaHwSession s_handle, XmaBufferHandle b_handle) { uint64_t paddr; xclDeviceHandle dev_handle = s_handle.dev_handle; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" paddr = xclGetDeviceAddr(dev_handle, b_handle); +#pragma GCC diagnostic pop #if 0 printf("xma_plg_get_paddr b_handle = %d, paddr = %lx\n", b_handle, paddr); #endif