All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: Add frame CRC debugfs files only for drivers that have CRTC
@ 2016-09-29  3:42 Dhinakaran Pandiyan
  2016-09-29  3:50 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Dhinakaran Pandiyan @ 2016-09-29  3:42 UTC (permalink / raw)
  To: dri-devel
  Cc: Daniel Vetter, intel-gfx, Dhinakaran Pandiyan, Tomeu Vizoso,
	Emil Velikov

vgem does not do modeset, looping through non-existent CRTC's while
registering drm_minor in

	'commit 48c787899882 ("drm: Add API for capturing frame CRCs")'

caused kernel oops. So, let's add CRC debugfs files
only for those drivers that do modeset.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.velikov@collabora.com>
---
 drivers/gpu/drm/drm_drv.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index 70d2543..294404f 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -208,6 +208,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 	struct drm_crtc *crtc;
 	unsigned long flags;
 	int ret;
+	bool is_modeset;
 
 	DRM_DEBUG("\n");
 
@@ -221,7 +222,8 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type)
 		return ret;
 	}
 
-	if (type == DRM_MINOR_PRIMARY) {
+	is_modeset = drm_core_check_feature(dev, DRIVER_MODESET);
+	if (type == DRM_MINOR_PRIMARY && is_modeset) {
 		drm_for_each_crtc(crtc, dev) {
 			ret = drm_debugfs_crtc_add(crtc);
 			if (ret)
@@ -255,12 +257,14 @@ static void drm_minor_unregister(struct drm_device *dev, unsigned int type)
 	struct drm_minor *minor;
 	struct drm_crtc *crtc;
 	unsigned long flags;
+	bool is_modeset;
 
 	minor = *drm_minor_get_slot(dev, type);
 	if (!minor || !device_is_registered(minor->kdev))
 		return;
 
-	if (type == DRM_MINOR_PRIMARY) {
+	is_modeset = drm_core_check_feature(dev, DRIVER_MODESET);
+	if (type == DRM_MINOR_PRIMARY && is_modeset) {
 		drm_for_each_crtc(crtc, dev)
 			drm_debugfs_crtc_remove(crtc);
 	}
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-29 10:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-29  3:42 [PATCH] drm: Add frame CRC debugfs files only for drivers that have CRTC Dhinakaran Pandiyan
2016-09-29  3:50 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-09-29  7:54 ` [PATCH] " Jani Nikula
2016-09-29  8:25 ` Tomeu Vizoso
2016-09-29  8:59   ` Daniel Vetter
2016-09-29 10:27     ` [Intel-gfx] " Emil Velikov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.