aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2009-01-05 16:10:05 -0500
committerDave Airlie <airlied@redhat.com>2009-03-13 00:23:58 -0400
commit8e1004580e0c862cb6bbe2ff8e496f846c54052f (patch)
treef75ca2cebf77d2746613af8e5b61998057df5387
parent112b715e8e2f9ef7b96930888bb099ce10b4c3cc (diff)
drm: Drop unused and broken dri_library_name sysfs attribute.
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>
-rw-r--r--drivers/gpu/drm/drm_sysfs.c29
-rw-r--r--drivers/gpu/drm/radeon/radeon_drv.c12
-rw-r--r--drivers/gpu/drm/via/via_drv.c6
-rw-r--r--include/drm/drmP.h1
4 files changed, 0 insertions, 48 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 480546b542fe..f7510a8f0eb9 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -122,20 +122,6 @@ void drm_sysfs_destroy(void)
122 class_destroy(drm_class); 122 class_destroy(drm_class);
123} 123}
124 124
125static ssize_t show_dri(struct device *device, struct device_attribute *attr,
126 char *buf)
127{
128 struct drm_minor *drm_minor = to_drm_minor(device);
129 struct drm_device *drm_dev = drm_minor->dev;
130 if (drm_dev->driver->dri_library_name)
131 return drm_dev->driver->dri_library_name(drm_dev, buf);
132 return snprintf(buf, PAGE_SIZE, "%s\n", drm_dev->driver->pci_driver.name);
133}
134
135static struct device_attribute device_attrs[] = {
136 __ATTR(dri_library_name, S_IRUGO, show_dri, NULL),
137};
138
139/** 125/**
140 * drm_sysfs_device_release - do nothing 126 * drm_sysfs_device_release - do nothing
141 * @dev: Linux device 127 * @dev: Linux device
@@ -478,7 +464,6 @@ void drm_sysfs_hotplug_event(struct drm_device *dev)
478int drm_sysfs_device_add(struct drm_minor *minor) 464int drm_sysfs_device_add(struct drm_minor *minor)
479{ 465{
480 int err; 466 int err;
481 int i, j;
482 char *minor_str; 467 char *minor_str;
483 468
484 minor->kdev.parent = &minor->dev->pdev->dev; 469 minor->kdev.parent = &minor->dev->pdev->dev;
@@ -500,18 +485,8 @@ int drm_sysfs_device_add(struct drm_minor *minor)
500 goto err_out; 485 goto err_out;
501 } 486 }
502 487
503 for (i = 0; i < ARRAY_SIZE(device_attrs); i++) {
504 err = device_create_file(&minor->kdev, &device_attrs[i]);
505 if (err)
506 goto err_out_files;
507 }
508
509 return 0; 488 return 0;
510 489
511err_out_files:
512 if (i > 0)
513 for (j = 0; j < i; j++)
514 device_remove_file(&minor->kdev, &device_attrs[j]);
515 device_unregister(&minor->kdev); 490 device_unregister(&minor->kdev);
516err_out: 491err_out:
517 492
@@ -527,9 +502,5 @@ err_out:
527 */ 502 */
528void drm_sysfs_device_remove(struct drm_minor *minor) 503void drm_sysfs_device_remove(struct drm_minor *minor)
529{ 504{
530 int i;
531
532 for (i = 0; i < ARRAY_SIZE(device_attrs); i++)
533 device_remove_file(&minor->kdev, &device_attrs[i]);
534 device_unregister(&minor->kdev); 505 device_unregister(&minor->kdev);
535} 506}
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index fef207881f45..1e3b2557a51a 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -41,17 +41,6 @@ int radeon_no_wb;
41MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers"); 41MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers");
42module_param_named(no_wb, radeon_no_wb, int, 0444); 42module_param_named(no_wb, radeon_no_wb, int, 0444);
43 43
44static int dri_library_name(struct drm_device *dev, char *buf)
45{
46 drm_radeon_private_t *dev_priv = dev->dev_private;
47 int family = dev_priv->flags & RADEON_FAMILY_MASK;
48
49 return snprintf(buf, PAGE_SIZE, "%s\n",
50 (family < CHIP_R200) ? "radeon" :
51 ((family < CHIP_R300) ? "r200" :
52 "r300"));
53}
54
55static int radeon_suspend(struct drm_device *dev, pm_message_t state) 44static int radeon_suspend(struct drm_device *dev, pm_message_t state)
56{ 45{
57 drm_radeon_private_t *dev_priv = dev->dev_private; 46 drm_radeon_private_t *dev_priv = dev->dev_private;
@@ -95,7 +84,6 @@ static struct drm_driver driver = {
95 .get_vblank_counter = radeon_get_vblank_counter, 84 .get_vblank_counter = radeon_get_vblank_counter,
96 .enable_vblank = radeon_enable_vblank, 85 .enable_vblank = radeon_enable_vblank,
97 .disable_vblank = radeon_disable_vblank, 86 .disable_vblank = radeon_disable_vblank,
98 .dri_library_name = dri_library_name,
99 .master_create = radeon_master_create, 87 .master_create = radeon_master_create,
100 .master_destroy = radeon_master_destroy, 88 .master_destroy = radeon_master_destroy,
101 .irq_preinstall = radeon_driver_irq_preinstall, 89 .irq_preinstall = radeon_driver_irq_preinstall,
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 0993b441fc42..bc2f51843005 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -28,11 +28,6 @@
28 28
29#include "drm_pciids.h" 29#include "drm_pciids.h"
30 30
31static int dri_library_name(struct drm_device *dev, char *buf)
32{
33 return snprintf(buf, PAGE_SIZE, "unichrome");
34}
35
36static struct pci_device_id pciidlist[] = { 31static struct pci_device_id pciidlist[] = {
37 viadrv_PCI_IDS 32 viadrv_PCI_IDS
38}; 33};
@@ -52,7 +47,6 @@ static struct drm_driver driver = {
52 .irq_uninstall = via_driver_irq_uninstall, 47 .irq_uninstall = via_driver_irq_uninstall,
53 .irq_handler = via_driver_irq_handler, 48 .irq_handler = via_driver_irq_handler,
54 .dma_quiescent = via_driver_dma_quiescent, 49 .dma_quiescent = via_driver_dma_quiescent,
55 .dri_library_name = dri_library_name,
56 .reclaim_buffers = drm_core_reclaim_buffers, 50 .reclaim_buffers = drm_core_reclaim_buffers,
57 .reclaim_buffers_locked = NULL, 51 .reclaim_buffers_locked = NULL,
58 .reclaim_buffers_idlelocked = via_reclaim_buffers_locked, 52 .reclaim_buffers_idlelocked = via_reclaim_buffers_locked,
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 533d35baa085..458e38e1d538 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -688,7 +688,6 @@ struct drm_driver {
688 int (*kernel_context_switch) (struct drm_device *dev, int old, 688 int (*kernel_context_switch) (struct drm_device *dev, int old,
689 int new); 689 int new);
690 void (*kernel_context_switch_unlock) (struct drm_device *dev); 690 void (*kernel_context_switch_unlock) (struct drm_device *dev);
691 int (*dri_library_name) (struct drm_device *dev, char *buf);
692 691
693 /** 692 /**
694 * get_vblank_counter - get raw hardware vblank counter 693 * get_vblank_counter - get raw hardware vblank counter