File 0005-Fix-compilation-on-kernel-5.4.0-2935.patch of Package libxrt
From 518153b3d4c504eea223d40cf5c5da3343d3b953 Mon Sep 17 00:00:00 2001
From: Himanshu-xilinx <48508106+Himanshu-xilinx@users.noreply.github.com>
Date: Sun, 1 Mar 2020 00:02:46 +0530
Subject: [PATCH 5/5] Fix compilation on kernel 5.4.0+ (#2935)
---
src/runtime_src/core/edge/drm/zocl/sched_exec.c | 4 ++++
src/runtime_src/core/edge/drm/zocl/zocl_drv.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/runtime_src/core/edge/drm/zocl/sched_exec.c b/src/runtime_src/core/edge/drm/zocl/sched_exec.c
index 0d61f7a8..9b839492 100644
--- a/src/runtime_src/core/edge/drm/zocl/sched_exec.c
+++ b/src/runtime_src/core/edge/drm/zocl/sched_exec.c
@@ -2575,7 +2575,11 @@ ps_ert_query(struct sched_cmd *cmd)
case ERT_EXEC_WRITE:
if (!cu_done(cmd))
break;
+#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE
__attribute__ ((fallthrough));
+#else
+ __attribute__ ((__fallthrough__));
+#endif
/* pass through */
case ERT_CU_STAT:
diff --git a/src/runtime_src/core/edge/drm/zocl/zocl_drv.c b/src/runtime_src/core/edge/drm/zocl/zocl_drv.c
index 9d1ad5df..2e8f139e 100644
--- a/src/runtime_src/core/edge/drm/zocl/zocl_drv.c
+++ b/src/runtime_src/core/edge/drm/zocl/zocl_drv.c
@@ -670,7 +670,11 @@ static const struct file_operations zocl_driver_fops = {
};
static struct drm_driver zocl_driver = {
+#if KERNEL_VERSION(5, 4, 0) > LINUX_VERSION_CODE
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_RENDER,
+#else
+ .driver_features = DRIVER_GEM | DRIVER_RENDER,
+#endif
.open = zocl_client_open,
.postclose = zocl_client_release,
.gem_free_object = zocl_free_bo,
--
2.16.4