Lines Matching refs:dev

159  * \param dev DRM device structure.
161 * Frees every resource in \p dev.
165 int drm_lastclose(struct drm_device * dev)
169 if (dev->driver->lastclose)
170 dev->driver->lastclose(dev);
173 if (dev->irq_enabled && !drm_core_check_feature(dev, DRIVER_MODESET))
174 (void) drm_irq_uninstall(dev);
176 mutex_lock(&dev->struct_mutex);
179 if (drm_core_has_AGP(dev) && dev->agp &&
180 !drm_core_check_feature(dev, DRIVER_MODESET)) {
183 /* Remove AGP resources, but leave dev->agp
185 list_for_each_entry_safe(entry, tempe, struct drm_agp_mem, &dev->agp->memory, head) {
187 (void) drm_agp_unbind_memory(entry->handle, dev);
190 INIT_LIST_HEAD(&dev->agp->memory);
192 if (dev->agp->acquired)
193 (void) drm_agp_release(dev);
195 dev->agp->acquired = 0;
196 dev->agp->enabled = 0;
198 if (drm_core_check_feature(dev, DRIVER_SG) && dev->sg &&
199 !drm_core_check_feature(dev, DRIVER_MODESET)) {
200 drm_sg_cleanup(dev->sg);
201 dev->sg = NULL;
204 if (drm_core_check_feature(dev, DRIVER_HAVE_DMA) &&
205 !drm_core_check_feature(dev, DRIVER_MODESET))
206 drm_dma_takedown(dev);
208 mutex_unlock(&dev->struct_mutex);
227 int drm_init(struct drm_device *dev, struct drm_driver *driver)
229 dev_info_t *dip = dev->devinfo;
236 pdev = pci_dev_create(dev);
243 ret = drm_get_dev(dev, pdev, driver, driver->id_table[i].driver_data);
252 devop = ddi_get_driver(dev->devinfo);
259 dev->drm_fm_cap = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
264 drm_fm_init(dev);
273 void drm_exit(struct drm_device *dev)
275 drm_put_dev(dev);
276 pci_dev_destroy(dev->pdev);
277 drm_fm_fini(dev);
333 version->version_major = dev->driver->major;
334 version->version_minor = dev->driver->minor;
335 version->version_patchlevel = dev->driver->patchlevel;
337 dev->driver->name);
340 dev->driver->date);
343 dev->driver->desc);
349 * Called whenever a process performs an ioctl on /dev/drm.
359 struct drm_device *dev = file_priv->minor->dev;
368 atomic_inc(&dev->ioctl_count);
369 atomic_inc(&dev->counts[_DRM_STAT_IOCTLS]);
376 (nr < DRM_COMMAND_BASE + dev->driver->num_ioctls)) {
377 ioctl = &dev->driver->ioctls[nr - DRM_COMMAND_BASE];
391 if ((nr == DRM_IOCTL_NR(DRM_IOCTL_DMA)) && dev->driver->dma_ioctl)
392 func = dev->driver->dma_ioctl;
435 retcode = func(dev_id, dev, kdata, file_priv, mode, credp);
458 atomic_dec(&dev->ioctl_count);
464 struct drm_local_map *drm_getsarea(struct drm_device *dev)
468 list_for_each_entry(entry, struct drm_map_list, &dev->maplist, head) {
494 struct drm_device *dev = obj->dev;
495 mutex_lock(&dev->struct_mutex);
497 mutex_unlock(&dev->struct_mutex);
564 drm_fm_init(struct drm_device *dev)
566 dev_info_t *dip = dev->devinfo;
567 if (dev->drm_fm_cap) {
569 ddi_fm_init(dip, &dev->drm_fm_cap, NULL);
574 if (DDI_FM_EREPORT_CAP(dev->drm_fm_cap) ||
575 DDI_FM_ERRCB_CAP(dev->drm_fm_cap)) {
582 if (DDI_FM_ERRCB_CAP(dev->drm_fm_cap)) {
584 drm_fm_error_cb, (void*) dev);
590 drm_fm_fini(struct drm_device *dev)
592 dev_info_t *dip = dev->devinfo;
593 if (dev->drm_fm_cap) {
594 if (DDI_FM_EREPORT_CAP(dev->drm_fm_cap) ||
595 DDI_FM_ERRCB_CAP(dev->drm_fm_cap)) {
599 if (DDI_FM_ERRCB_CAP(dev->drm_fm_cap)) {
613 struct drm_device *dev,
618 dev_info_t *dip = dev->devinfo;
620 if (DDI_FM_EREPORT_CAP(dev->drm_fm_cap)) {
637 struct drm_device *dev,
642 if (!DDI_FM_ACC_ERR_CAP(dev->drm_fm_cap)) {
660 struct drm_device *dev,
665 if (!DDI_FM_DMA_ERR_CAP(dev->drm_fm_cap)) {