[Intel-gfx] [PATCH] intel: Adding locks for drm objects synchronization.

Jacek Danecki jacek.danecki at intel.com
Fri Sep 19 17:52:38 CEST 2014


On 09/19/14 17:36, Daniel Vetter wrote:
> Hm, I don't see what this fixes, except maybe a race in the kernel?
> Testcase plus some analysis in the commit message about what blows up
> exactly and how this fixes it is required here.

Currently we can reproduce this issue using our "internal" projects in multi-threaded configurations.
I'll try to extend test [1] to reproduce issue. Without this patch DRM_IOCTL_I915_GEM_GET_TILING ioctl
returned -ENOENT from i915_gem_get_tiling function (drivers/gpu/drm/i915/i915_gem_tiling.c):

 /**
 * Returns the current tiling mode and required bit 6 swizzling for the object.
 */
int
i915_gem_get_tiling(struct drm_device *dev, void *data,
		   struct drm_file *file)
{
	struct drm_i915_gem_get_tiling *args = data;
	struct drm_i915_private *dev_priv = dev->dev_private;
	struct drm_i915_gem_object *obj;

	obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
	if (&obj->base == NULL)
		return -ENOENT;


This ioctl is being called in libdrm in function drm_intel_bo_gem_create_from_prime:

	get_tiling.handle = bo_gem->gem_handle;
	ret = drmIoctl(bufmgr_gem->fd,
		       DRM_IOCTL_I915_GEM_GET_TILING,
		       &get_tiling);
	if (ret != 0) {
		drm_intel_gem_bo_unreference(&bo_gem->bo);
		return NULL;
	}

[1] http://lists.freedesktop.org/archives/intel-gfx/2014-September/052586.html

-- 
jacek



More information about the Intel-gfx mailing list