hi, guys,

I am trying to understand the DRI/DRM code. I know about
Linux, but have no knowledge of FreeBSD. Could you please
kindly help me on the following question about DRM on FreeBSD?

For FreeBSD, in drm_close(), there is the following code
to release drmlock in case that current process is dying while
holding drmlock.

-------------------------------------------------------------------
int drm_close (struct cdev *kdev, int flags, int fmt, DRM_STRUCTPROC *p)
{
...
if (dev->lock.hw_lock && _DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)
&& dev->lock.filp == filp) {
DRM_DEBUG("Process %d dead, freeing lock for context %d\n",
DRM_CURRENTPID,
_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
if (dev->driver.reclaim_buffers_locked != NULL)
dev->driver.reclaim_buffers_locked(dev, filp);

drm_lock_free(dev, &dev->lock.hw_lock->lock,
_DRM_LOCKING_CONTEXT(dev->lock.hw_lock->lock));
...
}
-------------------------------------------------------------------
Here, filp is the pid of current process.


So, if this process executes the following code, will drm_close()
be called when drmClose(fd1) ? and is drm_lock forced-released while
this process still assumes it owns drmlock?

fd0 = drmOpen(/dev/dri/drm0);
fd1 = drmOpen(/dev/dri/drm0);
drmLock(fd0);
drmClose(fd1); <----
....



thanks,
-minskey

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to