Deleted Added
sdiff udiff text old ( 153033 ) new ( 153579 )
full compact
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 $");
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 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);
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
183 if (!strcmp(device_get_name(nbdev), "drmsub"))
184 dev->device = device_get_parent(nbdev);
185 else
186 dev->device = nbdev;
187
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 ---