Deleted Added
full compact
drm_drv.c (183573) drm_drv.c (183833)
1/*-
2 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

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

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright 1999, 2000 Precision Insight, Inc., Cedar Park, Texas.
3 * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation

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

24 *
25 * Authors:
26 * Rickard E. (Rik) Faith <faith@valinux.com>
27 * Gareth Hughes <gareth@valinux.com>
28 *
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_drv.c 183573 2008-10-03 16:59:11Z rnoland $");
32__FBSDID("$FreeBSD: head/sys/dev/drm/drm_drv.c 183833 2008-10-13 18:03:27Z rnoland $");
33
34/** @file drm_drv.c
35 * The catch-all file for DRM device support, including module setup/teardown,
36 * open/close, and ioctl dispatch.
37 */
38
39
40#include <sys/limits.h>

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

278
279 if (dev->driver->lastclose != NULL)
280 dev->driver->lastclose(dev);
281
282 if (dev->irq_enabled)
283 drm_irq_uninstall(dev);
284
285 if (dev->unique) {
33
34/** @file drm_drv.c
35 * The catch-all file for DRM device support, including module setup/teardown,
36 * open/close, and ioctl dispatch.
37 */
38
39
40#include <sys/limits.h>

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

278
279 if (dev->driver->lastclose != NULL)
280 dev->driver->lastclose(dev);
281
282 if (dev->irq_enabled)
283 drm_irq_uninstall(dev);
284
285 if (dev->unique) {
286 free(dev->unique, M_DRM);
286 free(dev->unique, DRM_MEM_DRIVER);
287 dev->unique = NULL;
288 dev->unique_len = 0;
289 }
290 /* Clear pid list */
291 for (i = 0; i < DRM_HASH_SIZE; i++) {
292 for (pt = dev->magiclist[i].head; pt; pt = next) {
293 next = pt->next;
287 dev->unique = NULL;
288 dev->unique_len = 0;
289 }
290 /* Clear pid list */
291 for (i = 0; i < DRM_HASH_SIZE; i++) {
292 for (pt = dev->magiclist[i].head; pt; pt = next) {
293 next = pt->next;
294 free(pt, M_DRM);
294 free(pt, DRM_MEM_MAGIC);
295 }
296 dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
297 }
298
299 DRM_UNLOCK();
300 drm_drawable_free_all(dev);
301 DRM_LOCK();
302

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

308 /* Remove AGP resources, but leave dev->agp intact until
309 * drm_unload is called.
310 */
311 for (entry = dev->agp->memory; entry; entry = nexte) {
312 nexte = entry->next;
313 if (entry->bound)
314 drm_agp_unbind_memory(entry->handle);
315 drm_agp_free_memory(entry->handle);
295 }
296 dev->magiclist[i].head = dev->magiclist[i].tail = NULL;
297 }
298
299 DRM_UNLOCK();
300 drm_drawable_free_all(dev);
301 DRM_LOCK();
302

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

308 /* Remove AGP resources, but leave dev->agp intact until
309 * drm_unload is called.
310 */
311 for (entry = dev->agp->memory; entry; entry = nexte) {
312 nexte = entry->next;
313 if (entry->bound)
314 drm_agp_unbind_memory(entry->handle);
315 drm_agp_free_memory(entry->handle);
316 free(entry, M_DRM);
316 free(entry, DRM_MEM_AGPLISTS);
317 }
318 dev->agp->memory = NULL;
319
320 if (dev->agp->acquired)
321 drm_agp_release(dev);
322
323 dev->agp->acquired = 0;
324 dev->agp->enabled = 0;

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

477 if (dev->pcir[i] == NULL)
478 continue;
479 bus_release_resource(dev->device, SYS_RES_MEMORY,
480 dev->pcirid[i], dev->pcir[i]);
481 dev->pcir[i] = NULL;
482 }
483
484 if (dev->agp) {
317 }
318 dev->agp->memory = NULL;
319
320 if (dev->agp->acquired)
321 drm_agp_release(dev);
322
323 dev->agp->acquired = 0;
324 dev->agp->enabled = 0;

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

477 if (dev->pcir[i] == NULL)
478 continue;
479 bus_release_resource(dev->device, SYS_RES_MEMORY,
480 dev->pcirid[i], dev->pcir[i]);
481 dev->pcir[i] = NULL;
482 }
483
484 if (dev->agp) {
485 free(dev->agp, M_DRM);
485 free(dev->agp, DRM_MEM_AGPLISTS);
486 dev->agp = NULL;
487 }
488
489 if (dev->driver->unload != NULL) {
490 DRM_LOCK();
491 dev->driver->unload(dev);
492 DRM_UNLOCK();
493 }

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

621 !dev->driver->reclaim_buffers_locked)
622 drm_reclaim_buffers(dev, file_priv);
623
624 funsetown(&dev->buf_sigio);
625
626 if (dev->driver->postclose != NULL)
627 dev->driver->postclose(dev, file_priv);
628 TAILQ_REMOVE(&dev->files, file_priv, link);
486 dev->agp = NULL;
487 }
488
489 if (dev->driver->unload != NULL) {
490 DRM_LOCK();
491 dev->driver->unload(dev);
492 DRM_UNLOCK();
493 }

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

621 !dev->driver->reclaim_buffers_locked)
622 drm_reclaim_buffers(dev, file_priv);
623
624 funsetown(&dev->buf_sigio);
625
626 if (dev->driver->postclose != NULL)
627 dev->driver->postclose(dev, file_priv);
628 TAILQ_REMOVE(&dev->files, file_priv, link);
629 free(file_priv, M_DRM);
629 free(file_priv, DRM_MEM_FILES);
630
631 /* ========================================================
632 * End inline drm_release
633 */
634
635 atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
636 device_unbusy(dev->device);
637 if (--dev->open_count == 0) {

--- 144 unchanged lines hidden ---
630
631 /* ========================================================
632 * End inline drm_release
633 */
634
635 atomic_inc(&dev->counts[_DRM_STAT_CLOSES]);
636 device_unbusy(dev->device);
637 if (--dev->open_count == 0) {

--- 144 unchanged lines hidden ---