Deleted Added
full compact
mga_drv.c (152909) mga_drv.c (153579)
1/* mga_drv.c -- Matrox G200/G400 driver -*- linux-c -*-
2 * Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
3 */
4/*-
5 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
7 * All Rights Reserved.
8 *

--- 18 unchanged lines hidden (view full) ---

27 *
28 * Authors:
29 * Rickard E. (Rik) Faith <faith@valinux.com>
30 * Gareth Hughes <gareth@valinux.com>
31 *
32 */
33
34#include <sys/cdefs.h>
1/* mga_drv.c -- Matrox G200/G400 driver -*- linux-c -*-
2 * Created: Mon Dec 13 01:56:22 1999 by jhartmann@precisioninsight.com
3 */
4/*-
5 * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
6 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
7 * All Rights Reserved.
8 *

--- 18 unchanged lines hidden (view full) ---

27 *
28 * Authors:
29 * Rickard E. (Rik) Faith <faith@valinux.com>
30 * Gareth Hughes <gareth@valinux.com>
31 *
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/dev/drm/mga_drv.c 152909 2005-11-28 23:13:57Z anholt $");
35__FBSDID("$FreeBSD: head/sys/dev/drm/mga_drv.c 153579 2005-12-20 22:44:36Z jhb $");
36
37#include "dev/drm/drmP.h"
38#include "dev/drm/drm.h"
39#include "dev/drm/mga_drm.h"
40#include "dev/drm/mga_drv.h"
41#include "dev/drm/drm_pciids.h"
42
43/* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */

--- 15 unchanged lines hidden (view full) ---

59 * returned.
60 *
61 * \bug
62 * This function needs to be filled in! The implementation in
63 * linux-core/mga_drv.c shows what needs to be done.
64 */
65static int mga_driver_device_is_agp(drm_device_t * dev)
66{
36
37#include "dev/drm/drmP.h"
38#include "dev/drm/drm.h"
39#include "dev/drm/mga_drm.h"
40#include "dev/drm/mga_drv.h"
41#include "dev/drm/drm_pciids.h"
42
43/* drv_PCI_IDs comes from drm_pciids.h, generated from drm_pciids.txt. */

--- 15 unchanged lines hidden (view full) ---

59 * returned.
60 *
61 * \bug
62 * This function needs to be filled in! The implementation in
63 * linux-core/mga_drv.c shows what needs to be done.
64 */
65static int mga_driver_device_is_agp(drm_device_t * dev)
66{
67 device_t bus;
68
67 /* There are PCI versions of the G450. These cards have the
68 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
69 * bridge chip. We detect these cards, which are not currently
70 * supported by this driver, by looking at the device ID of the
71 * bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the
72 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
73 * device.
74 */
69 /* There are PCI versions of the G450. These cards have the
70 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
71 * bridge chip. We detect these cards, which are not currently
72 * supported by this driver, by looking at the device ID of the
73 * bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the
74 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
75 * device.
76 */
77#if __FreeBSD_version >= 700010
78 bus = device_get_parent(device_get_parent(dev->device));
79#else
80 bus = device_get_parent(dev->device);
81#endif
75 if (pci_get_device(dev->device) == 0x0525 &&
82 if (pci_get_device(dev->device) == 0x0525 &&
76 pci_get_vendor(device_get_parent(dev->device)) == 0x3388 &&
77 pci_get_device(device_get_parent(dev->device)) == 0x0021)
83 pci_get_vendor(bus) == 0x3388 &&
84 pci_get_device(bus) == 0x0021)
78 return 0;
79 else
80 return 2;
81}
82
83static void mga_configure(drm_device_t *dev)
84{
85 dev->driver.buf_priv_size = sizeof(drm_mga_buf_priv_t);

--- 57 unchanged lines hidden (view full) ---

143
144static driver_t mga_driver = {
145 "drm",
146 mga_methods,
147 sizeof(drm_device_t)
148};
149
150extern devclass_t drm_devclass;
85 return 0;
86 else
87 return 2;
88}
89
90static void mga_configure(drm_device_t *dev)
91{
92 dev->driver.buf_priv_size = sizeof(drm_mga_buf_priv_t);

--- 57 unchanged lines hidden (view full) ---

150
151static driver_t mga_driver = {
152 "drm",
153 mga_methods,
154 sizeof(drm_device_t)
155};
156
157extern devclass_t drm_devclass;
158#if __FreeBSD_version >= 700010
159DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0);
160#else
151DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0);
161DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0);
162#endif
152MODULE_DEPEND(mga, drm, 1, 1, 1);
153
154#elif defined(__NetBSD__) || defined(__OpenBSD__)
155#ifdef _LKM
156CFDRIVER_DECL(mga, DV_TTY, NULL);
157#else
158CFATTACH_DECL(mga, sizeof(drm_device_t), drm_probe, drm_attach, drm_detach,
159 drm_activate);
160#endif
161#endif
163MODULE_DEPEND(mga, drm, 1, 1, 1);
164
165#elif defined(__NetBSD__) || defined(__OpenBSD__)
166#ifdef _LKM
167CFDRIVER_DECL(mga, DV_TTY, NULL);
168#else
169CFATTACH_DECL(mga, sizeof(drm_device_t), drm_probe, drm_attach, drm_detach,
170 drm_activate);
171#endif
172#endif