aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-11-11 06:07:35 -0500
committerDave Airlie <airlied@linux.ie>2005-11-11 06:07:35 -0500
commit732052ed3e7539d87136dd833be523747af3fb3e (patch)
tree7989d3062e50f3edc2a206148c6e776f88e7a2c1 /drivers/char/drm/radeon_drv.c
parente96e33eeb8b876c7ec009c557ca5269328eceda0 (diff)
drm: simplify sysfs code for drm
This simplifies the sysfs code for the drm and add a dri_library_name attribute which can be used by a userspace app to figure out which library to load. From: Jon Smirl <jonsmirl@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/radeon_drv.c')
-rw-r--r--drivers/char/drm/radeon_drv.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/char/drm/radeon_drv.c b/drivers/char/drm/radeon_drv.c
index 999d74512362..b04ed1b562b9 100644
--- a/drivers/char/drm/radeon_drv.c
+++ b/drivers/char/drm/radeon_drv.c
@@ -42,6 +42,16 @@ int radeon_no_wb;
42MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n"); 42MODULE_PARM_DESC(no_wb, "Disable AGP writeback for scratch registers\n");
43module_param_named(no_wb, radeon_no_wb, int, 0444); 43module_param_named(no_wb, radeon_no_wb, int, 0444);
44 44
45static int dri_library_name(struct drm_device *dev, char *buf)
46{
47 drm_radeon_private_t *dev_priv = dev->dev_private;
48 int family = dev_priv->flags & CHIP_FAMILY_MASK;
49
50 return snprintf(buf, PAGE_SIZE, "%s\n",
51 (family < CHIP_R200) ? "radeon" :
52 ((family < CHIP_R300) ? "r200" :
53 "r300"));
54}
45 55
46static struct pci_device_id pciidlist[] = { 56static struct pci_device_id pciidlist[] = {
47 radeon_PCI_IDS 57 radeon_PCI_IDS
@@ -61,6 +71,7 @@ static struct drm_driver driver = {
61 .lastclose = radeon_driver_lastclose, 71 .lastclose = radeon_driver_lastclose,
62 .unload = radeon_driver_unload, 72 .unload = radeon_driver_unload,
63 .vblank_wait = radeon_driver_vblank_wait, 73 .vblank_wait = radeon_driver_vblank_wait,
74 .dri_library_name = dri_library_name,
64 .irq_preinstall = radeon_driver_irq_preinstall, 75 .irq_preinstall = radeon_driver_irq_preinstall,
65 .irq_postinstall = radeon_driver_irq_postinstall, 76 .irq_postinstall = radeon_driver_irq_postinstall,
66 .irq_uninstall = radeon_driver_irq_uninstall, 77 .irq_uninstall = radeon_driver_irq_uninstall,