Skip to content

Commit

Permalink
added deprecated tag (Xilinx#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarab96 authored and maxzhen committed Nov 13, 2019
1 parent 1317499 commit 64a9a22
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/runtime_src/core/include/xrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
36 changes: 33 additions & 3 deletions src/xma/src/xmaplugin/xmaplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions src/xma/xma_legacy/src/xmaplugin/xmaplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 64a9a22

Please sign in to comment.