2 * Copyright 2005 Adam Jackson.
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:
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
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.
23 /* derived from tdfx_drv.c */
25 #include <linux/config.h>
27 #include "imagine_drv.h"
29 #include "drm_pciids.h"
31 static struct drm_driver driver;
33 static int postinit(struct drm_device *dev, unsigned long flags)
35 DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n",
36 DRIVER_NAME, DRIVER_MAJOR, DRIVER_MINOR, DRIVER_PATCHLEVEL,
37 DRIVER_DATE, dev->primary.minor, pci_pretty_name(dev->pdev));
41 static int version(drm_version_t *version)
45 version->version_major = DRIVER_MAJOR;
46 version->version_minor = DRIVER_MINOR;
47 version->version_patchlevel = DRIVER_PATCHLEVEL;
48 DRM_COPY(version->name, DRIVER_NAME);
49 DRM_COPY(version->date, DRIVER_DATE);
50 DRM_COPY(version->desc, DRIVER_DESC);
54 static struct pci_device_id pciidlist[] = {
58 static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
60 return drm_get_dev(pdev, ent, &driver);
63 static struct drm_driver driver = {
64 .driver_features = DRIVER_USE_MTRR,
65 .reclaim_buffers = drm_core_reclaim_buffers,
66 .get_map_ofs = drm_core_get_map_ofs,
67 .get_reg_ofs = drm_core_get_reg_ofs,
73 .release = drm_release,
81 .id_table = pciidlist,
83 .remove = __devexit_p(drm_cleanup_pci),
87 static int __init imagine_init(void)
89 return drm_init(&driver, pciidlist);
92 static void __exit imagine_exit(void)
97 module_init(imagine_init);
98 module_exit(imagine_exit);
100 MODULE_AUTHOR(DRIVER_AUTHOR);
101 MODULE_DESCRIPTION(DRIVER_DESC);
102 MODULE_LICENSE("GPL and additional rights");