Message ID | 1420196370-13433-3-git-send-email-akash.goel@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Tested-By: PRC QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
-------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -1 363/364 362/364
ILK -18 364/366 346/366
SNB +3-1 443/450 445/450
IVB 496/498 496/498
BYT 288/289 288/289
HSW +5-4 542/564 543/564
BDW 415/417 415/417
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*PNV igt_gem_exec_big PASS(2, M25M23) FAIL(1, M23)
ILK igt_kms_flip_nonexisting-fb DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_rcs-flip-vs-panning-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_rcs-wf_vblank-vs-dpms-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_render_direct-render DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_bcs-flip-vs-modeset-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_blocking-absolute-wf_vblank-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_busy-flip-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_flip-vs-dpms-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_flip-vs-panning DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_flip-vs-rmfb-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_plain-flip-fb-recreate-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_plain-flip-ts-check-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_rcs-flip-vs-dpms DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_rcs-flip-vs-modeset DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_rcs-flip-vs-panning DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_vblank-vs-hang DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_wf_vblank-ts-check DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
ILK igt_kms_flip_wf_vblank-vs-modeset-interruptible DMESG_WARN(1, M26)PASS(1, M37) DMESG_WARN(1, M26)
*SNB igt_kms_flip_dpms-vs-vblank-race DMESG_WARN(2, M35M22) PASS(1, M22)
*SNB igt_kms_flip_dpms-vs-vblank-race-interruptible DMESG_WARN(2, M35M22) PASS(1, M22)
SNB igt_kms_flip_modeset-vs-vblank-race-interruptible DMESG_WARN(2, M35M22)PASS(1, M35) DMESG_WARN(1, M22)
SNB igt_kms_plane_plane-position-hole-pipe-B-plane-1 DMESG_WARN(1, M35)PASS(2, M35M22) PASS(1, M22)
*HSW igt_kms_flip_flip-vs-dpms-off-vs-modeset-interruptible DMESG_WARN(2, M40M19) PASS(1, M19)
*HSW igt_kms_flip_single-buffer-flip-vs-dpms-off-vs-modeset PASS(3, M40M19) DMESG_WARN(1, M19)
HSW igt_kms_flip_single-buffer-flip-vs-dpms-off-vs-modeset-interruptible DMESG_WARN(1, M40)PASS(1, M19) PASS(1, M19)
HSW igt_kms_plane_plane-panning-bottom-right-pipe-C-plane-1 TIMEOUT(2, M40)PASS(1, M19) PASS(1, M19)
*HSW igt_kms_plane_plane-panning-top-left-pipe-B-plane-2 PASS(2, M40M19) DMESG_FAIL(1, M19)
*HSW igt_kms_plane_plane-position-hole-pipe-B-plane-1 PASS(2, M40M19) DMESG_WARN(1, M19)
*HSW igt_kms_plane_plane-position-hole-pipe-B-plane-2 PASS(2, M40M19) TIMEOUT(1, M19)
*HSW igt_pm_rpm_modeset-non-lpsp-stress-no-wait NSPT(1, M19)DMESG_WARN(1, M40)PASS(1, M40) PASS(1, M19)
HSW igt_kms_flip_flip-vs-rmfb DMESG_WARN(1, M40)PASS(1, M19) PASS(1, M19)
Note: You need to pay more attention to line start with '*'
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 52730ed..7fad6b8 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -143,6 +143,9 @@ static int i915_getparam(struct drm_device *dev, void *data, case I915_PARAM_HAS_COHERENT_PHYS_GTT: value = 1; break; + case I915_PARAM_MMAP_VERSION: + value = 1; + break; default: DRM_DEBUG("Unknown parameter %d\n", param->param); return -EINVAL; diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index ef4e424..aeeb617 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1549,6 +1549,12 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, struct drm_gem_object *obj; unsigned long addr; + if (args->flags & ~(I915_MMAP_WC)) + return -EINVAL; + + if (args->flags & I915_MMAP_WC && !cpu_has_pat) + return -ENODEV; + obj = drm_gem_object_lookup(dev, file, args->handle); if (obj == NULL) return -ENOENT; @@ -1564,6 +1570,19 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, addr = vm_mmap(obj->filp, 0, args->size, PROT_READ | PROT_WRITE, MAP_SHARED, args->offset); + if (args->flags & I915_MMAP_WC) { + struct mm_struct *mm = current->mm; + struct vm_area_struct *vma; + + down_write(&mm->mmap_sem); + vma = find_vma(mm, addr); + if (vma) + vma->vm_page_prot = + pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); + else + addr = -ENOMEM; + up_write(&mm->mmap_sem); + } drm_gem_object_unreference_unlocked(obj); if (IS_ERR((void *)addr)) return addr; diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 2502622..c155a03 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -341,6 +341,7 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_WT 27 #define I915_PARAM_CMD_PARSER_VERSION 28 #define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 +#define I915_PARAM_MMAP_VERSION 30 typedef struct drm_i915_getparam { int param; @@ -488,6 +489,14 @@ struct drm_i915_gem_mmap { * This is a fixed-size type for 32/64 compatibility. */ __u64 addr_ptr; + + /** + * Flags for extended behaviour. + * + * Added in version 2. + */ + __u64 flags; +#define I915_MMAP_WC 0x1 }; struct drm_i915_gem_mmap_gtt {