All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: unify partial/normal page insertion loops
@ 2016-03-15 16:05 Matthew Auld
  2016-03-15 16:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2016-03-15 16:33 ` [PATCH] " Chris Wilson
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Auld @ 2016-03-15 16:05 UTC (permalink / raw)
  To: intel-gfx

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 40 ++++++++++++++++------------------------
 1 file changed, 16 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index b854af2..13ce2bf 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1798,6 +1798,7 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	unsigned long pfn;
 	int ret = 0;
 	bool write = !!(vmf->flags & FAULT_FLAG_WRITE);
+	unsigned long base, size;
 
 	intel_runtime_pm_get(dev_priv);
 
@@ -1859,17 +1860,25 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 		i915_gem_obj_ggtt_offset_view(obj, &view);
 	pfn >>= PAGE_SHIFT;
 
+	base = vma->vm_start;
+
 	if (unlikely(view.type == I915_GGTT_VIEW_PARTIAL)) {
+		base += view.params.partial.offset << PAGE_SHIFT;
+		size = view.params.partial.size;
+	} else {
+		size = min_t(unsigned long, vma->vm_end - vma->vm_start,
+			     obj->base.size) >> PAGE_SHIFT;
+	}
+
+	if (!obj->fault_mappable || view.type == I915_GGTT_VIEW_PARTIAL) {
+		unsigned long i;
+
 		/* Overriding existing pages in partial view does not cause
 		 * us any trouble as TLBs are still valid because the fault
 		 * is due to userspace losing part of the mapping or never
 		 * having accessed it before (at this partials' range).
 		 */
-		unsigned long base = vma->vm_start +
-				     (view.params.partial.offset << PAGE_SHIFT);
-		unsigned int i;
-
-		for (i = 0; i < view.params.partial.size; i++) {
+		for (i = 0; i < size; i++) {
 			ret = vm_insert_pfn(vma, base + i * PAGE_SIZE, pfn + i);
 			if (ret)
 				break;
@@ -1877,25 +1886,8 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 
 		obj->fault_mappable = true;
 	} else {
-		if (!obj->fault_mappable) {
-			unsigned long size = min_t(unsigned long,
-						   vma->vm_end - vma->vm_start,
-						   obj->base.size);
-			int i;
-
-			for (i = 0; i < size >> PAGE_SHIFT; i++) {
-				ret = vm_insert_pfn(vma,
-						    (unsigned long)vma->vm_start + i * PAGE_SIZE,
-						    pfn + i);
-				if (ret)
-					break;
-			}
-
-			obj->fault_mappable = true;
-		} else
-			ret = vm_insert_pfn(vma,
-					    (unsigned long)vmf->virtual_address,
-					    pfn + page_offset);
+		ret = vm_insert_pfn(vma, (unsigned long)vmf->virtual_address,
+				    pfn + page_offset);
 	}
 unpin:
 	i915_gem_object_ggtt_unpin_view(obj, &view);
-- 
2.4.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: unify partial/normal page insertion loops
  2016-03-15 16:05 [PATCH] drm/i915: unify partial/normal page insertion loops Matthew Auld
@ 2016-03-15 16:32 ` Patchwork
  2016-03-15 16:33 ` [PATCH] " Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-03-15 16:32 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: unify partial/normal page insertion loops
URL   : https://patchwork.freedesktop.org/series/4476/
State : failure

== Summary ==

Series 4476v1 drm/i915: unify partial/normal page insertion loops
http://patchwork.freedesktop.org/api/1.0/series/4476/revisions/1/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-dpms:
                pass       -> DMESG-WARN (hsw-brixbox)
        Subgroup basic-flip-vs-wf_vblank:
                dmesg-warn -> PASS       (hsw-brixbox)
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-c:
                fail       -> PASS       (hsw-brixbox)
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (skl-nuci5)
Test pm_rpm:
        Subgroup basic-pci-d3-state:
                pass       -> DMESG-WARN (bsw-nuc-2)

bdw-ultra        total:194  pass:173  dwarn:0   dfail:0   fail:0   skip:21 
bsw-nuc-2        total:194  pass:156  dwarn:1   dfail:0   fail:0   skip:37 
hsw-brixbox      total:194  pass:171  dwarn:1   dfail:0   fail:0   skip:22 
hsw-gt2          total:194  pass:177  dwarn:0   dfail:0   fail:0   skip:17 
ivb-t430s        total:194  pass:169  dwarn:0   dfail:0   fail:0   skip:25 
skl-i5k-2        total:194  pass:171  dwarn:0   dfail:0   fail:0   skip:23 
skl-i7k-2        total:194  pass:171  dwarn:0   dfail:0   fail:0   skip:23 
skl-nuci5        total:194  pass:183  dwarn:0   dfail:0   fail:0   skip:11 
snb-dellxps      total:194  pass:159  dwarn:1   dfail:0   fail:0   skip:34 

Results at /archive/results/CI_IGT_test/Patchwork_1605/

fc881ebd9c3c26919c7d1113f8bf7014e1a05563 drm-intel-nightly: 2016y-03m-15d-13h-10m-41s UTC integration manifest
ec4aa8c47920d5aacf5b35e9237de07d092d3ef5 drm/i915: unify partial/normal page insertion loops

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: unify partial/normal page insertion loops
  2016-03-15 16:05 [PATCH] drm/i915: unify partial/normal page insertion loops Matthew Auld
  2016-03-15 16:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2016-03-15 16:33 ` Chris Wilson
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2016-03-15 16:33 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

On Tue, Mar 15, 2016 at 04:05:58PM +0000, Matthew Auld wrote:
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>

I know I sent patches to make this even simpler than what you present
here, and that *fix* *actual* *bugs* in the partial VMA code.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-15 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15 16:05 [PATCH] drm/i915: unify partial/normal page insertion loops Matthew Auld
2016-03-15 16:32 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-03-15 16:33 ` [PATCH] " Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.