drm: gc now dead mode_group code
Two nice things here: - drm_dev_register will truly register everything in the right order if the driver doesn't have a ->load callback. Before this we had to init the primary mode_group after the device nodes where already registered. - Less things to keep track of when reworking the connector locking, yay! Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
This commit is contained in:
@@ -1679,70 +1679,6 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
|
||||
}
|
||||
EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
|
||||
|
||||
static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
|
||||
{
|
||||
uint32_t total_objects = 0;
|
||||
|
||||
total_objects += dev->mode_config.num_crtc;
|
||||
total_objects += dev->mode_config.num_connector;
|
||||
total_objects += dev->mode_config.num_encoder;
|
||||
|
||||
group->id_list = kcalloc(total_objects, sizeof(uint32_t), GFP_KERNEL);
|
||||
if (!group->id_list)
|
||||
return -ENOMEM;
|
||||
|
||||
group->num_crtcs = 0;
|
||||
group->num_connectors = 0;
|
||||
group->num_encoders = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void drm_mode_group_destroy(struct drm_mode_group *group)
|
||||
{
|
||||
kfree(group->id_list);
|
||||
group->id_list = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE: Driver's shouldn't ever call drm_mode_group_init_legacy_group - it is
|
||||
* the drm core's responsibility to set up mode control groups.
|
||||
*/
|
||||
int drm_mode_group_init_legacy_group(struct drm_device *dev,
|
||||
struct drm_mode_group *group)
|
||||
{
|
||||
struct drm_crtc *crtc;
|
||||
struct drm_encoder *encoder;
|
||||
struct drm_connector *connector;
|
||||
int ret;
|
||||
|
||||
ret = drm_mode_group_init(dev, group);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
drm_for_each_crtc(crtc, dev)
|
||||
group->id_list[group->num_crtcs++] = crtc->base.id;
|
||||
|
||||
drm_for_each_encoder(encoder, dev)
|
||||
group->id_list[group->num_crtcs + group->num_encoders++] =
|
||||
encoder->base.id;
|
||||
|
||||
drm_for_each_connector(connector, dev)
|
||||
group->id_list[group->num_crtcs + group->num_encoders +
|
||||
group->num_connectors++] = connector->base.id;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
|
||||
|
||||
void drm_reinit_primary_mode_group(struct drm_device *dev)
|
||||
{
|
||||
drm_modeset_lock_all(dev);
|
||||
drm_mode_group_destroy(&dev->primary->mode_group);
|
||||
drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
|
||||
drm_modeset_unlock_all(dev);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_reinit_primary_mode_group);
|
||||
|
||||
/**
|
||||
* drm_mode_getresources - get graphics configuration
|
||||
* @dev: drm device for the ioctl
|
||||
|
Reference in New Issue
Block a user