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 Translate sg_pcopy_to_bu...



details:   https://anonhg.NetBSD.org/src/rev/1b8f82782d4f
branches:  trunk
changeset: 992650:1b8f82782d4f
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 07:22:38 2018 +0000

description:
Translate sg_pcopy_to_buffer to ubc_uiomove.

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/intel_guc_loader.c |  23 ++++++++++++++++-
 1 files changed, 21 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r 07f6b8ec8f40 -r 1b8f82782d4f sys/external/bsd/drm2/dist/drm/i915/intel_guc_loader.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_guc_loader.c    Mon Aug 27 07:22:27 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_guc_loader.c    Mon Aug 27 07:22:38 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intel_guc_loader.c,v 1.3 2018/08/27 07:22:27 riastradh Exp $   */
+/*     $NetBSD: intel_guc_loader.c,v 1.4 2018/08/27 07:22:38 riastradh Exp $   */
 
 /*
  * Copyright © 2014 Intel Corporation
@@ -29,7 +29,7 @@
  *    Alex Dai <yu.dai%intel.com@localhost>
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intel_guc_loader.c,v 1.3 2018/08/27 07:22:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intel_guc_loader.c,v 1.4 2018/08/27 07:22:38 riastradh Exp $");
 
 #include <linux/firmware.h>
 #include <linux/module.h>
@@ -243,7 +243,12 @@
        struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw;
        struct drm_i915_gem_object *fw_obj = guc_fw->guc_fw_obj;
        unsigned long offset;
+#ifdef __NetBSD__
+       struct iovec iov;
+       struct uio uio;
+#else
        struct sg_table *sg = fw_obj->pages;
+#endif
        u32 status, ucode_size, rsa[UOS_RSA_SIG_SIZE / sizeof(u32)];
        int i, ret = 0;
 
@@ -252,7 +257,21 @@
        I915_WRITE(DMA_COPY_SIZE, ucode_size);
 
        /* Copy RSA signature from the fw image to HW for verification */
+#ifdef __NetBSD__
+       iov.iov_base = rsa;
+       iov.iov_len = UOS_RSA_SIG_SIZE;
+       uio.uio_iov = &iov;
+       uio.uio_iovcnt = 1;
+       uio.uio_resid = UOS_RSA_SIG_SIZE;
+       uio.uio_rw = UIO_READ;
+       /* XXX errno NetBSD->Linux */
+       ret = -ubc_uiomove(fw_obj->base.filp, &uio, UOS_RSA_SIG_SIZE,
+           UVM_ADV_NORMAL, UBC_READ);
+       if (ret)
+               return ret;
+#else
        sg_pcopy_to_buffer(sg->sgl, sg->nents, rsa, UOS_RSA_SIG_SIZE, offset);
+#endif
        for (i = 0; i < UOS_RSA_SIG_SIZE / sizeof(u32); i++)
                I915_WRITE(UOS_RSA_SCRATCH(i), rsa[i]);
 



Home | Main Index | Thread Index | Old Index