Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions CMake/pkg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ execute_process(
OUTPUT_VARIABLE XDNA_CPACK_LINUX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND bash -c "source /etc/os-release && echo \"\$ID \$ID_LIKE\""
OUTPUT_VARIABLE XDNA_CPACK_LINUX_PKG_FLAVOR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (EXISTS "/etc/arch-release")
set(XDNA_CPACK_LINUX_PKG_FLAVOR "arch")
else()
execute_process(
COMMAND bash -c "source /etc/os-release && echo \"\$ID \$ID_LIKE\""
OUTPUT_VARIABLE XDNA_CPACK_LINUX_PKG_FLAVOR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
execute_process(
COMMAND echo ${XRT_VERSION_STRING}
COMMAND awk -F. "{print $1}"
Expand Down Expand Up @@ -129,6 +133,8 @@ elseif("${XDNA_CPACK_LINUX_PKG_FLAVOR}" MATCHES "fedora")
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/package/postinst")
set(CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/package/prerm")
endif()
elseif("${XDNA_CPACK_LINUX_PKG_FLAVOR}" MATCHES "arch")
set(CPACK_GENERATOR "TGZ")
else("${XDNA_CPACK_LINUX_PKG_FLAVOR}" MATCHES "debian")
message(WARNING "Unknown Linux package flavor: ${XDNA_CPACK_LINUX_PKG_FLAVOR}")
endif("${XDNA_CPACK_LINUX_PKG_FLAVOR}" MATCHES "debian")
Expand Down
3 changes: 2 additions & 1 deletion src/driver/amdxdna/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ endif
XDNA_DRIVER_VERSION ?= 2.21.0
XDNA_DATE ?= $(shell date +%Y%m%d)
XDNA_HASH ?= $(shell git rev-parse HEAD)
USE_LLVM ?= $(shell zgrep "CONFIG_CC_IS_CLANG" /proc/config.gz 1>/dev/null && echo -n "LLVM=1")

ifndef MODULE_VER_STR
MODULE_VER_STR := $(XDNA_DRIVER_VERSION)_$(XDNA_DATE),$(XDNA_HASH)
Expand All @@ -49,7 +50,7 @@ endif
DEFINES += -DMODULE_VER_STR='\"$(MODULE_VER_STR)\"'

modules:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC_DIR) CFLAGS_MODULE="$(DEFINES)" OFT_CONFIG_AMDXDNA_PCI=$(PCI) OFT_CONFIG_AMDXDNA_OF=$(OF) modules
$(MAKE) -C $(KERNEL_SRC) M=$(SRC_DIR) CFLAGS_MODULE="$(DEFINES)" OFT_CONFIG_AMDXDNA_PCI=$(PCI) OFT_CONFIG_AMDXDNA_OF=$(OF) $(USE_LLVM) modules

modules_install:
$(MAKE) -C $(KERNEL_SRC) M=$(SRC_DIR) modules_install
Expand Down
3 changes: 1 addition & 2 deletions src/driver/amdxdna/aie2_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,7 @@ static int aie2_get_array_async_error(struct amdxdna_dev *xdna, struct amdxdna_d
static int aie2_get_array_hwctx(struct amdxdna_client *client, struct amdxdna_drm_get_array *args)
{
struct amdxdna_dev *xdna = client->xdna;
struct amdxdna_drm_hwctx_entry input = {};
struct amdxdna_drm_hwctx_entry *tmp;
int ctx_limit, ctx_cnt, ret;
u32 buf_size;
Expand Down Expand Up @@ -1363,8 +1364,6 @@ static int aie2_get_array_hwctx(struct amdxdna_client *client, struct amdxdna_dr

break;
case DRM_AMDXDNA_HW_CONTEXT_BY_ID:
struct amdxdna_drm_hwctx_entry input = {};

ret = amdxdna_drm_copy_array_from_user(args, &input, sizeof(input), 1);
if (ret)
goto exit;
Expand Down