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 drm_vma_manager deals in struct drm_fi...
details: https://anonhg.NetBSD.org/src/rev/640f1d3f7f8a
branches: trunk
changeset: 1027871:640f1d3f7f8a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Sun Dec 19 01:02:02 2021 +0000
description:
drm_vma_manager deals in struct drm_file, not struct file, now.
Kinda inconvenient because it means we'll need to patch
filp->private_data with filp->f_data in various places...
diffstat:
sys/external/bsd/drm2/drm/drm_vma_manager.c | 16 +++++++++-------
sys/external/bsd/drm2/include/drm/drm_vma_manager.h | 15 +++++++++------
2 files changed, 18 insertions(+), 13 deletions(-)
diffs (108 lines):
diff -r 5dd1084b2503 -r 640f1d3f7f8a sys/external/bsd/drm2/drm/drm_vma_manager.c
--- a/sys/external/bsd/drm2/drm/drm_vma_manager.c Sun Dec 19 01:01:42 2021 +0000
+++ b/sys/external/bsd/drm2/drm/drm_vma_manager.c Sun Dec 19 01:02:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_vma_manager.c,v 1.5 2016/11/19 17:19:59 maya Exp $ */
+/* $NetBSD: drm_vma_manager.c,v 1.6 2021/12/19 01:02:02 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_vma_manager.c,v 1.5 2016/11/19 17:19:59 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_vma_manager.c,v 1.6 2021/12/19 01:02:02 riastradh Exp $");
#include <sys/kmem.h>
#include <sys/rbtree.h>
@@ -88,7 +88,7 @@
drm_vma_file_compare_key(void *cookie __unused, const void *vf, const void *vk)
{
const struct drm_vma_offset_file *const f = vf;
- const struct file *const k = vk;
+ const struct drm_file *const k = vk;
if (f->vof_file < k)
return -1;
@@ -264,7 +264,7 @@
}
int
-drm_vma_node_allow(struct drm_vma_offset_node *node, struct file *file)
+drm_vma_node_allow(struct drm_vma_offset_node *node, struct drm_file *file)
{
struct drm_vma_offset_file *new, *old;
@@ -284,7 +284,7 @@
}
void
-drm_vma_node_revoke(struct drm_vma_offset_node *node, struct file *file)
+drm_vma_node_revoke(struct drm_vma_offset_node *node, struct drm_file *file)
{
rw_enter(&node->von_lock, RW_WRITER);
@@ -298,7 +298,8 @@
}
bool
-drm_vma_node_is_allowed(struct drm_vma_offset_node *node, struct file *file)
+drm_vma_node_is_allowed(struct drm_vma_offset_node *node,
+ struct drm_file *file)
{
rw_enter(&node->von_lock, RW_READER);
@@ -310,7 +311,8 @@
}
int
-drm_vma_node_verify_access(struct drm_vma_offset_node *node, struct file *file)
+drm_vma_node_verify_access(struct drm_vma_offset_node *node,
+ struct drm_file *file)
{
if (!drm_vma_node_is_allowed(node, file))
diff -r 5dd1084b2503 -r 640f1d3f7f8a sys/external/bsd/drm2/include/drm/drm_vma_manager.h
--- a/sys/external/bsd/drm2/include/drm/drm_vma_manager.h Sun Dec 19 01:01:42 2021 +0000
+++ b/sys/external/bsd/drm2/include/drm/drm_vma_manager.h Sun Dec 19 01:02:02 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_vma_manager.h,v 1.1 2014/07/16 20:56:25 riastradh Exp $ */
+/* $NetBSD: drm_vma_manager.h,v 1.2 2021/12/19 01:02:02 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -38,6 +38,8 @@
#include <sys/rwlock.h>
#include <sys/vmem.h>
+struct drm_file;
+
struct drm_vma_offset_manager {
krwlock_t vom_lock;
struct rb_tree vom_nodes;
@@ -77,7 +79,7 @@
}
struct drm_vma_offset_file {
- struct file *vof_file;
+ struct drm_file *vof_file;
struct rb_node vof_rb_node;
};
@@ -108,10 +110,11 @@
drm_vma_offset_exact_lookup(struct drm_vma_offset_manager *,
unsigned long, unsigned long);
-int drm_vma_node_allow(struct drm_vma_offset_node *, struct file *);
-void drm_vma_node_revoke(struct drm_vma_offset_node *, struct file *);
-bool drm_vma_node_is_allowed(struct drm_vma_offset_node *, struct file *);
+int drm_vma_node_allow(struct drm_vma_offset_node *, struct drm_file *);
+void drm_vma_node_revoke(struct drm_vma_offset_node *, struct drm_file *);
+bool drm_vma_node_is_allowed(struct drm_vma_offset_node *,
+ struct drm_file *);
int drm_vma_node_verify_access(struct drm_vma_offset_node *,
- struct file *);
+ struct drm_file *);
#endif /* _DRM_DRM_VMA_MANAGER_H_ */
Home |
Main Index |
Thread Index |
Old Index