[RFC 01/12] drm: Rename DRM_MINOR_LEGACY to DRM_MINOR_PRIMARY (original) (raw)
Thierry Reding thierry.reding at gmail.com
Thu Feb 20 23:55:17 PST 2014
- Previous message: [RFC 00/12] Support render-node only drivers
- Next message: [RFC 02/12] drm: Introduce DRIVER_LEGACY feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: Thierry Reding <treding at nvidia.com>
The term "legacy" is overloaded in the context of DRM. DRM_MINOR_LEGACY doesn't accurately describe the use of the minor. The associated minor is the primary minor for a device, as reflected by the .primary field of struct drm_device. For consistency, rename the enumeration value to DRM_MINOR_PRIMARY.
Signed-off-by: Thierry Reding <treding at nvidia.com>
drivers/gpu/drm/drm_stub.c | 16 ++++++++-------- drivers/gpu/drm/drm_sysfs.c | 4 ++-- include/drm/drmP.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 2567ecb5c574..fd2f1758366d 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c @@ -319,7 +319,7 @@ static struct drm_minor **drm_minor_get_slot(struct drm_device *dev, unsigned int type) { switch (type) { - case DRM_MINOR_LEGACY: + case DRM_MINOR_PRIMARY: return &dev->primary; case DRM_MINOR_RENDER: return &dev->render; @@ -493,7 +493,7 @@ EXPORT_SYMBOL(drm_put_dev); void drm_unplug_dev(struct drm_device dev) { / for a USB device */ - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); @@ -564,7 +564,7 @@ struct drm_device *drm_dev_alloc(struct drm_driver *driver, goto err_minors; } - ret = drm_minor_alloc(dev, DRM_MINOR_LEGACY); + ret = drm_minor_alloc(dev, DRM_MINOR_PRIMARY); if (ret) goto err_minors; @@ -592,7 +592,7 @@ err_ctxbitmap: err_ht: drm_ht_remove(&dev->map_hash); err_minors: - drm_minor_free(dev, DRM_MINOR_LEGACY); + drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_CONTROL); drm_minor_free_base(dev); @@ -618,7 +618,7 @@ static void drm_dev_free(struct drm_device *dev) drm_ctxbitmap_cleanup(dev); drm_ht_remove(&dev->map_hash); - drm_minor_free(dev, DRM_MINOR_LEGACY); + drm_minor_free(dev, DRM_MINOR_PRIMARY); drm_minor_free(dev, DRM_MINOR_RENDER); drm_minor_free(dev, DRM_MINOR_CONTROL); drm_minor_free_base(dev); @@ -692,7 +692,7 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) if (ret) goto err_minors; - ret = drm_minor_register(dev, DRM_MINOR_LEGACY); + ret = drm_minor_register(dev, DRM_MINOR_PRIMARY); if (ret) goto err_minors; @@ -718,7 +718,7 @@ err_unload: if (dev->driver->unload) dev->driver->unload(dev); err_minors: - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); out_unlock: @@ -752,7 +752,7 @@ void drm_dev_unregister(struct drm_device *dev) list_for_each_entry_safe(r_list, list_temp, &dev->maplist, head) drm_rmmap(dev, r_list->map); - drm_minor_unregister(dev, DRM_MINOR_LEGACY); + drm_minor_unregister(dev, DRM_MINOR_PRIMARY); drm_minor_unregister(dev, DRM_MINOR_RENDER); drm_minor_unregister(dev, DRM_MINOR_CONTROL); } diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 9be02d9a78e8..c3f3d0b6a8fe 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c @@ -43,7 +43,7 @@ static int __drm_class_suspend(struct device *dev, pm_message_t state) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && + if (drm_minor->type == DRM_MINOR_PRIMARY && !drm_core_check_feature(drm_dev, DRIVER_MODESET) && drm_dev->driver->suspend) return drm_dev->driver->suspend(drm_dev, state); @@ -84,7 +84,7 @@ static int drm_class_resume(struct device *dev) struct drm_minor *drm_minor = to_drm_minor(dev); struct drm_device *drm_dev = drm_minor->dev; - if (drm_minor->type == DRM_MINOR_LEGACY && + if (drm_minor->type == DRM_MINOR_PRIMARY && !drm_core_check_feature(drm_dev, DRIVER_MODESET) && drm_dev->driver->resume) return drm_dev->driver->resume(drm_dev); diff --git a/include/drm/drmP.h b/include/drm/drmP.h index e5f6732f4757..92604c435ecc 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1010,7 +1010,7 @@ struct drm_driver { }; enum drm_minor_type { - DRM_MINOR_LEGACY, + DRM_MINOR_PRIMARY, DRM_MINOR_CONTROL, DRM_MINOR_RENDER, DRM_MINOR_CNT,
1.8.4.2
- Previous message: [RFC 00/12] Support render-node only drivers
- Next message: [RFC 02/12] drm: Introduce DRIVER_LEGACY feature
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]