diff --git a/Makefile b/Makefile index 0bdba8d0..967fa8ca 100644 --- a/Makefile +++ b/Makefile @@ -4,11 +4,6 @@ FLAGS=-Werror -Wextra -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-error=missing-field-initializers -EL8 := $(shell cat /etc/redhat-release | grep -c " 8." ) -ifneq (,$(findstring 1, $(EL8))) -FLAGS:=$(FLAGS) -D EL8 -endif - all: CFLAGS="$(FLAGS)" $(MAKE) -C module $(MFLAGS) CFLAGS="-I../module $(FLAGS) $(CFLAGS)" $(MAKE) -C library $(MFLAGS) diff --git a/module/Makefile b/module/Makefile index e8d340c1..e36770e3 100644 --- a/module/Makefile +++ b/module/Makefile @@ -5,13 +5,19 @@ # License v2. See the file COPYING in the main directory of this archive for # more details. # + +EL8 := $(shell cat /etc/redhat-release | grep -c " 8." ) +ifneq (,$(findstring 1, $(EL8))) +EL8FLAG := -DEL8 +endif + ifneq ($(DKMS_BUILD),) # DKMS KERN_DIR := /lib/modules/$(KERNELRELEASE)/build -ccflags-y := -Iinclude/drm +ccflags-y := -Iinclude/drm $(EL8FLAG) evdi-y := evdi_drv.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_main.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi-$(CONFIG_COMPAT) += evdi_ioc32.o obj-m := evdi.o @@ -35,7 +41,7 @@ ifneq ($(KERNELRELEASE),) # Note: this can be removed once it is in kernel tree and Kconfig is properly used CONFIG_DRM_EVDI := m LINUXINCLUDE := $(subst -I,-isystem,$(LINUXINCLUDE)) -ccflags-y := -isystem include/drm $(CFLAGS) +ccflags-y := -isystem include/drm $(CFLAGS) $(EL8FLAG) evdi-y := evdi_drv.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_main.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi-$(CONFIG_COMPAT) += evdi_ioc32.o obj-$(CONFIG_DRM_EVDI) := evdi.o diff --git a/module/evdi_connector.c b/module/evdi_connector.c index 18ffd0a9..89a29ee2 100644 --- a/module/evdi_connector.c +++ b/module/evdi_connector.c @@ -105,7 +105,7 @@ static void evdi_connector_destroy(struct drm_connector *connector) static struct drm_encoder *evdi_best_encoder(struct drm_connector *connector) { -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) struct drm_encoder *encoder; drm_connector_for_each_possible_encoder(connector, encoder) { diff --git a/module/evdi_cursor.c b/module/evdi_cursor.c index cb4282a9..b64ecf1d 100644 --- a/module/evdi_cursor.c +++ b/module/evdi_cursor.c @@ -23,7 +23,7 @@ #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_cursor.h b/module/evdi_cursor.h index 23f0cf75..13d8a8ab 100644 --- a/module/evdi_cursor.h +++ b/module/evdi_cursor.h @@ -23,7 +23,7 @@ #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_drv.c b/module/evdi_drv.c index 4e5c9e37..790c5dbb 100644 --- a/module/evdi_drv.c +++ b/module/evdi_drv.c @@ -9,7 +9,7 @@ */ #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif @@ -80,7 +80,7 @@ static void evdi_disable_vblank(__always_unused struct drm_device *dev, } static struct drm_driver driver = { -#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE || defined(EL8) .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, #else .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME diff --git a/module/evdi_drv.h b/module/evdi_drv.h index 5865fdcf..bb6cb4df 100644 --- a/module/evdi_drv.h +++ b/module/evdi_drv.h @@ -17,7 +17,7 @@ #include #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #include #include #include @@ -30,7 +30,7 @@ #include #include #include -#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE || defined(EL8) #include #else #include @@ -68,7 +68,7 @@ struct evdi_gem_object { struct page **pages; void *vmapping; struct sg_table *sg; -#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE || defined(EL8) struct dma_resv *resv; struct dma_resv _resv; #else diff --git a/module/evdi_encoder.c b/module/evdi_encoder.c index cdfbb9e4..834597f5 100644 --- a/module/evdi_encoder.c +++ b/module/evdi_encoder.c @@ -12,7 +12,7 @@ */ #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_fb.c b/module/evdi_fb.c index 3639bf87..beeb5298 100644 --- a/module/evdi_fb.c +++ b/module/evdi_fb.c @@ -17,7 +17,7 @@ #endif /* CONFIG_FB */ #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_gem.c b/module/evdi_gem.c index c0844edd..da7cb794 100644 --- a/module/evdi_gem.c +++ b/module/evdi_gem.c @@ -9,7 +9,7 @@ */ #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif @@ -51,7 +51,7 @@ struct evdi_gem_object *evdi_gem_alloc_object(struct drm_device *dev, return NULL; } -#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE || defined(EL8) dma_resv_init(&obj->_resv); #else reservation_object_init(&obj->_resv); @@ -233,7 +233,7 @@ void evdi_gem_free_object(struct drm_gem_object *gem_obj) if (gem_obj->dev->vma_offset_manager) drm_gem_free_mmap_offset(gem_obj); -#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 4, 0) <= LINUX_VERSION_CODE || defined(EL8) dma_resv_fini(&obj->_resv); #else reservation_object_fini(&obj->_resv); diff --git a/module/evdi_ioc32.c b/module/evdi_ioc32.c index 31142b88..612b13b4 100644 --- a/module/evdi_ioc32.c +++ b/module/evdi_ioc32.c @@ -22,7 +22,7 @@ #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_main.c b/module/evdi_main.c index 48ee8c11..8dda47c7 100644 --- a/module/evdi_main.c +++ b/module/evdi_main.c @@ -13,7 +13,7 @@ #include #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_modeset.c b/module/evdi_modeset.c index c0f904c7..60af7f4c 100644 --- a/module/evdi_modeset.c +++ b/module/evdi_modeset.c @@ -12,7 +12,7 @@ */ #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif diff --git a/module/evdi_painter.c b/module/evdi_painter.c index 21070f6f..ff757c10 100644 --- a/module/evdi_painter.c +++ b/module/evdi_painter.c @@ -10,7 +10,7 @@ #include "linux/thread_info.h" #include "linux/mm.h" #include -#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE +#if KERNEL_VERSION(5, 5, 0) <= LINUX_VERSION_CODE || defined(EL8) #else #include #endif