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 drm/i915: Misc build fixes.
details: https://anonhg.NetBSD.org/src/rev/28cddcbe531e
branches: trunk
changeset: 1028615:28cddcbe531e
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 11:27:20 2021 +0000
description:
drm/i915: Misc build fixes.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c | 20 +++++++++++--
sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c | 8 ++--
sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c | 6 ++-
3 files changed, 24 insertions(+), 10 deletions(-)
diffs (134 lines):
diff -r 0df0fca46693 -r 28cddcbe531e sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c Sun Dec 19 11:27:12 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_context.c Sun Dec 19 11:27:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem_context.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */
+/* $NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $ */
/*
* SPDX-License-Identifier: MIT
@@ -67,11 +67,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $");
#include <linux/log2.h>
#include <linux/nospec.h>
+#include <asm/uaccess.h>
+
#include <drm/i915_drm.h>
#include "gt/gen6_ppgtt.h"
@@ -87,6 +89,8 @@
#include "i915_trace.h"
#include "i915_user_extensions.h"
+#include <linux/nbsd-namespace.h>
+
#define ALL_L3_SLICES(dev) (1 << NUM_L3_SLICES(dev)) - 1
static struct i915_global_gem_context {
@@ -317,7 +321,9 @@
if (ctx->timeline)
intel_timeline_put(ctx->timeline);
+#ifndef __NetBSD__
put_pid(ctx->pid);
+#endif
mutex_destroy(&ctx->mutex);
kfree_rcu(ctx, rcu);
@@ -808,10 +814,11 @@
#else
ctx->pid = get_task_pid(current, PIDTYPE_PID);
#endif
+#ifdef __NetBSD__
snprintf(ctx->name, sizeof(ctx->name), "%s[%d]",
-#ifdef __NetBSD__
- curproc->p_comm, (int)curproc->p_pid));
+ curproc->p_comm, (int)curproc->p_pid);
#else
+ snprintf(ctx->name, sizeof(ctx->name), "%s[%d]",
current->comm, pid_nr(ctx->pid));
#endif
@@ -2233,8 +2240,13 @@
ext_data.fpriv = file->driver_priv;
if (client_is_banned(ext_data.fpriv)) {
+#ifdef __NetBSD__
+ DRM_DEBUG("client %s[%d] banned from creating ctx\n",
+ curproc->p_comm, (int)curproc->p_pid);
+#else
DRM_DEBUG("client %s[%d] banned from creating ctx\n",
current->comm, task_pid_nr(current));
+#endif
return -EIO;
}
diff -r 0df0fca46693 -r 28cddcbe531e sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c
--- a/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c Sun Dec 19 11:27:12 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/gem/i915_gem_dmabuf.c Sun Dec 19 11:27:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem_dmabuf.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $ */
+/* $NetBSD: i915_gem_dmabuf.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $ */
/*
* SPDX-License-Identifier: MIT
@@ -7,7 +7,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_dmabuf.c,v 1.3 2021/12/19 01:24:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_dmabuf.c,v 1.4 2021/12/19 11:27:20 riastradh Exp $");
#include <linux/dma-buf.h>
#include <linux/highmem.h>
@@ -44,7 +44,7 @@
st = drm_prime_pglist_to_sg(&obj->mm.pageq,
obj->base.size >> PAGE_SHIFT);
if (IS_ERR(st))
- goto err_unpin;
+ goto err_unpin_pages;
#else
/* Copy sg so that we make an independent mapping */
st = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
@@ -135,7 +135,7 @@
if (!obj->base.filp)
return -ENODEV;
/* XXX review mmap refcount */
- drm_gem_object_reference(&obj->base);
+ drm_gem_object_get(&obj->base);
*advicep = UVM_ADV_RANDOM;
*uobjp = &obj->base.gemo_uvmobj;
*maxprotp = prot;
diff -r 0df0fca46693 -r 28cddcbe531e sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c Sun Dec 19 11:27:12 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_evict.c Sun Dec 19 11:27:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem_evict.c,v 1.4 2021/12/19 01:24:25 riastradh Exp $ */
+/* $NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $ */
/*
* Copyright © 2008-2010 Intel Corporation
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.4 2021/12/19 01:24:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_evict.c,v 1.5 2021/12/19 11:27:20 riastradh Exp $");
#include <drm/i915_drm.h>
@@ -39,6 +39,8 @@
#include "i915_drv.h"
#include "i915_trace.h"
+#include <linux/nbsd-namespace.h>
+
I915_SELFTEST_DECLARE(static struct igt_evict_ctl {
bool fail_if_busy:1;
} igt_evict_ctl;)
Home |
Main Index |
Thread Index |
Old Index