summaryrefslogtreecommitdiffstats
path: root/sys/dev/drm/drm_fops.h
diff options
context:
space:
mode:
authoranholt <anholt@FreeBSD.org>2003-11-12 20:56:30 +0000
committeranholt <anholt@FreeBSD.org>2003-11-12 20:56:30 +0000
commit6a52a51a4490ccf15281df6dbd3ae35c26c166d5 (patch)
tree1255ca85a955cae45fb9e6254d7546e2e94cb09a /sys/dev/drm/drm_fops.h
parent3f57e25aebf74440eeb330bfd415b42a33d4872d (diff)
downloadFreeBSD-src-6a52a51a4490ccf15281df6dbd3ae35c26c166d5.zip
FreeBSD-src-6a52a51a4490ccf15281df6dbd3ae35c26c166d5.tar.gz
Update from DRI CVS. Includes locking fixes (including PR 59202), changes for
Radeon IGP support (still lacking PCI IDs), and DRM interface 1.2 updates which include finally tying the DRM instances to specific devices rather than relying on the X Server.
Diffstat (limited to 'sys/dev/drm/drm_fops.h')
-rw-r--r--sys/dev/drm/drm_fops.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/drm/drm_fops.h b/sys/dev/drm/drm_fops.h
index eb44970..190b708 100644
--- a/sys/dev/drm/drm_fops.h
+++ b/sys/dev/drm/drm_fops.h
@@ -34,7 +34,6 @@
#include "dev/drm/drmP.h"
-/* Requires device lock held */
drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
{
#if __FreeBSD_version >= 500021
@@ -46,6 +45,8 @@ drm_file_t *DRM(find_file_by_proc)(drm_device_t *dev, DRM_STRUCTPROC *p)
#endif
drm_file_t *priv;
+ DRM_SPINLOCK_ASSERT(&dev->dev_lock);
+
TAILQ_FOREACH(priv, &dev->files, link)
if (priv->pid == pid && priv->uid == uid)
return priv;
@@ -66,7 +67,7 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p,
DRM_DEBUG("pid = %d, minor = %d\n", DRM_CURRENTPID, m);
DRM_LOCK();
- priv = (drm_file_t *) DRM(find_file_by_proc)(dev, p);
+ priv = DRM(find_file_by_proc)(dev, p);
if (priv) {
priv->refs++;
} else {
@@ -89,6 +90,9 @@ int DRM(open_helper)(dev_t kdev, int flags, int fmt, DRM_STRUCTPROC *p,
priv->devXX = dev;
priv->ioctl_count = 0;
priv->authenticated = !DRM_SUSER(p);
+
+ DRIVER_OPEN_HELPER( priv, dev );
+
TAILQ_INSERT_TAIL(&dev->files, priv, link);
}
DRM_UNLOCK();
OpenPOWER on IntegriCloud