[RFC 05/12] drm: Create primary minor only if mode-setting is supported

Thierry Reding thierry.reding at gmail.com
Thu Feb 20 23:55:21 PST 2014


From: Thierry Reding <treding at nvidia.com>

Non-legacy devices may not always support mode-setting functionality, so
create the primary minor conditionally.

One setup where this happens is the Tegra K1, where the Tegra DRM driver
exposes the display engine via standard KMS IOCTLs, and nouveau drives
the Kepler-type GPU that has no display capabilities.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/gpu/drm/drm_stub.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c
index fd2f1758366d..839460b774c5 100644
--- a/drivers/gpu/drm/drm_stub.c
+++ b/drivers/gpu/drm/drm_stub.c
@@ -564,9 +564,11 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver,
 			goto err_minors;
 	}
 
-	ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY);
-	if (ret)
-		goto err_minors;
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
+		ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY);
+		if (ret)
+			goto err_minors;
+	}
 
 	if (drm_ht_create(&dev->map_hash, 12))
 		goto err_minors;
-- 
1.8.4.2



More information about the dri-devel mailing list