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 Forgot again to restore ...



details:   https://anonhg.NetBSD.org/src/rev/7765650ea8b8
branches:  trunk
changeset: 366309:7765650ea8b8
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 14:45:57 2018 +0000

description:
Forgot again to restore reference consumed by uvm_map.

Add missing errno comment while here.

diffstat:

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

diffs (44 lines):

diff -r 5d6e16f01d5b -r 7765650ea8b8 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:45 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_cmd_parser.c     Mon Aug 27 14:45:57 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i915_cmd_parser.c,v 1.13 2018/08/27 14:45:31 riastradh Exp $   */
+/*     $NetBSD: i915_cmd_parser.c,v 1.14 2018/08/27 14:45:57 riastradh Exp $   */
 
 /*
  * Copyright © 2013 Intel Corporation
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.13 2018/08/27 14:45:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_cmd_parser.c,v 1.14 2018/08/27 14:45:57 riastradh Exp $");
 
 #include "i915_drv.h"
 
@@ -936,6 +936,8 @@
                DRM_DEBUG_DRIVER("CMD: Failed to vmap batch: %d\n", ret);
                goto unpin_src;
        }
+       /* uvm_map consumes caller's reference on success.  */
+       uao_reference(src_obj->base.filp);
        src_base = (void *)srcva;
 #else
        src_base = vmap_batch(src_obj, batch_start_offset, batch_len);
@@ -957,6 +959,7 @@
        const u32 dstlen = roundup(0 + batch_len, PAGE_SIZE) - dststart;
        vaddr_t dstva = 0;      /* hint */
 
+       /* XXX errno NetBSD->Linux */
        ret = -uvm_map(kernel_map, &dstva, dstlen, dest_obj->base.filp,
            dststart, PAGE_SIZE, UVM_MAPFLAG(UVM_PROT_RW, UVM_PROT_RW,
                UVM_INH_NONE, UVM_ADV_SEQUENTIAL, UVM_FLAG_NOWAIT));
@@ -964,6 +967,8 @@
                DRM_DEBUG_DRIVER("CMD: Failed to vmap shadow batch: %d\n", ret);
                goto unmap_src;
        }
+       /* uvm_map consumes caller's reference on success.  */
+       uao_reference(dest_obj->base.filp);
        dst = (void *)dstva;
 #else
        dst = vmap_batch(dest_obj, 0, batch_len);



Home | Main Index | Thread Index | Old Index