Commit 33166482 authored by Chris Wilson's avatar Chris Wilson Committed by Sasha Levin

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

[ Upstream commit 5f12b80a ]

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=97519Signed-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.ukSigned-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent d7633e23
...@@ -2006,21 +2006,19 @@ struct drm_i915_gem_object { ...@@ -2006,21 +2006,19 @@ struct drm_i915_gem_object {
/** Record of address bit 17 of each page at last unbind. */ /** Record of address bit 17 of each page at last unbind. */
unsigned long *bit_17; unsigned long *bit_17;
union { struct i915_gem_userptr {
/** for phy allocated objects */ uintptr_t ptr;
struct drm_dma_handle *phys_handle; unsigned read_only :1;
unsigned workers :4;
struct i915_gem_userptr {
uintptr_t ptr;
unsigned read_only :1;
unsigned workers :4;
#define I915_GEM_USERPTR_MAX_WORKERS 15 #define I915_GEM_USERPTR_MAX_WORKERS 15
struct i915_mm_struct *mm; struct i915_mm_struct *mm;
struct i915_mmu_object *mmu_object; struct i915_mmu_object *mmu_object;
struct work_struct *work; struct work_struct *work;
} userptr; } userptr;
};
/** for phys allocated objects */
struct drm_dma_handle *phys_handle;
}; };
#define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base) #define to_intel_bo(x) container_of(x, struct drm_i915_gem_object, base)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment