Skip to content

Commit a995959

Browse files
Merge pull request #561 from richgieg/fix-centos-9-10-build
Fix module build on CentOS 9 and 10
2 parents eb36e4f + 6ef1a57 commit a995959

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

module/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ ifneq (,$(findstring rhel,$(ID_LIKE)))
1212
ELFLAG := -DEL$(shell echo $(VERSION_ID) | cut -d. -f1)
1313
endif
1414

15+
ifneq (,$(findstring centos,$(ID)))
16+
CENTOSFLAG := -DCENTOS$(shell echo $(VERSION_ID) | cut -d. -f1)
17+
endif
18+
1519
Raspbian := $(shell grep -Eic 'raspb(erry|ian)' /proc/cpuinfo /etc/os-release 2>/dev/null )
1620
ifeq (,$(findstring 0, $(Raspbian)))
1721
RPIFLAG := -DRPI
@@ -23,7 +27,7 @@ ifneq ($(DKMS_BUILD),)
2327

2428
KERN_DIR := /lib/modules/$(KERNELRELEASE)/build
2529

26-
ccflags-y := -Iinclude/uapi/drm -Iinclude/drm $(ELFLAG) $(RPIFLAG)
30+
ccflags-y := -Iinclude/uapi/drm -Iinclude/drm $(ELFLAG) $(CENTOSFLAG) $(RPIFLAG)
2731
evdi-y := evdi_platform_drv.o evdi_platform_dev.o evdi_sysfs.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_drm_drv.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi_i2c.o
2832
evdi-$(CONFIG_COMPAT) += evdi_ioc32.o
2933
obj-m := evdi.o
@@ -45,7 +49,7 @@ ifneq ($(KERNELRELEASE),)
4549

4650
# inside kbuild
4751
# Note: this can be removed once it is in kernel tree and Kconfig is properly used
48-
ccflags-y := -isystem include/uapi/drm $(CFLAGS) $(ELFLAG) $(RPIFLAG)
52+
ccflags-y := -isystem include/uapi/drm $(CFLAGS) $(ELFLAG) $(CENTOSFLAG) $(RPIFLAG)
4953
evdi-y := evdi_platform_drv.o evdi_platform_dev.o evdi_sysfs.o evdi_modeset.o evdi_connector.o evdi_encoder.o evdi_drm_drv.o evdi_fb.o evdi_gem.o evdi_painter.o evdi_params.o evdi_cursor.o evdi_debug.o evdi_i2c.o
5054
evdi-$(CONFIG_COMPAT) += evdi_ioc32.o
5155
CONFIG_DRM_EVDI ?= m

module/evdi_drm_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ long evdi_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
102102
struct drm_framebuffer *evdi_fb_user_fb_create(
103103
struct drm_device *dev,
104104
struct drm_file *file,
105-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
105+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
106106
const struct drm_format_info *info,
107107
#endif
108108
const struct drm_mode_fb_cmd2 *mode_cmd);

module/evdi_fb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,20 @@ static const struct drm_framebuffer_funcs evdifb_funcs = {
203203
static int
204204
evdi_framebuffer_init(struct drm_device *dev,
205205
struct evdi_framebuffer *efb,
206-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
206+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
207207
const struct drm_format_info *info,
208208
#endif
209209
const struct drm_mode_fb_cmd2 *mode_cmd,
210210
struct evdi_gem_object *obj)
211211
{
212212
efb->obj = obj;
213-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
213+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
214214
if (info == NULL)
215215
info = drm_get_format_info(dev, mode_cmd->pixel_format,
216216
mode_cmd->modifier[0]);
217217
#endif
218218
drm_helper_mode_fill_fb_struct(dev, &efb->base,
219-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
219+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
220220
info,
221221
#endif
222222
mode_cmd);
@@ -253,7 +253,7 @@ static bool is_xe_gem(struct dma_buf *dmabuf)
253253
struct drm_framebuffer *evdi_fb_user_fb_create(
254254
struct drm_device *dev,
255255
struct drm_file *file,
256-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
256+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
257257
const struct drm_format_info *info,
258258
#endif
259259
const struct drm_mode_fb_cmd2 *mode_cmd)
@@ -289,7 +289,7 @@ struct drm_framebuffer *evdi_fb_user_fb_create(
289289
efb->base.obj[0] = obj;
290290

291291
ret = evdi_framebuffer_init(dev, efb,
292-
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE
292+
#if KERNEL_VERSION(6, 17, 0) <= LINUX_VERSION_CODE || defined(CENTOS9) || defined(CENTOS10)
293293
info,
294294
#endif
295295
mode_cmd, to_evdi_bo(obj));

0 commit comments

Comments
 (0)