Use fixed sized types in new ioctls
[profile/ivi/libdrm.git] / linux-core / imagine_drv.c
1 /*
2  * Copyright 2005 Adam Jackson.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * on the rights to use, copy, modify, merge, publish, distribute, sub
8  * license, and/or sell copies of the Software, and to permit persons to whom
9  * the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice (including the next
12  * paragraph) shall be included in all copies or substantial portions of the
13  * Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
18  * ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22
23 /* derived from tdfx_drv.c */
24
25 #include "drmP.h"
26 #include "imagine_drv.h"
27
28 #include "drm_pciids.h"
29
30 static struct drm_driver driver;
31
32 static struct pci_device_id pciidlist[] = {
33     imagine_PCI_IDS
34 };
35
36 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
37 {
38     return drm_get_dev(pdev, ent, &driver);
39 }
40
41 static struct drm_driver driver = {
42     .driver_features = DRIVER_USE_MTRR,
43     .reclaim_buffers = drm_core_reclaim_buffers,
44     .get_map_ofs = drm_core_get_map_ofs,
45     .get_reg_ofs = drm_core_get_reg_ofs,
46     .fops = {
47         .owner = THIS_MODULE,
48         .open = drm_open,
49         .release = drm_release,
50         .ioctl = drm_ioctl,
51         .mmap = drm_mmap,
52         .poll = drm_poll,
53         .fasync = drm_fasync,
54     },
55     .pci_driver = {
56         .name = DRIVER_NAME,
57         .id_table = pciidlist,
58         .probe = probe,
59         .remove = __devexit_p(drm_cleanup_pci),
60     },
61
62     .name = DRIVER_NAME,
63     .desc = DRIVER_DESC,
64     .date = DRIVER_DATE,
65     .major = DRIVER_MAJOR,
66     .minor = DRIVER_MINOR,
67     .patchlevel = DRIVER_PATCHLEVEL,
68 };
69
70 static int __init imagine_init(void)
71 {
72     return drm_init(&driver, pciidlist);
73 }
74
75 static void __exit imagine_exit(void)
76 {
77     drm_exit(&driver);
78 }
79
80 module_init(imagine_init);
81 module_exit(imagine_exit);
82
83 MODULE_AUTHOR(DRIVER_AUTHOR);
84 MODULE_DESCRIPTION(DRIVER_DESC);
85 MODULE_LICENSE("GPL and additional rights");