Module Name: src
Committed By: riastradh
Date: Sun Dec 19 01:14:29 UTC 2021
Modified Files:
src/sys/external/bsd/drm2/include/linux: dma-buf.h
src/sys/external/bsd/drm2/linux: linux_dma_buf.c
Log Message:
Update dma-buf API enough to compile drm_prime.c.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/include/linux/dma-buf.h
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/drm2/linux/linux_dma_buf.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/dma-buf.h
diff -u src/sys/external/bsd/drm2/include/linux/dma-buf.h:1.4 src/sys/external/bsd/drm2/include/linux/dma-buf.h:1.5
--- src/sys/external/bsd/drm2/include/linux/dma-buf.h:1.4 Mon Aug 27 15:25:13 2018
+++ src/sys/external/bsd/drm2/include/linux/dma-buf.h Sun Dec 19 01:14:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: dma-buf.h,v 1.4 2018/08/27 15:25:13 riastradh Exp $ */
+/* $NetBSD: dma-buf.h,v 1.5 2021/12/19 01:14:29 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -57,8 +57,7 @@ enum dma_data_direction {
};
struct dma_buf_ops {
- int (*attach)(struct dma_buf *, struct device *,
- struct dma_buf_attachment *);
+ int (*attach)(struct dma_buf *, struct dma_buf_attachment *);
void (*detach)(struct dma_buf *, struct dma_buf_attachment *);
struct sg_table *
(*map_dma_buf)(struct dma_buf_attachment *,
@@ -70,10 +69,8 @@ struct dma_buf_ops {
enum dma_data_direction);
int (*end_cpu_access)(struct dma_buf *, size_t, size_t,
enum dma_data_direction);
- void * (*kmap_atomic)(struct dma_buf *, unsigned long);
- void (*kunmap_atomic)(struct dma_buf *, unsigned long, void *);
- void * (*kmap)(struct dma_buf *, unsigned long);
- void (*kunmap)(struct dma_buf *, unsigned long, void *);
+ void * (*map)(struct dma_buf *, unsigned long);
+ void (*unmap)(struct dma_buf *, unsigned long, void *);
int (*mmap)(struct dma_buf *, off_t *, size_t, int, int *,
int *, struct uvm_object **, int *);
void * (*vmap)(struct dma_buf *);
@@ -95,6 +92,7 @@ struct dma_buf {
struct dma_buf_attachment {
void *priv;
struct dma_buf *dmabuf;
+ struct device *dev;
};
struct dma_buf_export_info {
Index: src/sys/external/bsd/drm2/linux/linux_dma_buf.c
diff -u src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.7 src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.8
--- src/sys/external/bsd/drm2/linux/linux_dma_buf.c:1.7 Sun Dec 19 00:30:25 2021
+++ src/sys/external/bsd/drm2/linux/linux_dma_buf.c Sun Dec 19 01:14:29 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_dma_buf.c,v 1.7 2021/12/19 00:30:25 riastradh Exp $ */
+/* $NetBSD: linux_dma_buf.c,v 1.8 2021/12/19 01:14:29 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.7 2021/12/19 00:30:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_dma_buf.c,v 1.8 2021/12/19 01:14:29 riastradh Exp $");
#include <sys/types.h>
#include <sys/atomic.h>
@@ -184,10 +184,11 @@ dma_buf_attach(struct dma_buf *dmabuf, s
attach = kmem_zalloc(sizeof(*attach), KM_SLEEP);
attach->dmabuf = dmabuf;
+ attach->dev = dev;
mutex_enter(&dmabuf->db_lock);
if (dmabuf->ops->attach)
- ret = dmabuf->ops->attach(dmabuf, dev, attach);
+ ret = dmabuf->ops->attach(dmabuf, attach);
mutex_exit(&dmabuf->db_lock);
if (ret)
goto fail0;