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 bring in old drm changes
details: https://anonhg.NetBSD.org/src/rev/10942520915c
branches: trunk
changeset: 992403:10942520915c
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 27 06:07:58 2018 +0000
description:
bring in old drm changes
panic(XXX) out parts that need attention
Author: coypu <coypu%sdf.org@localhost>
Committer: Taylor R Campbell <riastradh%NetBSD.org@localhost>
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem.c | 24 +++++++++++++++--
sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c | 10 ++++++-
2 files changed, 29 insertions(+), 5 deletions(-)
diffs (129 lines):
diff -r f6db699cb33f -r 10942520915c sys/external/bsd/drm2/dist/drm/i915/i915_gem.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Mon Aug 27 06:07:44 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem.c Mon Aug 27 06:07:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem.c,v 1.36 2018/08/27 04:58:23 riastradh Exp $ */
+/* $NetBSD: i915_gem.c,v 1.37 2018/08/27 06:07:58 riastradh Exp $ */
/*
* Copyright © 2008-2015 Intel Corporation
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.36 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem.c,v 1.37 2018/08/27 06:07:58 riastradh Exp $");
#ifdef __NetBSD__
#if 0 /* XXX uvmhist option? */
@@ -1945,8 +1945,11 @@
if (args->flags & ~(I915_MMAP_WC))
return -EINVAL;
+#if 0
+ /* XXX cpu_has_pat == CPUID_PAT, do we care to do this check */
if (args->flags & I915_MMAP_WC && !cpu_has_pat)
return -ENODEV;
+#endif
obj = drm_gem_object_lookup(dev, file, args->handle);
if (obj == NULL)
@@ -2602,6 +2605,9 @@
static void
i915_gem_object_invalidate(struct drm_i915_gem_object *obj)
{
+#ifdef __NetBSD__
+ panic("XXX");
+#else
struct address_space *mapping;
switch (obj->madv) {
@@ -2616,6 +2622,7 @@
mapping = file_inode(obj->base.filp)->i_mapping,
invalidate_mapping_pages(mapping, 0, (loff_t)-1);
+#endif
}
#ifdef __NetBSD__
@@ -5034,6 +5041,9 @@
static bool discard_backing_storage(struct drm_i915_gem_object *obj)
{
+#ifdef __NetBSD__
+ panic("XXX");
+#else
/* If we are the last user of the backing storage (be it shmemfs
* pages or stolen etc), we know that the pages are going to be
* immediately released. In this case, we can then skip copying
@@ -5054,6 +5064,7 @@
* freeing the object.
*/
return atomic_long_read(&obj->base.filp->f_count) == 1;
+#endif
}
void i915_gem_free_object(struct drm_gem_object *gem_obj)
@@ -5644,8 +5655,11 @@
dev_priv->mm.interruptible = true;
i915_gem_shrinker_init(dev_priv);
-
+#ifdef __NetBSD__
+ linux_mutex_init(&dev_priv->fb_tracking.lock);
+#else
mutex_init(&dev_priv->fb_tracking.lock);
+#endif
}
void i915_gem_release(struct drm_device *dev, struct drm_file *file)
@@ -5842,6 +5856,9 @@
i915_gem_object_create_from_data(struct drm_device *dev,
const void *data, size_t size)
{
+#ifdef __NetBSD__
+ panic("XXX");
+#else
struct drm_i915_gem_object *obj;
struct sg_table *sg;
size_t bytes;
@@ -5875,4 +5892,5 @@
fail:
drm_gem_object_unreference(&obj->base);
return ERR_PTR(ret);
+#endif
}
diff -r f6db699cb33f -r 10942520915c sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c Mon Aug 27 06:07:44 2018 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_context.c Mon Aug 27 06:07:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i915_gem_context.c,v 1.7 2018/08/27 04:58:23 riastradh Exp $ */
+/* $NetBSD: i915_gem_context.c,v 1.8 2018/08/27 06:07:58 riastradh Exp $ */
/*
* Copyright © 2011-2012 Intel Corporation
@@ -88,7 +88,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.7 2018/08/27 04:58:23 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i915_gem_context.c,v 1.8 2018/08/27 06:07:58 riastradh Exp $");
#include <linux/err.h>
#include <drm/drmP.h>
@@ -966,9 +966,15 @@
case I915_CONTEXT_PARAM_BAN_PERIOD:
if (args->size)
ret = -EINVAL;
+#ifdef __NetBSD__
+ else if (args->value < ctx->hang_stats.ban_period_seconds &&
+ !DRM_SUSER())
+ ret = -EPERM;
+#else
else if (args->value < ctx->hang_stats.ban_period_seconds &&
!capable(CAP_SYS_ADMIN))
ret = -EPERM;
+#endif
else
ctx->hang_stats.ban_period_seconds = args->value;
break;
Home |
Main Index |
Thread Index |
Old Index