2005-01-01 13:22:58 -07:00
|
|
|
/* savage_drv.c -- Savage driver for Linux
|
|
|
|
*
|
|
|
|
* Copyright 2004 Felix Kuehling
|
|
|
|
* All Rights Reserved.
|
2004-02-22 09:20:16 -07:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sub license,
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
* of the Software.
|
|
|
|
*
|
2005-01-01 13:22:58 -07:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NON-INFRINGEMENT. IN NO EVENT SHALL FELIX KUEHLING BE LIABLE FOR
|
|
|
|
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
|
|
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
2004-02-22 09:20:16 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "drmP.h"
|
|
|
|
#include "savage_drm.h"
|
|
|
|
#include "savage_drv.h"
|
|
|
|
|
2004-09-27 13:51:38 -06:00
|
|
|
#include "drm_pciids.h"
|
|
|
|
|
|
|
|
static struct pci_device_id pciidlist[] = {
|
|
|
|
savage_PCI_IDS
|
|
|
|
};
|
|
|
|
|
2004-10-11 21:59:17 -06:00
|
|
|
static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
|
2004-10-10 16:54:55 -06:00
|
|
|
static struct drm_driver driver = {
|
2005-01-01 13:22:58 -07:00
|
|
|
.driver_features =
|
|
|
|
DRIVER_USE_AGP | DRIVER_USE_MTRR |
|
|
|
|
DRIVER_HAVE_DMA | DRIVER_PCI_DMA,
|
|
|
|
.dev_priv_size = sizeof(drm_savage_buf_priv_t),
|
2005-08-04 21:50:23 -06:00
|
|
|
.load = savage_driver_load,
|
|
|
|
.firstopen = savage_driver_firstopen,
|
|
|
|
.lastclose = savage_driver_lastclose,
|
|
|
|
.unload = savage_driver_unload,
|
2005-01-01 13:22:58 -07:00
|
|
|
.reclaim_buffers = savage_reclaim_buffers,
|
|
|
|
.get_map_ofs = drm_core_get_map_ofs,
|
|
|
|
.get_reg_ofs = drm_core_get_reg_ofs,
|
2005-08-06 23:37:25 -06:00
|
|
|
.ioctls = savage_ioctls,
|
2005-01-01 13:22:58 -07:00
|
|
|
.dma_ioctl = savage_bci_buffers,
|
2004-09-30 12:13:33 -06:00
|
|
|
.fops = {
|
|
|
|
.owner = THIS_MODULE,
|
|
|
|
.open = drm_open,
|
|
|
|
.release = drm_release,
|
|
|
|
.ioctl = drm_ioctl,
|
|
|
|
.mmap = drm_mmap,
|
2004-10-13 10:40:53 -06:00
|
|
|
.poll = drm_poll,
|
2004-09-30 12:13:33 -06:00
|
|
|
.fasync = drm_fasync,
|
|
|
|
},
|
2004-10-11 21:59:17 -06:00
|
|
|
.pci_driver = {
|
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.id_table = pciidlist,
|
|
|
|
.probe = probe,
|
|
|
|
.remove = __devexit_p(drm_cleanup_pci),
|
2005-08-04 21:50:23 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
.name = DRIVER_NAME,
|
|
|
|
.desc = DRIVER_DESC,
|
|
|
|
.date = DRIVER_DATE,
|
|
|
|
.major = DRIVER_MAJOR,
|
|
|
|
.minor = DRIVER_MINOR,
|
|
|
|
.patchlevel = DRIVER_PATCHLEVEL,
|
2004-09-27 13:51:38 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
|
{
|
2004-10-11 21:59:17 -06:00
|
|
|
return drm_get_dev(pdev, ent, &driver);
|
2004-09-27 13:51:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
static int __init savage_init(void)
|
|
|
|
{
|
2005-08-06 23:37:25 -06:00
|
|
|
driver.num_ioctls = savage_max_ioctl;
|
2004-10-11 21:59:17 -06:00
|
|
|
return drm_init(&driver, pciidlist);
|
2004-09-27 13:51:38 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit savage_exit(void)
|
|
|
|
{
|
2004-10-11 21:59:17 -06:00
|
|
|
drm_exit(&driver);
|
2004-09-27 13:51:38 -06:00
|
|
|
}
|
2004-02-22 09:20:16 -07:00
|
|
|
|
2004-09-27 13:51:38 -06:00
|
|
|
module_init(savage_init);
|
|
|
|
module_exit(savage_exit);
|
2004-02-22 09:20:16 -07:00
|
|
|
|
2004-09-27 13:51:38 -06:00
|
|
|
MODULE_AUTHOR( DRIVER_AUTHOR );
|
|
|
|
MODULE_DESCRIPTION( DRIVER_DESC );
|
|
|
|
MODULE_LICENSE("GPL and additional rights");
|