diff options
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/drm_sysfs.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_backlight.c | 12 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_combios.c | 44 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_state.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_memory.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/via/via_irq.c | 4 |
9 files changed, 45 insertions, 43 deletions
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 7e42b7e9d43a..014ce24761b9 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
@@ -70,19 +70,17 @@ static int drm_class_resume(struct device *dev) | |||
70 | return 0; | 70 | return 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | /* Display the version of drm_core. This doesn't work right in current design */ | ||
74 | static ssize_t version_show(struct class *dev, char *buf) | ||
75 | { | ||
76 | return sprintf(buf, "%s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR, | ||
77 | CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE); | ||
78 | } | ||
79 | |||
80 | static char *drm_devnode(struct device *dev, mode_t *mode) | 73 | static char *drm_devnode(struct device *dev, mode_t *mode) |
81 | { | 74 | { |
82 | return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); | 75 | return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev)); |
83 | } | 76 | } |
84 | 77 | ||
85 | static CLASS_ATTR(version, S_IRUGO, version_show, NULL); | 78 | static CLASS_ATTR_STRING(version, S_IRUGO, |
79 | CORE_NAME " " | ||
80 | __stringify(CORE_MAJOR) "." | ||
81 | __stringify(CORE_MINOR) "." | ||
82 | __stringify(CORE_PATCHLEVEL) " " | ||
83 | CORE_DATE); | ||
86 | 84 | ||
87 | /** | 85 | /** |
88 | * drm_sysfs_create - create a struct drm_sysfs_class structure | 86 | * drm_sysfs_create - create a struct drm_sysfs_class structure |
@@ -109,7 +107,7 @@ struct class *drm_sysfs_create(struct module *owner, char *name) | |||
109 | class->suspend = drm_class_suspend; | 107 | class->suspend = drm_class_suspend; |
110 | class->resume = drm_class_resume; | 108 | class->resume = drm_class_resume; |
111 | 109 | ||
112 | err = class_create_file(class, &class_attr_version); | 110 | err = class_create_file(class, &class_attr_version.attr); |
113 | if (err) | 111 | if (err) |
114 | goto err_out_class; | 112 | goto err_out_class; |
115 | 113 | ||
@@ -132,7 +130,7 @@ void drm_sysfs_destroy(void) | |||
132 | { | 130 | { |
133 | if ((drm_class == NULL) || (IS_ERR(drm_class))) | 131 | if ((drm_class == NULL) || (IS_ERR(drm_class))) |
134 | return; | 132 | return; |
135 | class_remove_file(drm_class, &class_attr_version); | 133 | class_remove_file(drm_class, &class_attr_version.attr); |
136 | class_destroy(drm_class); | 134 | class_destroy(drm_class); |
137 | } | 135 | } |
138 | 136 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_backlight.c b/drivers/gpu/drm/nouveau/nouveau_backlight.c index 20564f8cb0ec..406228f4a2a0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_backlight.c +++ b/drivers/gpu/drm/nouveau/nouveau_backlight.c | |||
@@ -89,19 +89,21 @@ static struct backlight_ops nv50_bl_ops = { | |||
89 | 89 | ||
90 | static int nouveau_nv40_backlight_init(struct drm_device *dev) | 90 | static int nouveau_nv40_backlight_init(struct drm_device *dev) |
91 | { | 91 | { |
92 | struct backlight_properties props; | ||
92 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 93 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
93 | struct backlight_device *bd; | 94 | struct backlight_device *bd; |
94 | 95 | ||
95 | if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) | 96 | if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK)) |
96 | return 0; | 97 | return 0; |
97 | 98 | ||
99 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
100 | props.max_brightness = 31; | ||
98 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, | 101 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, |
99 | &nv40_bl_ops); | 102 | &nv40_bl_ops, &props); |
100 | if (IS_ERR(bd)) | 103 | if (IS_ERR(bd)) |
101 | return PTR_ERR(bd); | 104 | return PTR_ERR(bd); |
102 | 105 | ||
103 | dev_priv->backlight = bd; | 106 | dev_priv->backlight = bd; |
104 | bd->props.max_brightness = 31; | ||
105 | bd->props.brightness = nv40_get_intensity(bd); | 107 | bd->props.brightness = nv40_get_intensity(bd); |
106 | backlight_update_status(bd); | 108 | backlight_update_status(bd); |
107 | 109 | ||
@@ -110,19 +112,21 @@ static int nouveau_nv40_backlight_init(struct drm_device *dev) | |||
110 | 112 | ||
111 | static int nouveau_nv50_backlight_init(struct drm_device *dev) | 113 | static int nouveau_nv50_backlight_init(struct drm_device *dev) |
112 | { | 114 | { |
115 | struct backlight_properties props; | ||
113 | struct drm_nouveau_private *dev_priv = dev->dev_private; | 116 | struct drm_nouveau_private *dev_priv = dev->dev_private; |
114 | struct backlight_device *bd; | 117 | struct backlight_device *bd; |
115 | 118 | ||
116 | if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) | 119 | if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT)) |
117 | return 0; | 120 | return 0; |
118 | 121 | ||
122 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
123 | props.max_brightness = 1025; | ||
119 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, | 124 | bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev, |
120 | &nv50_bl_ops); | 125 | &nv50_bl_ops, &props); |
121 | if (IS_ERR(bd)) | 126 | if (IS_ERR(bd)) |
122 | return PTR_ERR(bd); | 127 | return PTR_ERR(bd); |
123 | 128 | ||
124 | dev_priv->backlight = bd; | 129 | dev_priv->backlight = bd; |
125 | bd->props.max_brightness = 1025; | ||
126 | bd->props.brightness = nv50_get_intensity(bd); | 130 | bd->props.brightness = nv50_get_intensity(bd); |
127 | backlight_update_status(bd); | 131 | backlight_update_status(bd); |
128 | return 0; | 132 | return 0; |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index aed6068a6ca5..b5a9336a2e88 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -3545,7 +3545,7 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b | |||
3545 | * at which modes should be set up in the dual link style. | 3545 | * at which modes should be set up in the dual link style. |
3546 | * | 3546 | * |
3547 | * Following the header, the BMP (ver 0xa) table has several records, | 3547 | * Following the header, the BMP (ver 0xa) table has several records, |
3548 | * indexed by a seperate xlat table, indexed in turn by the fp strap in | 3548 | * indexed by a separate xlat table, indexed in turn by the fp strap in |
3549 | * EXTDEV_BOOT. Each record had a config byte, followed by 6 script | 3549 | * EXTDEV_BOOT. Each record had a config byte, followed by 6 script |
3550 | * numbers for use by INIT_SUB which controlled panel init and power, | 3550 | * numbers for use by INIT_SUB which controlled panel init and power, |
3551 | * and finally a dword of ms to sleep between power off and on | 3551 | * and finally a dword of ms to sleep between power off and on |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 5bd8071523d2..d8b559011777 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
@@ -553,7 +553,7 @@ struct drm_nouveau_private { | |||
553 | uint32_t ramro_offset; | 553 | uint32_t ramro_offset; |
554 | uint32_t ramro_size; | 554 | uint32_t ramro_size; |
555 | 555 | ||
556 | /* base physical adresses */ | 556 | /* base physical addresses */ |
557 | uint64_t fb_phys; | 557 | uint64_t fb_phys; |
558 | uint64_t fb_available_size; | 558 | uint64_t fb_available_size; |
559 | uint64_t fb_mappable_pages; | 559 | uint64_t fb_mappable_pages; |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 6d87e70a505b..2becdeda68a3 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
@@ -1353,47 +1353,47 @@ bool radeon_get_legacy_connector_info_from_table(struct drm_device *dev) | |||
1353 | rdev->mode_info.connector_table = radeon_connector_table; | 1353 | rdev->mode_info.connector_table = radeon_connector_table; |
1354 | if (rdev->mode_info.connector_table == CT_NONE) { | 1354 | if (rdev->mode_info.connector_table == CT_NONE) { |
1355 | #ifdef CONFIG_PPC_PMAC | 1355 | #ifdef CONFIG_PPC_PMAC |
1356 | if (machine_is_compatible("PowerBook3,3")) { | 1356 | if (of_machine_is_compatible("PowerBook3,3")) { |
1357 | /* powerbook with VGA */ | 1357 | /* powerbook with VGA */ |
1358 | rdev->mode_info.connector_table = CT_POWERBOOK_VGA; | 1358 | rdev->mode_info.connector_table = CT_POWERBOOK_VGA; |
1359 | } else if (machine_is_compatible("PowerBook3,4") || | 1359 | } else if (of_machine_is_compatible("PowerBook3,4") || |
1360 | machine_is_compatible("PowerBook3,5")) { | 1360 | of_machine_is_compatible("PowerBook3,5")) { |
1361 | /* powerbook with internal tmds */ | 1361 | /* powerbook with internal tmds */ |
1362 | rdev->mode_info.connector_table = CT_POWERBOOK_INTERNAL; | 1362 | rdev->mode_info.connector_table = CT_POWERBOOK_INTERNAL; |
1363 | } else if (machine_is_compatible("PowerBook5,1") || | 1363 | } else if (of_machine_is_compatible("PowerBook5,1") || |
1364 | machine_is_compatible("PowerBook5,2") || | 1364 | of_machine_is_compatible("PowerBook5,2") || |
1365 | machine_is_compatible("PowerBook5,3") || | 1365 | of_machine_is_compatible("PowerBook5,3") || |
1366 | machine_is_compatible("PowerBook5,4") || | 1366 | of_machine_is_compatible("PowerBook5,4") || |
1367 | machine_is_compatible("PowerBook5,5")) { | 1367 | of_machine_is_compatible("PowerBook5,5")) { |
1368 | /* powerbook with external single link tmds (sil164) */ | 1368 | /* powerbook with external single link tmds (sil164) */ |
1369 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; | 1369 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; |
1370 | } else if (machine_is_compatible("PowerBook5,6")) { | 1370 | } else if (of_machine_is_compatible("PowerBook5,6")) { |
1371 | /* powerbook with external dual or single link tmds */ | 1371 | /* powerbook with external dual or single link tmds */ |
1372 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; | 1372 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; |
1373 | } else if (machine_is_compatible("PowerBook5,7") || | 1373 | } else if (of_machine_is_compatible("PowerBook5,7") || |
1374 | machine_is_compatible("PowerBook5,8") || | 1374 | of_machine_is_compatible("PowerBook5,8") || |
1375 | machine_is_compatible("PowerBook5,9")) { | 1375 | of_machine_is_compatible("PowerBook5,9")) { |
1376 | /* PowerBook6,2 ? */ | 1376 | /* PowerBook6,2 ? */ |
1377 | /* powerbook with external dual link tmds (sil1178?) */ | 1377 | /* powerbook with external dual link tmds (sil1178?) */ |
1378 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; | 1378 | rdev->mode_info.connector_table = CT_POWERBOOK_EXTERNAL; |
1379 | } else if (machine_is_compatible("PowerBook4,1") || | 1379 | } else if (of_machine_is_compatible("PowerBook4,1") || |
1380 | machine_is_compatible("PowerBook4,2") || | 1380 | of_machine_is_compatible("PowerBook4,2") || |
1381 | machine_is_compatible("PowerBook4,3") || | 1381 | of_machine_is_compatible("PowerBook4,3") || |
1382 | machine_is_compatible("PowerBook6,3") || | 1382 | of_machine_is_compatible("PowerBook6,3") || |
1383 | machine_is_compatible("PowerBook6,5") || | 1383 | of_machine_is_compatible("PowerBook6,5") || |
1384 | machine_is_compatible("PowerBook6,7")) { | 1384 | of_machine_is_compatible("PowerBook6,7")) { |
1385 | /* ibook */ | 1385 | /* ibook */ |
1386 | rdev->mode_info.connector_table = CT_IBOOK; | 1386 | rdev->mode_info.connector_table = CT_IBOOK; |
1387 | } else if (machine_is_compatible("PowerMac4,4")) { | 1387 | } else if (of_machine_is_compatible("PowerMac4,4")) { |
1388 | /* emac */ | 1388 | /* emac */ |
1389 | rdev->mode_info.connector_table = CT_EMAC; | 1389 | rdev->mode_info.connector_table = CT_EMAC; |
1390 | } else if (machine_is_compatible("PowerMac10,1")) { | 1390 | } else if (of_machine_is_compatible("PowerMac10,1")) { |
1391 | /* mini with internal tmds */ | 1391 | /* mini with internal tmds */ |
1392 | rdev->mode_info.connector_table = CT_MINI_INTERNAL; | 1392 | rdev->mode_info.connector_table = CT_MINI_INTERNAL; |
1393 | } else if (machine_is_compatible("PowerMac10,2")) { | 1393 | } else if (of_machine_is_compatible("PowerMac10,2")) { |
1394 | /* mini with external tmds */ | 1394 | /* mini with external tmds */ |
1395 | rdev->mode_info.connector_table = CT_MINI_EXTERNAL; | 1395 | rdev->mode_info.connector_table = CT_MINI_EXTERNAL; |
1396 | } else if (machine_is_compatible("PowerMac12,1")) { | 1396 | } else if (of_machine_is_compatible("PowerMac12,1")) { |
1397 | /* PowerMac8,1 ? */ | 1397 | /* PowerMac8,1 ? */ |
1398 | /* imac g5 isight */ | 1398 | /* imac g5 isight */ |
1399 | rdev->mode_info.connector_table = CT_IMAC_G5_ISIGHT; | 1399 | rdev->mode_info.connector_table = CT_IMAC_G5_ISIGHT; |
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c index 3c32f840dcd2..40ab6d9c3736 100644 --- a/drivers/gpu/drm/radeon/radeon_state.c +++ b/drivers/gpu/drm/radeon/radeon_state.c | |||
@@ -1093,7 +1093,7 @@ static void radeon_cp_dispatch_clear(struct drm_device * dev, | |||
1093 | /* judging by the first tile offset needed, could possibly | 1093 | /* judging by the first tile offset needed, could possibly |
1094 | directly address/clear 4x4 tiles instead of 8x2 * 4x4 | 1094 | directly address/clear 4x4 tiles instead of 8x2 * 4x4 |
1095 | macro tiles, though would still need clear mask for | 1095 | macro tiles, though would still need clear mask for |
1096 | right/bottom if truely 4x4 granularity is desired ? */ | 1096 | right/bottom if truly 4x4 granularity is desired ? */ |
1097 | OUT_RING(tileoffset * 16); | 1097 | OUT_RING(tileoffset * 16); |
1098 | /* the number of tiles to clear */ | 1098 | /* the number of tiles to clear */ |
1099 | OUT_RING(nrtilesx + 1); | 1099 | OUT_RING(nrtilesx + 1); |
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 9db02bb3e3fe..dd47b2a9a791 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -128,7 +128,7 @@ static struct attribute *ttm_bo_global_attrs[] = { | |||
128 | NULL | 128 | NULL |
129 | }; | 129 | }; |
130 | 130 | ||
131 | static struct sysfs_ops ttm_bo_global_ops = { | 131 | static const struct sysfs_ops ttm_bo_global_ops = { |
132 | .show = &ttm_bo_global_show | 132 | .show = &ttm_bo_global_show |
133 | }; | 133 | }; |
134 | 134 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index f9d6b35c3b88..c40e5f48e9a1 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c | |||
@@ -152,7 +152,7 @@ static struct attribute *ttm_mem_zone_attrs[] = { | |||
152 | NULL | 152 | NULL |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static struct sysfs_ops ttm_mem_zone_ops = { | 155 | static const struct sysfs_ops ttm_mem_zone_ops = { |
156 | .show = &ttm_mem_zone_show, | 156 | .show = &ttm_mem_zone_show, |
157 | .store = &ttm_mem_zone_store | 157 | .store = &ttm_mem_zone_store |
158 | }; | 158 | }; |
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c index 5935b8842e86..34079f251cd4 100644 --- a/drivers/gpu/drm/via/via_irq.c +++ b/drivers/gpu/drm/via/via_irq.c | |||
@@ -150,7 +150,7 @@ irqreturn_t via_driver_irq_handler(DRM_IRQ_ARGS) | |||
150 | cur_irq++; | 150 | cur_irq++; |
151 | } | 151 | } |
152 | 152 | ||
153 | /* Acknowlege interrupts */ | 153 | /* Acknowledge interrupts */ |
154 | VIA_WRITE(VIA_REG_INTERRUPT, status); | 154 | VIA_WRITE(VIA_REG_INTERRUPT, status); |
155 | 155 | ||
156 | 156 | ||
@@ -165,7 +165,7 @@ static __inline__ void viadrv_acknowledge_irqs(drm_via_private_t * dev_priv) | |||
165 | u32 status; | 165 | u32 status; |
166 | 166 | ||
167 | if (dev_priv) { | 167 | if (dev_priv) { |
168 | /* Acknowlege interrupts */ | 168 | /* Acknowledge interrupts */ |
169 | status = VIA_READ(VIA_REG_INTERRUPT); | 169 | status = VIA_READ(VIA_REG_INTERRUPT); |
170 | VIA_WRITE(VIA_REG_INTERRUPT, status | | 170 | VIA_WRITE(VIA_REG_INTERRUPT, status | |
171 | dev_priv->irq_pending_mask); | 171 | dev_priv->irq_pending_mask); |