Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Implement i915_gem_objec...



details:   https://anonhg.NetBSD.org/src/rev/e86c7c1e6092
branches:  trunk
changeset: 992655:e86c7c1e6092
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:23:37 2018 +0000

description:
Implement i915_gem_object_invalidate with PGO_DEACTIVATE.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 6dd87a460fc3 -r e86c7c1e6092 sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Mon Aug 27 07:23:22 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c    Mon Aug 27 07:23:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_gem.c,v 1.44 2018/08/27 07:23:22 riastradh Exp $  */
+/*     $NetBSD: i915_gem.c,v 1.45 2018/08/27 07:23:37 riastradh Exp $  */
 
 /*
  * Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.44 2018/08/27 07:23:22 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.45 2018/08/27 07:23:37 riastradh Exp $");
 
 #ifdef __NetBSD__
 #if 0                          /* XXX uvmhist option?  */
@@ -2585,9 +2585,10 @@
 i915_gem_object_invalidate(struct drm_i915_gem_object *obj)
 {
 #ifdef __NetBSD__
-       panic("XXX");
+       struct uvm_object *uobj;
 #else
        struct address_space *mapping;
+#endif
 
        switch (obj->madv) {
        case I915_MADV_DONTNEED:
@@ -2599,6 +2600,12 @@
        if (obj->base.filp == NULL)
                return;
 
+#ifdef __NetBSD__
+       uobj = obj->base.filp;
+       mutex_enter(uobj->vmobjlock);
+       (*uobj->pgops->pgo_put)(uobj, 0, obj->base.size,
+           PGO_ALLPAGES|PGO_DEACTIVATE|PGO_CLEANIT);
+#else
        mapping = file_inode(obj->base.filp)->i_mapping,
        invalidate_mapping_pages(mapping, 0, (loff_t)-1);
 #endif



Home | Main Index | Thread Index | Old Index