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 Use kcopy, not memcpy, i...



details:   https://anonhg.NetBSD.org/src/rev/7ba6ee9c8c32
branches:  trunk
changeset: 993009:7ba6ee9c8c32
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:46:10 2018 +0000

description:
Use kcopy, not memcpy, in case of failure to page in dst.  From chs@.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 35e3f2776744 -r 7ba6ee9c8c32 sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c     Mon Aug 27 14:45:57 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c     Mon Aug 27 14:46:10 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_cmd_parser.c,v 1.14 2018/08/27 14:45:57 riastradh Exp $   */
+/*     $NetBSD: i915_cmd_parser.c,v 1.15 2018/08/27 14:46:10 riastradh Exp $   */
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.14 2018/08/27 14:45:57 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.15 2018/08/27 14:46:10 riastradh Exp $");
 
 #include "i915_drv.h"
 
@@ -983,7 +983,15 @@
        if (needs_clflush)
                drm_clflush_virt_range(src, batch_len);
 
+#ifdef __NetBSD__
+       ret = -kcopy(dst, src, batch_len);
+       if (ret) {
+               uvm_unmap(kernel_map, dstva, dstva + dstlen);
+               goto unmap_src;
+       }
+#else
        memcpy(dst, src, batch_len);
+#endif
 
 unmap_src:
 #ifdef __NetBSD__



Home | Main Index | Thread Index | Old Index