diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2009-12-11 04:24:15 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-11 06:29:34 -0500 |
commit | 6ee738610f41b59733f63718f0bdbcba7d3a3f12 (patch) | |
tree | eccb9f07671998c50a1bc606a54cd6f82ba43e0a /drivers/gpu/drm/nouveau/nouveau_ioc32.c | |
parent | d1ede145cea25c5b6d2ebb19b167af14e374bb45 (diff) |
drm/nouveau: Add DRM driver for NVIDIA GPUs
This adds a drm/kms staging non-API stable driver for GPUs from NVIDIA.
This driver is a KMS-based driver and requires a compatible nouveau
userspace libdrm and nouveau X.org driver.
This driver requires firmware files not available in this kernel tree,
interested parties can find them via the nouveau project git archive.
This driver is reverse engineered, and is in no way supported by nVidia.
Support for nearly the complete range of nvidia hw from nv04->g80 (nv50)
is available, and the kms driver should support driving nearly all
output types (displayport is under development still) along with supporting
suspend/resume.
This work is all from the upstream nouveau project found at
nouveau.freedesktop.org.
The original authors list from nouveau git tree is:
Anssi Hannula <anssi.hannula@iki.fi>
Ben Skeggs <bskeggs@redhat.com>
Francisco Jerez <currojerez@riseup.net>
Maarten Maathuis <madman2003@gmail.com>
Marcin KoĆcielnicki <koriakin@0x04.net>
Matthew Garrett <mjg@redhat.com>
Matt Parnell <mparnell@gmail.com>
Patrice Mandin <patmandin@gmail.com>
Pekka Paalanen <pq@iki.fi>
Xavier Chantry <shiningxc@gmail.com>
along with project founder Stephane Marchesin <marchesin@icps.u-strasbg.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_ioc32.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_ioc32.c | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_ioc32.c b/drivers/gpu/drm/nouveau/nouveau_ioc32.c new file mode 100644 index 000000000000..a2c30f4611ba --- /dev/null +++ b/drivers/gpu/drm/nouveau/nouveau_ioc32.c | |||
@@ -0,0 +1,72 @@ | |||
1 | /** | ||
2 | * \file mga_ioc32.c | ||
3 | * | ||
4 | * 32-bit ioctl compatibility routines for the MGA DRM. | ||
5 | * | ||
6 | * \author Dave Airlie <airlied@linux.ie> with code from patches by Egbert Eich | ||
7 | * | ||
8 | * | ||
9 | * Copyright (C) Paul Mackerras 2005 | ||
10 | * Copyright (C) Egbert Eich 2003,2004 | ||
11 | * Copyright (C) Dave Airlie 2005 | ||
12 | * All Rights Reserved. | ||
13 | * | ||
14 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
15 | * copy of this software and associated documentation files (the "Software"), | ||
16 | * to deal in the Software without restriction, including without limitation | ||
17 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
18 | * and/or sell copies of the Software, and to permit persons to whom the | ||
19 | * Software is furnished to do so, subject to the following conditions: | ||
20 | * | ||
21 | * The above copyright notice and this permission notice (including the next | ||
22 | * paragraph) shall be included in all copies or substantial portions of the | ||
23 | * Software. | ||
24 | * | ||
25 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
26 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
27 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
28 | * THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
29 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
30 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS | ||
31 | * IN THE SOFTWARE. | ||
32 | */ | ||
33 | |||
34 | #include <linux/compat.h> | ||
35 | |||
36 | #include "drmP.h" | ||
37 | #include "drm.h" | ||
38 | |||
39 | #include "nouveau_drv.h" | ||
40 | |||
41 | /** | ||
42 | * Called whenever a 32-bit process running under a 64-bit kernel | ||
43 | * performs an ioctl on /dev/dri/card<n>. | ||
44 | * | ||
45 | * \param filp file pointer. | ||
46 | * \param cmd command. | ||
47 | * \param arg user argument. | ||
48 | * \return zero on success or negative number on failure. | ||
49 | */ | ||
50 | long nouveau_compat_ioctl(struct file *filp, unsigned int cmd, | ||
51 | unsigned long arg) | ||
52 | { | ||
53 | unsigned int nr = DRM_IOCTL_NR(cmd); | ||
54 | drm_ioctl_compat_t *fn = NULL; | ||
55 | int ret; | ||
56 | |||
57 | if (nr < DRM_COMMAND_BASE) | ||
58 | return drm_compat_ioctl(filp, cmd, arg); | ||
59 | |||
60 | #if 0 | ||
61 | if (nr < DRM_COMMAND_BASE + DRM_ARRAY_SIZE(mga_compat_ioctls)) | ||
62 | fn = nouveau_compat_ioctls[nr - DRM_COMMAND_BASE]; | ||
63 | #endif | ||
64 | lock_kernel(); /* XXX for now */ | ||
65 | if (fn != NULL) | ||
66 | ret = (*fn)(filp, cmd, arg); | ||
67 | else | ||
68 | ret = drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); | ||
69 | unlock_kernel(); | ||
70 | |||
71 | return ret; | ||
72 | } | ||