*/
unsigned int madv:2;
- /**
- * Current tiling mode for the object.
- */
- unsigned int tiling_mode:2;
/**
* Whether the tiling parameters for the currently associated fence
* register have changed. Note that for the purposes of tracking
atomic_t frontbuffer_bits;
+ /**
+ * Current tiling mode for the object.
+ */
+ unsigned int tiling_mode;
+
+ /** Current tiling stride for the object, if it's tiled. */
+ uint32_t stride;
+
unsigned int has_wc_mmap;
/** Count of VMA actually bound by this object */
unsigned int bind_count;
struct i915_gem_active last_write;
struct i915_gem_active last_fence;
- /** Current tiling stride for the object, if it's tiled. */
- uint32_t stride;
-
/** References from framebuffers, locks out tiling changes. */
unsigned long framebuffer_references;
if (!obj)
return -ENOENT;
- mutex_lock(&dev->struct_mutex);
-
- args->tiling_mode = obj->tiling_mode;
- switch (obj->tiling_mode) {
+ args->tiling_mode = READ_ONCE(obj->tiling_mode);
+ switch (args->tiling_mode) {
case I915_TILING_X:
args->swizzle_mode = dev_priv->mm.bit_6_swizzle_x;
break;
if (args->swizzle_mode == I915_BIT_6_SWIZZLE_9_10_17)
args->swizzle_mode = I915_BIT_6_SWIZZLE_9_10;
- i915_gem_object_put(obj);
- mutex_unlock(&dev->struct_mutex);
-
+ i915_gem_object_put_unlocked(obj);
return 0;
}