Skip to contentSkip to conversation

drm/kms: allow drm_mode_group with no objects

PATCH New [email protected] 1 participant 1 message Jul 4, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/kms: allow drm_mode_group with no objects

From: Ben Skeggs <[email protected]>

Sometimes we could be controlling a device (such as an NVIDIA Tesla) that has no crtcs/encoders/connectors.

One could argue that the driver should unset DRIVER_MODESET in this case, but that changes a whole heap of the DRM's other behaviours, and it's much easier to just be a modesetting driver without any outputs.

---
 drivers/gpu/drm/drm_crtc.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_crtc.c +0 -3
index 21058e6..82db185 100644
@@ -886,9 +886,6 @@ int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
 	total_objects += dev->mode_config.num_connector;
 	total_objects += dev->mode_config.num_encoder;
 
-	if (total_objects == 0)
-		return -EINVAL;
-
 	group->id_list = kzalloc(total_objects * sizeof(uint32_t), GFP_KERNEL);
 	if (!group->id_list)
 		return -ENOMEM;
Signature · 1 line
1.7.5.4