Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f12b80a authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Unalias obj->phys_handle and obj->userptr

We use obj->phys_handle to choose the pread/pwrite path, but as
obj->phys_handle is a union with obj->userptr, we then mistakenly use
the phys_handle path for userptr objects within pread/pwrite.

Testcase: igt/gem_userptr_blits/forbidden-operations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97519


Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20161003124516.12388-2-chris@chris-wilson.co.uk
parent dda96033
Loading
Loading
Loading
Loading
+11 −13
Original line number Diff line number Diff line
@@ -2281,10 +2281,6 @@ struct drm_i915_gem_object {
	/** Record of address bit 17 of each page at last unbind. */
	unsigned long *bit_17;

	union {
		/** for phy allocated objects */
		struct drm_dma_handle *phys_handle;

	struct i915_gem_userptr {
		uintptr_t ptr;
		unsigned read_only :1;
@@ -2295,7 +2291,9 @@ struct drm_i915_gem_object {
		struct i915_mmu_object *mmu_object;
		struct work_struct *work;
	} userptr;
	};

	/** for phys allocated objects */
	struct drm_dma_handle *phys_handle;
};

static inline struct drm_i915_gem_object *