/* This should be sufficient to wait for GPU idle without having to worry about starvation.  */
void drm_idlelock_take(struct drm_lock_data *lock_data)
/* This should be sufficient to wait for GPU idle without having to worry about starvation.  */
void drm_idlelock_take(struct drm_lock_data *lock_data)
{
	int ret = 0;
	spin_lock_bh(&lock_data->spinlock);
	lock_data->kernel_waiters++;
	if (!lock_data->idle_has_lock) {
		spin_unlock_bh(&lock_data->spinlock);
		ret = drm_lock_take(lock_data, DRM_KERNEL_CONTEXT);
		spin_lock_bh(&lock_data->spinlock);
		if (ret == 1)
			lock_data->idle_has_lock = 1;
	}
	spin_unlock_bh(&lock_data->spinlock);
}