int i915_gem_object_pwrite_phys(struct drm_i915_gem_object *obj,
const struct drm_i915_gem_pwrite *args)
{
+#ifdef __linux__
void *vaddr = sg_page(obj->mm.pages->sgl) + args->offset;
+#else
+ struct drm_dmamem *dmah = (void *)sg_page(obj->mm.pages->sgl);
+ void *vaddr = dmah->kva + args->offset;
+#endif
char __user *user_data = u64_to_user_ptr(args->data_ptr);
struct drm_i915_private *i915 = to_i915(obj->base.dev);
int err;
int i915_gem_object_pread_phys(struct drm_i915_gem_object *obj,
const struct drm_i915_gem_pread *args)
{
+#ifdef __linux__
void *vaddr = sg_page(obj->mm.pages->sgl) + args->offset;
+#else
+ struct drm_dmamem *dmah = (void *)sg_page(obj->mm.pages->sgl);
+ void *vaddr = dmah->kva + args->offset;
+#endif
char __user *user_data = u64_to_user_ptr(args->data_ptr);
int err;