From: Dave Airlie <airlied@redhat.com>
Date: Tue, 18 Sep 2018 16:20:18 +1000
Subject: drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers.
Git-commit: 57078338b2e4c07fb76bef23369cae0acfb1f7bc
Patch-mainline: v4.19-rc5
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166
vgem seems to oops on the intel CI due to the vgem debugfs init
hitting this path now.
Check if we have mode_config funcs before checking one.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180918062018.24942-1-airlied@gmail.com
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
include/drm/drm_drv.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -675,7 +675,7 @@ static inline bool drm_core_check_featur
static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev)
{
return drm_core_check_feature(dev, DRIVER_ATOMIC) ||
- dev->mode_config.funcs->atomic_commit != NULL;
+ (dev->mode_config.funcs && dev->mode_config.funcs->atomic_commit != NULL);
}