Skip to contentSkip to conversation

drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers.

PATCH In review Dave Airlie 2 participants 2 messages Sep 18, 2018

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm: fix drm_drv_uses_atomic_modeset on non modesetting drivers.

From: Dave Airlie <[email protected]>

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.

---
 include/drm/drm_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/drm_drv.h +1 -1
index 8830e3de3a86..3199ef70c007 100644
@@ -674,7 +674,7 @@ static inline bool drm_core_check_feature(struct drm_device *dev, u32 feature)
 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);
 }
 
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 8 lines · Dave Airlie

From: Dave Airlie <[email protected]>

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.

I thought Dave would apply, but I guess too late for him, and since CI is burning I went ahead and pushed to drm-misc-fixes.

I kinda wonder why we didn't blow up on vgem earlier. I guess not a whole lot of fuzzing going on ...
-Daniel

Quoted 24 lines
---
 include/drm/drm_drv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/drm/drm_drv.h +1 -1
index 8830e3de3a86..3199ef70c007 100644
@@ -674,7 +674,7 @@ static inline bool drm_core_check_feature(struct drm_device *dev, u32 feature)
 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);
 }
 
 
Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel