Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P431
dmabuf dtype drm patch
Active
Public
Actions
Authored by
val_packett.cool
on Oct 2 2020, 10:58 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F9467124: dmabuf dtype drm patch
Oct 2 2020, 10:58 AM
2020-10-02 10:58:42 (UTC+0)
Subscribers
None
diff --git i/drivers/dma-buf/dma-buf.c w/drivers/dma-buf/dma-buf.c
index 9460e1024..7176f45f6 100644
--- i/drivers/dma-buf/dma-buf.c
+++ w/drivers/dma-buf/dma-buf.c
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <sys/file.h>
#include <sys/filio.h>
#include <sys/unistd.h>
+#include <sys/user.h>
#include <sys/capsicum.h>
#include <vm/vm.h>
@@ -58,6 +59,14 @@ __FBSDID("$FreeBSD$");
#undef file
#undef fget
+#ifndef DTYPE_DMABUF
+#define DTYPE_DMABUF 15
+#endif
+
+#ifndef KF_TYPE_DMABUF
+#define KF_TYPE_DMABUF 13
+#endif
+
struct db_list {
struct list_head head;
struct sx lock;
@@ -85,9 +94,6 @@ struct fileops dma_buf_fileops = {
.fo_flags = DFLAG_PASSABLE|DFLAG_SEEKABLE,
};
-/* XXX */
-#define DTYPE_DMABUF 100
-
#define fp_is_db(fp) ((fp)->f_ops == &dma_buf_fileops)
static int
@@ -131,8 +137,18 @@ static int
dma_buf_fill_kinfo(struct file *fp, struct kinfo_file *kif,
struct filedesc *fdp __unused)
{
+ struct dma_buf *db;
+
+ if (!fp_is_db(fp))
+ return (EINVAL);
+
+ db = fp->f_data;
+
+ kif->kf_type = KF_TYPE_DMABUF;
+ kif->kf_un.kf_dmabuf.kf_dmabuf_size = db->size;
+ strlcpy(kif->kf_un.kf_dmabuf.kf_dmabuf_exp_name, db->exp_name,
+ sizeof(kif->kf_un.kf_dmabuf.kf_dmabuf_exp_name));
- /* XXX pass this on to stat */
return (0);
}
Event Timeline
val_packett.cool
created this paste.
Oct 2 2020, 10:58 AM
2020-10-02 10:58:42 (UTC+0)
val_packett.cool
created this object in space
S1 Global
.
val_packett.cool
mentioned this in
D26642: Add DTYPE/KF_TYPE and procstat support for dma-buf
.
Oct 2 2020, 11:23 AM
2020-10-02 11:23:10 (UTC+0)
Log In to Comment