summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch')
-rw-r--r--meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch b/meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch
new file mode 100644
index 00000000..0f5fc088
--- /dev/null
+++ b/meta-xilinx-core/recipes-xrt/zocl/files/0001-Fixed-ZOCL-dtbo-path-len-issue-6966.patch
@@ -0,0 +1,84 @@
1From bc19f980cced50fc35f94905f2a99070871b9e93 Mon Sep 17 00:00:00 2001
2From: Saifuddin Kaijar <54270703+saifuddin-xilinx@users.noreply.github.com>
3Date: Mon, 29 Aug 2022 10:25:06 +0530
4Subject: [PATCH] Fixed ZOCL dtbo path len issue (#6966)
5
6---
7 src/runtime_src/core/edge/drm/zocl/include/zocl_xclbin.h | 3 ++-
8 src/runtime_src/core/edge/drm/zocl/zocl_xclbin.c | 7 ++++---
9 src/runtime_src/core/edge/include/zynq_ioctl.h | 1 +
10 src/runtime_src/core/edge/user/shim.cpp | 1 +
11 4 files changed, 8 insertions(+), 4 deletions(-)
12
13diff --git a/src/runtime_src/core/edge/drm/zocl/include/zocl_xclbin.h b/src/runtime_src/core/edge/drm/zocl/include/zocl_xclbin.h
14index c9c9b4f9e..0335551bc 100644
15--- a/src/runtime_src/core/edge/drm/zocl/include/zocl_xclbin.h
16+++ b/src/runtime_src/core/edge/drm/zocl/include/zocl_xclbin.h
17@@ -39,6 +39,7 @@ int zocl_xclbin_load_pdi(struct drm_zocl_dev *zdev, void *data,
18 struct drm_zocl_slot *slot);
19 int zocl_xclbin_load_pskernel(struct drm_zocl_dev *zdev, void *data);
20 bool zocl_xclbin_accel_adapter(int kds_mask);
21-int zocl_xclbin_set_dtbo_path(struct drm_zocl_slot *slot, char *dtbo_path);
22+int zocl_xclbin_set_dtbo_path(struct drm_zocl_slot *slot, char *dtbo_path,
23+ uint32_t len);
24
25 #endif /* _ZOCL_XCLBIN_H_ */
26diff --git a/src/runtime_src/core/edge/drm/zocl/zocl_xclbin.c b/src/runtime_src/core/edge/drm/zocl/zocl_xclbin.c
27index 7de733e38..fdedb70d5 100644
28--- a/src/runtime_src/core/edge/drm/zocl/zocl_xclbin.c
29+++ b/src/runtime_src/core/edge/drm/zocl/zocl_xclbin.c
30@@ -1475,7 +1475,8 @@ zocl_xclbin_read_axlf(struct drm_zocl_dev *zdev, struct drm_zocl_axlf *axlf_obj,
31 */
32 slot->slot_xclbin->zx_refcnt = 0;
33 if(ZOCL_PLATFORM_ARM64)
34- zocl_xclbin_set_dtbo_path(slot, axlf_obj->za_dtbo_path);
35+ zocl_xclbin_set_dtbo_path(slot, axlf_obj->za_dtbo_path,
36+ axlf_obj->za_dtbo_path_len);
37 zocl_xclbin_set_uuid(slot, &axlf_head.m_header.uuid);
38
39 /*
40@@ -1725,7 +1726,8 @@ zocl_xclbin_fini(struct drm_zocl_dev *zdev, struct drm_zocl_slot *slot)
41 * @return 0 on success Error code on failure.
42 */
43 int
44-zocl_xclbin_set_dtbo_path(struct drm_zocl_slot *slot, char *dtbo_path)
45+zocl_xclbin_set_dtbo_path(struct drm_zocl_slot *slot, char *dtbo_path,
46+ uint32_t len)
47 {
48 char *path = slot->slot_xclbin->zx_dtbo_path;
49
50@@ -1735,7 +1737,6 @@ zocl_xclbin_set_dtbo_path(struct drm_zocl_slot *slot, char *dtbo_path)
51 }
52
53 if(dtbo_path) {
54- uint32_t len = strlen(dtbo_path);
55 path = vmalloc(len + 1);
56 if (!path)
57 return -ENOMEM;
58diff --git a/src/runtime_src/core/edge/include/zynq_ioctl.h b/src/runtime_src/core/edge/include/zynq_ioctl.h
59index a45113550..ad9ec86ab 100644
60--- a/src/runtime_src/core/edge/include/zynq_ioctl.h
61+++ b/src/runtime_src/core/edge/include/zynq_ioctl.h
62@@ -429,6 +429,7 @@ struct drm_zocl_axlf {
63 char *za_kernels;
64 uint32_t za_slot_id;
65 char *za_dtbo_path;
66+ uint32_t za_dtbo_path_len;
67 uint8_t hw_gen;
68 struct drm_zocl_kds kds_cfg;
69 };
70diff --git a/src/runtime_src/core/edge/user/shim.cpp b/src/runtime_src/core/edge/user/shim.cpp
71index 11a8d86c9..058503187 100644
72--- a/src/runtime_src/core/edge/user/shim.cpp
73+++ b/src/runtime_src/core/edge/user/shim.cpp
74@@ -732,6 +732,7 @@ xclLoadAxlf(const axlf *buffer)
75 .za_kernels = NULL,
76 .za_slot_id = 0, // TODO Cleanup: Once uuid interface id available we need to remove this
77 .za_dtbo_path = const_cast<char *>(dtbo_path.c_str()),
78+ .za_dtbo_path_len = dtbo_path.length(),
79 .hw_gen = hw_gen,
80 };
81
82--
832.17.1
84