aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-09 17:44:37 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-07-22 11:29:38 -0400
commit3fdefa399e4644399ce3e74e65a75122d52dba6a (patch)
tree02458cf1ad47ca7262a25a64df9e84a2bc60d42d /drivers/gpu/drm/drm_crtc.c
parent9c7060f7e3b09837621f93bd8666cf4cfac45001 (diff)
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>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc.c')
-rw-r--r--drivers/gpu/drm/drm_crtc.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 805ef2f408a7..e385014ed616 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -1679,70 +1679,6 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev)
1679} 1679}
1680EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties); 1680EXPORT_SYMBOL(drm_mode_create_suggested_offset_properties);
1681 1681
1682static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *group)
1683{
1684 uint32_t total_objects = 0;
1685
1686 total_objects += dev->mode_config.num_crtc;
1687 total_objects += dev->mode_config.num_connector;
1688 total_objects += dev->mode_config.num_encoder;
1689
1690 group->id_list = kcalloc(total_objects, sizeof(uint32_t), GFP_KERNEL);
1691 if (!group->id_list)
1692 return -ENOMEM;
1693
1694 group->num_crtcs = 0;
1695 group->num_connectors = 0;
1696 group->num_encoders = 0;
1697 return 0;
1698}
1699
1700void drm_mode_group_destroy(struct drm_mode_group *group)
1701{
1702 kfree(group->id_list);
1703 group->id_list = NULL;
1704}
1705
1706/*
1707 * NOTE: Driver's shouldn't ever call drm_mode_group_init_legacy_group - it is
1708 * the drm core's responsibility to set up mode control groups.
1709 */
1710int drm_mode_group_init_legacy_group(struct drm_device *dev,
1711 struct drm_mode_group *group)
1712{
1713 struct drm_crtc *crtc;
1714 struct drm_encoder *encoder;
1715 struct drm_connector *connector;
1716 int ret;
1717
1718 ret = drm_mode_group_init(dev, group);
1719 if (ret)
1720 return ret;
1721
1722 drm_for_each_crtc(crtc, dev)
1723 group->id_list[group->num_crtcs++] = crtc->base.id;
1724
1725 drm_for_each_encoder(encoder, dev)
1726 group->id_list[group->num_crtcs + group->num_encoders++] =
1727 encoder->base.id;
1728
1729 drm_for_each_connector(connector, dev)
1730 group->id_list[group->num_crtcs + group->num_encoders +
1731 group->num_connectors++] = connector->base.id;
1732
1733 return 0;
1734}
1735EXPORT_SYMBOL(drm_mode_group_init_legacy_group);
1736
1737void drm_reinit_primary_mode_group(struct drm_device *dev)
1738{
1739 drm_modeset_lock_all(dev);
1740 drm_mode_group_destroy(&dev->primary->mode_group);
1741 drm_mode_group_init_legacy_group(dev, &dev->primary->mode_group);
1742 drm_modeset_unlock_all(dev);
1743}
1744EXPORT_SYMBOL(drm_reinit_primary_mode_group);
1745
1746/** 1682/**
1747 * drm_mode_getresources - get graphics configuration 1683 * drm_mode_getresources - get graphics configuration
1748 * @dev: drm device for the ioctl 1684 * @dev: drm device for the ioctl