Deleted Added
full compact
drm_drv.c (153033) drm_drv.c (153579)
1/* drm_drv.h -- Generic driver template -*- linux-c -*-
2 * Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
3 */
4/*-
5 * Copyright 1999, 2000 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/* drm_drv.h -- Generic driver template -*- linux-c -*-
2 * Created: Thu Nov 23 03:10:50 2000 by gareth@valinux.com
3 */
4/*-
5 * Copyright 1999, 2000 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/drm_drv.c 153033 2005-12-03 01:23:50Z anholt $");
35__FBSDID("$FreeBSD: head/sys/dev/drm/drm_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/drm_sarea.h"
40
41#ifdef DRM_DEBUG_DEFAULT_ON
42int drm_debug_flag = 1;
43#else

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

148 .d_bmaj = -1
149#endif
150};
151
152int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
153{
154 drm_pci_id_list_t *id_entry;
155 int vendor, device;
36
37#include "dev/drm/drmP.h"
38#include "dev/drm/drm.h"
39#include "dev/drm/drm_sarea.h"
40
41#ifdef DRM_DEBUG_DEFAULT_ON
42int drm_debug_flag = 1;
43#else

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

148 .d_bmaj = -1
149#endif
150};
151
152int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
153{
154 drm_pci_id_list_t *id_entry;
155 int vendor, device;
156#if __FreeBSD_version < 700010
156 device_t realdev;
157
158 if (!strcmp(device_get_name(dev), "drmsub"))
159 realdev = device_get_parent(dev);
160 else
161 realdev = dev;
162 vendor = pci_get_vendor(realdev);
163 device = pci_get_device(realdev);
157 device_t realdev;
158
159 if (!strcmp(device_get_name(dev), "drmsub"))
160 realdev = device_get_parent(dev);
161 else
162 realdev = dev;
163 vendor = pci_get_vendor(realdev);
164 device = pci_get_device(realdev);
165#else
166 vendor = pci_get_vendor(dev);
167 device = pci_get_device(dev);
168#endif
164
165 id_entry = drm_find_description(vendor, device, idlist);
166 if (id_entry != NULL) {
167 device_set_desc(dev, id_entry->name);
168 return 0;
169 }
170
171 return ENXIO;
172}
173
174int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
175{
176 drm_device_t *dev;
177 drm_pci_id_list_t *id_entry;
178 int unit;
179
180 unit = device_get_unit(nbdev);
181 dev = device_get_softc(nbdev);
182
169
170 id_entry = drm_find_description(vendor, device, idlist);
171 if (id_entry != NULL) {
172 device_set_desc(dev, id_entry->name);
173 return 0;
174 }
175
176 return ENXIO;
177}
178
179int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
180{
181 drm_device_t *dev;
182 drm_pci_id_list_t *id_entry;
183 int unit;
184
185 unit = device_get_unit(nbdev);
186 dev = device_get_softc(nbdev);
187
188#if __FreeBSD_version < 700010
183 if (!strcmp(device_get_name(nbdev), "drmsub"))
184 dev->device = device_get_parent(nbdev);
185 else
186 dev->device = nbdev;
189 if (!strcmp(device_get_name(nbdev), "drmsub"))
190 dev->device = device_get_parent(nbdev);
191 else
192 dev->device = nbdev;
187
193#else
194 dev->device = nbdev;
195#endif
188 dev->devnode = make_dev(&drm_cdevsw,
189 unit,
190 DRM_DEV_UID,
191 DRM_DEV_GID,
192 DRM_DEV_MODE,
193 "dri/card%d", unit);
194#if __FreeBSD_version >= 500000
195 mtx_init(&dev->dev_lock, "drm device", NULL, MTX_DEF);

--- 751 unchanged lines hidden ---
196 dev->devnode = make_dev(&drm_cdevsw,
197 unit,
198 DRM_DEV_UID,
199 DRM_DEV_GID,
200 DRM_DEV_MODE,
201 "dri/card%d", unit);
202#if __FreeBSD_version >= 500000
203 mtx_init(&dev->dev_lock, "drm device", NULL, MTX_DEF);

--- 751 unchanged lines hidden ---