drm: Drop unused and broken dri_library_name sysfs attribute.
authorKristian Høgsberg <krh@redhat.com>
Mon, 5 Jan 2009 21:10:05 +0000 (16:10 -0500)
committerDave Airlie <airlied@redhat.com>
Fri, 13 Mar 2009 04:23:58 +0000 (14:23 +1000)
The kernel shouldn't be in the business of telling user space which
driver to load.  The kernel defers mapping PCI IDs to module names
to user space and we should do the same for DRI drivers.

And in fact, that's how it does work today.  Nothing uses the
dri_library_name attribute, and the attribute is in fact broken.
For intel devices, it falls back to the default behaviour of returning
the kernel module name as the DRI driver name, which doesn't work for
i965 devices.  Nobody has ever hit this problem or filed a bug about this.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/gpu/drm/drm_sysfs.c
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/via/via_drv.c
include/drm/drmP.h

index 480546b542fedfc8dca9fb9ba654fc3033cc7f8e..f7510a8f0eb9bfdfaffc91f9b3b590ee73869d6d 100644 (file)
@@ -122,20 +122,6 @@ void drm_sysfs_destroy(void)
        class_destroy(drm_class);
 }
 
-static ssize_t show_dri(struct device *device, struct device_attribute *attr,
-                       char *buf)
-{
-       struct drm_minor *drm_minor = to_drm_minor(device);
-       struct drm_device *drm_dev = drm_minor->dev;
-       if (drm_dev->driver->dri_library_name)
-               return drm_dev->driver->dri_library_name(drm_dev, buf);
-       return snprintf(buf, PAGE_SIZE, "%s\n", drm_dev->driver->pci_driver.name);
-}
-
-static struct device_attribute device_attrs[] = {
-       __ATTR(dri_library_name, S_IRUGO, show_dri, NULL),
-};
-
 /**
  * drm_sysfs_device_release - do nothing
  * @dev: Linux device
@@ -478,7 +464,6 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
 int drm_sysfs_device_add(struct drm_minor *minor)
 {
        int err;
-       int i, j;
        char *minor_str;
 
        minor->kdev.parent = &minor->dev->pdev->dev;
@@ -500,18 +485,8 @@ int drm_sysfs_device_add(struct drm_minor *minor)
                goto err_out;
        }
 
-       for (i = 0; i < ARRAY_SIZE(device_attrs); i++) {
-               err = device_create_file(&minor->kdev, &device_attrs[i]);
-               if (err)
-                       goto err_out_files;
-       }
-
        return 0;
 
-err_out_files:
-       if (i > 0)
-               for (j = 0; j < i; j++)
-                       device_remove_file(&minor->kdev, &device_attrs[j]);
        device_unregister(&minor->kdev);
 err_out:
 
@@ -527,9 +502,5 @@ err_out:
  */
 void drm_sysfs_device_remove(struct drm_minor *minor)
 {
-       int i;
-
-       for (i = 0; i < ARRAY_SIZE(device_attrs); i++)
-               device_remove_file(&minor->kdev, &device_attrs[i]);
        device_unregister(&minor->kdev);
 }
index fef207881f45eeb34d5149c571b80fefbb2e47b2..1e3b2557a51a42117610ac03a603fa5072cb0860 100644 (file)
@@ -41,17 +41,6 @@ int radeon_no_wb;
 MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
 module_param_named(no_wb, radeon_no_wb, int, 0444);
 
-static int dri_library_name(struct drm_device *dev, char *buf)
-{
-       drm_radeon_private_t *dev_priv = dev->dev_private;
-       int family = dev_priv->flags & RADEON_FAMILY_MASK;
-
-       return snprintf(buf, PAGE_SIZE, "%s\n",
-                       (family < CHIP_R200) ? "radeon" :
-                       ((family < CHIP_R300) ? "r200" :
-                       "r300"));
-}
-
 static int radeon_suspend(struct drm_device *dev, pm_message_t state)
 {
        drm_radeon_private_t *dev_priv = dev->dev_private;
@@ -95,7 +84,6 @@ static struct drm_driver driver = {
        .get_vblank_counter = radeon_get_vblank_counter,
        .enable_vblank = radeon_enable_vblank,
        .disable_vblank = radeon_disable_vblank,
-       .dri_library_name = dri_library_name,
        .master_create = radeon_master_create,
        .master_destroy = radeon_master_destroy,
        .irq_preinstall = radeon_driver_irq_preinstall,
index 0993b441fc426c1f6e39b0c0ef5ec28c30660fde..bc2f518430050adb0495933e7221d6cb59c941ee 100644 (file)
 
 #include "drm_pciids.h"
 
-static int dri_library_name(struct drm_device *dev, char *buf)
-{
-       return snprintf(buf, PAGE_SIZE, "unichrome");
-}
-
 static struct pci_device_id pciidlist[] = {
        viadrv_PCI_IDS
 };
@@ -52,7 +47,6 @@ static struct drm_driver driver = {
        .irq_uninstall = via_driver_irq_uninstall,
        .irq_handler = via_driver_irq_handler,
        .dma_quiescent = via_driver_dma_quiescent,
-       .dri_library_name = dri_library_name,
        .reclaim_buffers = drm_core_reclaim_buffers,
        .reclaim_buffers_locked = NULL,
        .reclaim_buffers_idlelocked = via_reclaim_buffers_locked,
index 533d35baa085daed7ee1114e7cdae75224d2e13f..458e38e1d538dea9e8914d9518ec2e63d2d6feff 100644 (file)
@@ -688,7 +688,6 @@ struct drm_driver {
        int (*kernel_context_switch) (struct drm_device *dev, int old,
                                      int new);
        void (*kernel_context_switch_unlock) (struct drm_device *dev);
-       int (*dri_library_name) (struct drm_device *dev, char *buf);
 
        /**
         * get_vblank_counter - get raw hardware vblank counter