FreeBSD/sys/dev/drm2/drm_agpsupport.c
/**
 * Acquire the AGP device.
 *
 * \param dev DRM device that is to acquire AGP.
 * \return zero on success or a negative number on failure.
 *
 * Verifies the AGP device hasn't been acquired before and calls
 * \c agp_backend_acquire.
 */
Acquire the AGP device.
\param dev DRM device that is to acquire AGP.
\return zero on success or a negative number on failure.

Verifies the AGP device hasn't been acquired before and calls
\c agp_backend_acquire.
Acquire the AGP device . \ param dev DRM device that is to acquire AGP . \ return zero on success or a negative number on failure . Verifies the AGP device hasn ' t been acquired before and calls \ c agp_backend_acquire .
int drm_agp_acquire(struct drm_device * dev)
{
	int retcode;
	if (!dev->agp)
		return -ENODEV;
	if (dev->agp->acquired)
		return -EBUSY;
	retcode = agp_acquire(dev->agp->bridge);
	if (retcode)
		return -retcode;
	dev->agp->acquired = 1;
	return 0;
}
int drm_agp_acquire ( struct drm_device * dev ) { int retcode ; if ( ! dev -> agp ) return - ENODEV ; if ( dev -> agp -> acquired ) return - EBUSY ; retcode = agp_acquire ( dev -> agp -> bridge ) ; if ( retcode ) return - retcode ; dev -> agp -> acquired = 1 ; return 0 ; }
Acquire the AGP device.
Acquire the AGP device .