diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/Kconfig | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/Kconfig | 33 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/Makefile | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r300_cmdbuf.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit.c | 33 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_blit_kms.c | 31 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_cp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600_cs.c | 26 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_cp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 70 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.h | 16 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_irq.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_mem.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_state.c | 2 |
14 files changed, 115 insertions, 117 deletions
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 983201b450f1..3399b209260a 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig | |||
@@ -96,6 +96,7 @@ config DRM_RADEON | |||
96 | select DRM_TTM | 96 | select DRM_TTM |
97 | select POWER_SUPPLY | 97 | select POWER_SUPPLY |
98 | select HWMON | 98 | select HWMON |
99 | select BACKLIGHT_CLASS_DEVICE | ||
99 | help | 100 | help |
100 | Choose this option if you have an ATI Radeon graphics card. There | 101 | Choose this option if you have an ATI Radeon graphics card. There |
101 | are both PCI and AGP versions. You don't need to choose this to | 102 | are both PCI and AGP versions. You don't need to choose this to |
diff --git a/drivers/gpu/drm/radeon/Kconfig b/drivers/gpu/drm/radeon/Kconfig index ea92bbe3ed37..970f8e92dbb7 100644 --- a/drivers/gpu/drm/radeon/Kconfig +++ b/drivers/gpu/drm/radeon/Kconfig | |||
@@ -1,31 +1,8 @@ | |||
1 | config DRM_RADEON_KMS | 1 | config DRM_RADEON_UMS |
2 | bool "Enable modesetting on radeon by default - NEW DRIVER" | 2 | bool "Enable userspace modesetting on radeon (DEPRECATED)" |
3 | depends on DRM_RADEON | 3 | depends on DRM_RADEON |
4 | select BACKLIGHT_CLASS_DEVICE | ||
5 | help | 4 | help |
6 | Choose this option if you want kernel modesetting enabled by default. | 5 | Choose this option if you still need userspace modesetting. |
7 | 6 | ||
8 | This is a completely new driver. It's only part of the existing drm | 7 | Userspace modesetting is deprecated for quite some time now, so |
9 | for compatibility reasons. It requires an entirely different graphics | 8 | enable this only if you have ancient versions of the DDX drivers. |
10 | stack above it and works very differently from the old drm stack. | ||
11 | i.e. don't enable this unless you know what you are doing it may | ||
12 | cause issues or bugs compared to the previous userspace driver stack. | ||
13 | |||
14 | When kernel modesetting is enabled the IOCTL of radeon/drm | ||
15 | driver are considered as invalid and an error message is printed | ||
16 | in the log and they return failure. | ||
17 | |||
18 | KMS enabled userspace will use new API to talk with the radeon/drm | ||
19 | driver. The new API provide functions to create/destroy/share/mmap | ||
20 | buffer object which are then managed by the kernel memory manager | ||
21 | (here TTM). In order to submit command to the GPU the userspace | ||
22 | provide a buffer holding the command stream, along this buffer | ||
23 | userspace have to provide a list of buffer object used by the | ||
24 | command stream. The kernel radeon driver will then place buffer | ||
25 | in GPU accessible memory and will update command stream to reflect | ||
26 | the position of the different buffers. | ||
27 | |||
28 | The kernel will also perform security check on command stream | ||
29 | provided by the user, we want to catch and forbid any illegal use | ||
30 | of the GPU such as DMA into random system memory or into memory | ||
31 | not owned by the process supplying the command stream. | ||
diff --git a/drivers/gpu/drm/radeon/Makefile b/drivers/gpu/drm/radeon/Makefile index a6598fd66423..bf172522ea68 100644 --- a/drivers/gpu/drm/radeon/Makefile +++ b/drivers/gpu/drm/radeon/Makefile | |||
@@ -56,8 +56,12 @@ $(obj)/r600_cs.o: $(obj)/r600_reg_safe.h | |||
56 | 56 | ||
57 | $(obj)/evergreen_cs.o: $(obj)/evergreen_reg_safe.h $(obj)/cayman_reg_safe.h | 57 | $(obj)/evergreen_cs.o: $(obj)/evergreen_reg_safe.h $(obj)/cayman_reg_safe.h |
58 | 58 | ||
59 | radeon-y := radeon_drv.o radeon_cp.o radeon_state.o radeon_mem.o \ | 59 | radeon-y := radeon_drv.o |
60 | radeon_irq.o r300_cmdbuf.o r600_cp.o | 60 | |
61 | # add UMS driver | ||
62 | radeon-$(CONFIG_DRM_RADEON_UMS)+= radeon_cp.o radeon_state.o radeon_mem.o \ | ||
63 | radeon_irq.o r300_cmdbuf.o r600_cp.o r600_blit.o | ||
64 | |||
61 | # add KMS driver | 65 | # add KMS driver |
62 | radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ | 66 | radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ |
63 | radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \ | 67 | radeon_atombios.o radeon_agp.o atombios_crtc.o radeon_combios.o \ |
@@ -67,7 +71,7 @@ radeon-y += radeon_device.o radeon_asic.o radeon_kms.o \ | |||
67 | radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \ | 71 | radeon_clocks.o radeon_fb.o radeon_gem.o radeon_ring.o radeon_irq_kms.o \ |
68 | radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ | 72 | radeon_cs.o radeon_bios.o radeon_benchmark.o r100.o r300.o r420.o \ |
69 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ | 73 | rs400.o rs600.o rs690.o rv515.o r520.o r600.o rv770.o radeon_test.o \ |
70 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit.o r600_blit_shaders.o \ | 74 | r200.o radeon_legacy_tv.o r600_cs.o r600_blit_shaders.o \ |
71 | r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ | 75 | r600_blit_kms.o radeon_pm.o atombios_dp.o r600_audio.o r600_hdmi.o \ |
72 | evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \ | 76 | evergreen.o evergreen_cs.o evergreen_blit_shaders.o evergreen_blit_kms.o \ |
73 | evergreen_hdmi.o radeon_trace_points.o ni.o cayman_blit_shaders.o \ | 77 | evergreen_hdmi.o radeon_trace_points.o ni.o cayman_blit_shaders.o \ |
diff --git a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c index 002ab038d2ab..865e2c9980db 100644 --- a/drivers/gpu/drm/radeon/r300_cmdbuf.c +++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c | |||
@@ -29,6 +29,8 @@ | |||
29 | * | 29 | * |
30 | * Authors: | 30 | * Authors: |
31 | * Nicolai Haehnle <prefect_@gmx.net> | 31 | * Nicolai Haehnle <prefect_@gmx.net> |
32 | * | ||
33 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
32 | */ | 34 | */ |
33 | 35 | ||
34 | #include <drm/drmP.h> | 36 | #include <drm/drmP.h> |
diff --git a/drivers/gpu/drm/radeon/r600_blit.c b/drivers/gpu/drm/radeon/r600_blit.c index 77da1f9c0b8e..f651881eb0ae 100644 --- a/drivers/gpu/drm/radeon/r600_blit.c +++ b/drivers/gpu/drm/radeon/r600_blit.c | |||
@@ -22,6 +22,8 @@ | |||
22 | * | 22 | * |
23 | * Authors: | 23 | * Authors: |
24 | * Alex Deucher <alexander.deucher@amd.com> | 24 | * Alex Deucher <alexander.deucher@amd.com> |
25 | * | ||
26 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
25 | */ | 27 | */ |
26 | #include <drm/drmP.h> | 28 | #include <drm/drmP.h> |
27 | #include <drm/radeon_drm.h> | 29 | #include <drm/radeon_drm.h> |
@@ -488,37 +490,6 @@ set_default_state(drm_radeon_private_t *dev_priv) | |||
488 | ADVANCE_RING(); | 490 | ADVANCE_RING(); |
489 | } | 491 | } |
490 | 492 | ||
491 | /* 23 bits of float fractional data */ | ||
492 | #define I2F_FRAC_BITS 23 | ||
493 | #define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) | ||
494 | |||
495 | /* | ||
496 | * Converts unsigned integer into 32-bit IEEE floating point representation. | ||
497 | * Will be exact from 0 to 2^24. Above that, we round towards zero | ||
498 | * as the fractional bits will not fit in a float. (It would be better to | ||
499 | * round towards even as the fpu does, but that is slower.) | ||
500 | */ | ||
501 | __pure uint32_t int2float(uint32_t x) | ||
502 | { | ||
503 | uint32_t msb, exponent, fraction; | ||
504 | |||
505 | /* Zero is special */ | ||
506 | if (!x) return 0; | ||
507 | |||
508 | /* Get location of the most significant bit */ | ||
509 | msb = __fls(x); | ||
510 | |||
511 | /* | ||
512 | * Use a rotate instead of a shift because that works both leftwards | ||
513 | * and rightwards due to the mod(32) behaviour. This means we don't | ||
514 | * need to check to see if we are above 2^24 or not. | ||
515 | */ | ||
516 | fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; | ||
517 | exponent = (127 + msb) << I2F_FRAC_BITS; | ||
518 | |||
519 | return fraction + exponent; | ||
520 | } | ||
521 | |||
522 | static int r600_nomm_get_vb(struct drm_device *dev) | 493 | static int r600_nomm_get_vb(struct drm_device *dev) |
523 | { | 494 | { |
524 | drm_radeon_private_t *dev_priv = dev->dev_private; | 495 | drm_radeon_private_t *dev_priv = dev->dev_private; |
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c index e082dca6feee..9fb5780a552f 100644 --- a/drivers/gpu/drm/radeon/r600_blit_kms.c +++ b/drivers/gpu/drm/radeon/r600_blit_kms.c | |||
@@ -31,6 +31,37 @@ | |||
31 | #include "r600_blit_shaders.h" | 31 | #include "r600_blit_shaders.h" |
32 | #include "radeon_blit_common.h" | 32 | #include "radeon_blit_common.h" |
33 | 33 | ||
34 | /* 23 bits of float fractional data */ | ||
35 | #define I2F_FRAC_BITS 23 | ||
36 | #define I2F_MASK ((1 << I2F_FRAC_BITS) - 1) | ||
37 | |||
38 | /* | ||
39 | * Converts unsigned integer into 32-bit IEEE floating point representation. | ||
40 | * Will be exact from 0 to 2^24. Above that, we round towards zero | ||
41 | * as the fractional bits will not fit in a float. (It would be better to | ||
42 | * round towards even as the fpu does, but that is slower.) | ||
43 | */ | ||
44 | __pure uint32_t int2float(uint32_t x) | ||
45 | { | ||
46 | uint32_t msb, exponent, fraction; | ||
47 | |||
48 | /* Zero is special */ | ||
49 | if (!x) return 0; | ||
50 | |||
51 | /* Get location of the most significant bit */ | ||
52 | msb = __fls(x); | ||
53 | |||
54 | /* | ||
55 | * Use a rotate instead of a shift because that works both leftwards | ||
56 | * and rightwards due to the mod(32) behaviour. This means we don't | ||
57 | * need to check to see if we are above 2^24 or not. | ||
58 | */ | ||
59 | fraction = ror32(x, (msb - I2F_FRAC_BITS) & 0x1f) & I2F_MASK; | ||
60 | exponent = (127 + msb) << I2F_FRAC_BITS; | ||
61 | |||
62 | return fraction + exponent; | ||
63 | } | ||
64 | |||
34 | /* emits 21 on rv770+, 23 on r600 */ | 65 | /* emits 21 on rv770+, 23 on r600 */ |
35 | static void | 66 | static void |
36 | set_render_target(struct radeon_device *rdev, int format, | 67 | set_render_target(struct radeon_device *rdev, int format, |
diff --git a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c index be85f75aedda..1c51c08b1fde 100644 --- a/drivers/gpu/drm/radeon/r600_cp.c +++ b/drivers/gpu/drm/radeon/r600_cp.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * Authors: | 24 | * Authors: |
25 | * Dave Airlie <airlied@redhat.com> | 25 | * Dave Airlie <airlied@redhat.com> |
26 | * Alex Deucher <alexander.deucher@amd.com> | 26 | * Alex Deucher <alexander.deucher@amd.com> |
27 | * | ||
28 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
27 | */ | 29 | */ |
28 | 30 | ||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 0d210164cdba..931a70289033 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
@@ -2313,17 +2313,7 @@ int r600_cs_parse(struct radeon_cs_parser *p) | |||
2313 | return 0; | 2313 | return 0; |
2314 | } | 2314 | } |
2315 | 2315 | ||
2316 | static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) | 2316 | #ifdef CONFIG_DRM_RADEON_UMS |
2317 | { | ||
2318 | if (p->chunk_relocs_idx == -1) { | ||
2319 | return 0; | ||
2320 | } | ||
2321 | p->relocs = kzalloc(sizeof(struct radeon_cs_reloc), GFP_KERNEL); | ||
2322 | if (p->relocs == NULL) { | ||
2323 | return -ENOMEM; | ||
2324 | } | ||
2325 | return 0; | ||
2326 | } | ||
2327 | 2317 | ||
2328 | /** | 2318 | /** |
2329 | * cs_parser_fini() - clean parser states | 2319 | * cs_parser_fini() - clean parser states |
@@ -2349,6 +2339,18 @@ static void r600_cs_parser_fini(struct radeon_cs_parser *parser, int error) | |||
2349 | kfree(parser->chunks_array); | 2339 | kfree(parser->chunks_array); |
2350 | } | 2340 | } |
2351 | 2341 | ||
2342 | static int r600_cs_parser_relocs_legacy(struct radeon_cs_parser *p) | ||
2343 | { | ||
2344 | if (p->chunk_relocs_idx == -1) { | ||
2345 | return 0; | ||
2346 | } | ||
2347 | p->relocs = kzalloc(sizeof(struct radeon_cs_reloc), GFP_KERNEL); | ||
2348 | if (p->relocs == NULL) { | ||
2349 | return -ENOMEM; | ||
2350 | } | ||
2351 | return 0; | ||
2352 | } | ||
2353 | |||
2352 | int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, | 2354 | int r600_cs_legacy(struct drm_device *dev, void *data, struct drm_file *filp, |
2353 | unsigned family, u32 *ib, int *l) | 2355 | unsigned family, u32 *ib, int *l) |
2354 | { | 2356 | { |
@@ -2410,6 +2412,8 @@ void r600_cs_legacy_init(void) | |||
2410 | r600_nomm = 1; | 2412 | r600_nomm = 1; |
2411 | } | 2413 | } |
2412 | 2414 | ||
2415 | #endif | ||
2416 | |||
2413 | /* | 2417 | /* |
2414 | * DMA | 2418 | * DMA |
2415 | */ | 2419 | */ |
diff --git a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c index 9143fc45e35b..efc4f6441ef4 100644 --- a/drivers/gpu/drm/radeon/radeon_cp.c +++ b/drivers/gpu/drm/radeon/radeon_cp.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * Authors: | 27 | * Authors: |
28 | * Kevin E. Martin <martin@valinux.com> | 28 | * Kevin E. Martin <martin@valinux.com> |
29 | * Gareth Hughes <gareth@valinux.com> | 29 | * Gareth Hughes <gareth@valinux.com> |
30 | * | ||
31 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
30 | */ | 32 | */ |
31 | 33 | ||
32 | #include <linux/module.h> | 34 | #include <linux/module.h> |
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index d9bf96ee299a..833484da12d9 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -123,15 +123,25 @@ struct dma_buf *radeon_gem_prime_export(struct drm_device *dev, | |||
123 | int flags); | 123 | int flags); |
124 | struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev, | 124 | struct drm_gem_object *radeon_gem_prime_import(struct drm_device *dev, |
125 | struct dma_buf *dma_buf); | 125 | struct dma_buf *dma_buf); |
126 | extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, | ||
127 | unsigned long arg); | ||
126 | 128 | ||
127 | #if defined(CONFIG_DEBUG_FS) | 129 | #if defined(CONFIG_DEBUG_FS) |
128 | int radeon_debugfs_init(struct drm_minor *minor); | 130 | int radeon_debugfs_init(struct drm_minor *minor); |
129 | void radeon_debugfs_cleanup(struct drm_minor *minor); | 131 | void radeon_debugfs_cleanup(struct drm_minor *minor); |
130 | #endif | 132 | #endif |
131 | 133 | ||
134 | /* atpx handler */ | ||
135 | #if defined(CONFIG_VGA_SWITCHEROO) | ||
136 | void radeon_register_atpx_handler(void); | ||
137 | void radeon_unregister_atpx_handler(void); | ||
138 | #else | ||
139 | static inline void radeon_register_atpx_handler(void) {} | ||
140 | static inline void radeon_unregister_atpx_handler(void) {} | ||
141 | #endif | ||
132 | 142 | ||
133 | int radeon_no_wb; | 143 | int radeon_no_wb; |
134 | int radeon_modeset = -1; | 144 | int radeon_modeset = 1; |
135 | int radeon_dynclks = -1; | 145 | int radeon_dynclks = -1; |
136 | int radeon_r4xx_atom = 0; | 146 | int radeon_r4xx_atom = 0; |
137 | int radeon_agpmode = 0; | 147 | int radeon_agpmode = 0; |
@@ -199,6 +209,14 @@ module_param_named(msi, radeon_msi, int, 0444); | |||
199 | MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)"); | 209 | MODULE_PARM_DESC(lockup_timeout, "GPU lockup timeout in ms (defaul 10000 = 10 seconds, 0 = disable)"); |
200 | module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444); | 210 | module_param_named(lockup_timeout, radeon_lockup_timeout, int, 0444); |
201 | 211 | ||
212 | static struct pci_device_id pciidlist[] = { | ||
213 | radeon_PCI_IDS | ||
214 | }; | ||
215 | |||
216 | MODULE_DEVICE_TABLE(pci, pciidlist); | ||
217 | |||
218 | #ifdef CONFIG_DRM_RADEON_UMS | ||
219 | |||
202 | static int radeon_suspend(struct drm_device *dev, pm_message_t state) | 220 | static int radeon_suspend(struct drm_device *dev, pm_message_t state) |
203 | { | 221 | { |
204 | drm_radeon_private_t *dev_priv = dev->dev_private; | 222 | drm_radeon_private_t *dev_priv = dev->dev_private; |
@@ -227,14 +245,6 @@ static int radeon_resume(struct drm_device *dev) | |||
227 | return 0; | 245 | return 0; |
228 | } | 246 | } |
229 | 247 | ||
230 | static struct pci_device_id pciidlist[] = { | ||
231 | radeon_PCI_IDS | ||
232 | }; | ||
233 | |||
234 | #if defined(CONFIG_DRM_RADEON_KMS) | ||
235 | MODULE_DEVICE_TABLE(pci, pciidlist); | ||
236 | #endif | ||
237 | |||
238 | static const struct file_operations radeon_driver_old_fops = { | 248 | static const struct file_operations radeon_driver_old_fops = { |
239 | .owner = THIS_MODULE, | 249 | .owner = THIS_MODULE, |
240 | .open = drm_open, | 250 | .open = drm_open, |
@@ -284,6 +294,8 @@ static struct drm_driver driver_old = { | |||
284 | .patchlevel = DRIVER_PATCHLEVEL, | 294 | .patchlevel = DRIVER_PATCHLEVEL, |
285 | }; | 295 | }; |
286 | 296 | ||
297 | #endif | ||
298 | |||
287 | static struct drm_driver kms_driver; | 299 | static struct drm_driver kms_driver; |
288 | 300 | ||
289 | static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) | 301 | static int radeon_kick_out_firmware_fb(struct pci_dev *pdev) |
@@ -411,10 +423,12 @@ static struct drm_driver kms_driver = { | |||
411 | static struct drm_driver *driver; | 423 | static struct drm_driver *driver; |
412 | static struct pci_driver *pdriver; | 424 | static struct pci_driver *pdriver; |
413 | 425 | ||
426 | #ifdef CONFIG_DRM_RADEON_UMS | ||
414 | static struct pci_driver radeon_pci_driver = { | 427 | static struct pci_driver radeon_pci_driver = { |
415 | .name = DRIVER_NAME, | 428 | .name = DRIVER_NAME, |
416 | .id_table = pciidlist, | 429 | .id_table = pciidlist, |
417 | }; | 430 | }; |
431 | #endif | ||
418 | 432 | ||
419 | static struct pci_driver radeon_kms_pci_driver = { | 433 | static struct pci_driver radeon_kms_pci_driver = { |
420 | .name = DRIVER_NAME, | 434 | .name = DRIVER_NAME, |
@@ -427,28 +441,6 @@ static struct pci_driver radeon_kms_pci_driver = { | |||
427 | 441 | ||
428 | static int __init radeon_init(void) | 442 | static int __init radeon_init(void) |
429 | { | 443 | { |
430 | driver = &driver_old; | ||
431 | pdriver = &radeon_pci_driver; | ||
432 | driver->num_ioctls = radeon_max_ioctl; | ||
433 | #ifdef CONFIG_VGA_CONSOLE | ||
434 | if (vgacon_text_force() && radeon_modeset == -1) { | ||
435 | DRM_INFO("VGACON disable radeon kernel modesetting.\n"); | ||
436 | driver = &driver_old; | ||
437 | pdriver = &radeon_pci_driver; | ||
438 | driver->driver_features &= ~DRIVER_MODESET; | ||
439 | radeon_modeset = 0; | ||
440 | } | ||
441 | #endif | ||
442 | /* if enabled by default */ | ||
443 | if (radeon_modeset == -1) { | ||
444 | #ifdef CONFIG_DRM_RADEON_KMS | ||
445 | DRM_INFO("radeon defaulting to kernel modesetting.\n"); | ||
446 | radeon_modeset = 1; | ||
447 | #else | ||
448 | DRM_INFO("radeon defaulting to userspace modesetting.\n"); | ||
449 | radeon_modeset = 0; | ||
450 | #endif | ||
451 | } | ||
452 | if (radeon_modeset == 1) { | 444 | if (radeon_modeset == 1) { |
453 | DRM_INFO("radeon kernel modesetting enabled.\n"); | 445 | DRM_INFO("radeon kernel modesetting enabled.\n"); |
454 | driver = &kms_driver; | 446 | driver = &kms_driver; |
@@ -456,9 +448,21 @@ static int __init radeon_init(void) | |||
456 | driver->driver_features |= DRIVER_MODESET; | 448 | driver->driver_features |= DRIVER_MODESET; |
457 | driver->num_ioctls = radeon_max_kms_ioctl; | 449 | driver->num_ioctls = radeon_max_kms_ioctl; |
458 | radeon_register_atpx_handler(); | 450 | radeon_register_atpx_handler(); |
451 | |||
452 | } else { | ||
453 | #ifdef CONFIG_DRM_RADEON_UMS | ||
454 | DRM_INFO("radeon userspace modesetting enabled.\n"); | ||
455 | driver = &driver_old; | ||
456 | pdriver = &radeon_pci_driver; | ||
457 | driver->driver_features &= ~DRIVER_MODESET; | ||
458 | driver->num_ioctls = radeon_max_ioctl; | ||
459 | #else | ||
460 | DRM_ERROR("No UMS support in radeon module!\n"); | ||
461 | return -EINVAL; | ||
462 | #endif | ||
459 | } | 463 | } |
460 | /* if the vga console setting is enabled still | 464 | |
461 | * let modprobe override it */ | 465 | /* let modprobe override vga console setting */ |
462 | return drm_pci_init(driver, pdriver); | 466 | return drm_pci_init(driver, pdriver); |
463 | } | 467 | } |
464 | 468 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.h b/drivers/gpu/drm/radeon/radeon_drv.h index e7fdf163a8ca..b369d42f7de5 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.h +++ b/drivers/gpu/drm/radeon/radeon_drv.h | |||
@@ -113,6 +113,9 @@ | |||
113 | #define DRIVER_MINOR 33 | 113 | #define DRIVER_MINOR 33 |
114 | #define DRIVER_PATCHLEVEL 0 | 114 | #define DRIVER_PATCHLEVEL 0 |
115 | 115 | ||
116 | /* The rest of the file is DEPRECATED! */ | ||
117 | #ifdef CONFIG_DRM_RADEON_UMS | ||
118 | |||
116 | enum radeon_cp_microcode_version { | 119 | enum radeon_cp_microcode_version { |
117 | UCODE_R100, | 120 | UCODE_R100, |
118 | UCODE_R200, | 121 | UCODE_R200, |
@@ -418,8 +421,6 @@ extern int radeon_driver_open(struct drm_device *dev, | |||
418 | struct drm_file *file_priv); | 421 | struct drm_file *file_priv); |
419 | extern long radeon_compat_ioctl(struct file *filp, unsigned int cmd, | 422 | extern long radeon_compat_ioctl(struct file *filp, unsigned int cmd, |
420 | unsigned long arg); | 423 | unsigned long arg); |
421 | extern long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, | ||
422 | unsigned long arg); | ||
423 | 424 | ||
424 | extern int radeon_master_create(struct drm_device *dev, struct drm_master *master); | 425 | extern int radeon_master_create(struct drm_device *dev, struct drm_master *master); |
425 | extern void radeon_master_destroy(struct drm_device *dev, struct drm_master *master); | 426 | extern void radeon_master_destroy(struct drm_device *dev, struct drm_master *master); |
@@ -462,15 +463,6 @@ extern void r600_blit_swap(struct drm_device *dev, | |||
462 | int sx, int sy, int dx, int dy, | 463 | int sx, int sy, int dx, int dy, |
463 | int w, int h, int src_pitch, int dst_pitch, int cpp); | 464 | int w, int h, int src_pitch, int dst_pitch, int cpp); |
464 | 465 | ||
465 | /* atpx handler */ | ||
466 | #if defined(CONFIG_VGA_SWITCHEROO) | ||
467 | void radeon_register_atpx_handler(void); | ||
468 | void radeon_unregister_atpx_handler(void); | ||
469 | #else | ||
470 | static inline void radeon_register_atpx_handler(void) {} | ||
471 | static inline void radeon_unregister_atpx_handler(void) {} | ||
472 | #endif | ||
473 | |||
474 | /* Flags for stats.boxes | 466 | /* Flags for stats.boxes |
475 | */ | 467 | */ |
476 | #define RADEON_BOX_DMA_IDLE 0x1 | 468 | #define RADEON_BOX_DMA_IDLE 0x1 |
@@ -2167,4 +2159,6 @@ extern void radeon_commit_ring(drm_radeon_private_t *dev_priv); | |||
2167 | } while (0) | 2159 | } while (0) |
2168 | 2160 | ||
2169 | 2161 | ||
2162 | #endif /* CONFIG_DRM_RADEON_UMS */ | ||
2163 | |||
2170 | #endif /* __RADEON_DRV_H__ */ | 2164 | #endif /* __RADEON_DRV_H__ */ |
diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c index e7710339a6a7..8d68e972789a 100644 --- a/drivers/gpu/drm/radeon/radeon_irq.c +++ b/drivers/gpu/drm/radeon/radeon_irq.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * Authors: | 28 | * Authors: |
29 | * Keith Whitwell <keith@tungstengraphics.com> | 29 | * Keith Whitwell <keith@tungstengraphics.com> |
30 | * Michel D�zer <michel@daenzer.net> | 30 | * Michel D�zer <michel@daenzer.net> |
31 | * | ||
32 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
31 | */ | 33 | */ |
32 | 34 | ||
33 | #include <drm/drmP.h> | 35 | #include <drm/drmP.h> |
diff --git a/drivers/gpu/drm/radeon/radeon_mem.c b/drivers/gpu/drm/radeon/radeon_mem.c index b9f067241633..d54d2d7c9031 100644 --- a/drivers/gpu/drm/radeon/radeon_mem.c +++ b/drivers/gpu/drm/radeon/radeon_mem.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * | 27 | * |
28 | * Authors: | 28 | * Authors: |
29 | * Keith Whitwell <keith@tungstengraphics.com> | 29 | * Keith Whitwell <keith@tungstengraphics.com> |
30 | * | ||
31 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
30 | */ | 32 | */ |
31 | 33 | ||
32 | #include <drm/drmP.h> | 34 | #include <drm/drmP.h> |
diff --git a/drivers/gpu/drm/radeon/radeon_state.c b/drivers/gpu/drm/radeon/radeon_state.c index 8e9057b6a365..4d20910899d4 100644 --- a/drivers/gpu/drm/radeon/radeon_state.c +++ b/drivers/gpu/drm/radeon/radeon_state.c | |||
@@ -25,6 +25,8 @@ | |||
25 | * Authors: | 25 | * Authors: |
26 | * Gareth Hughes <gareth@valinux.com> | 26 | * Gareth Hughes <gareth@valinux.com> |
27 | * Kevin E. Martin <martin@valinux.com> | 27 | * Kevin E. Martin <martin@valinux.com> |
28 | * | ||
29 | * ------------------------ This file is DEPRECATED! ------------------------- | ||
28 | */ | 30 | */ |
29 | 31 | ||
30 | #include <drm/drmP.h> | 32 | #include <drm/drmP.h> |