Skip to content

Commit 52791ee

Browse files
dma-buf: rename reservation_object to dma_resv
Be more consistent with the naming of the other DMA-buf objects. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/323401/
1 parent 5d344f5 commit 52791ee

104 files changed

Lines changed: 523 additions & 550 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/dma-buf/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-y := dma-buf.o dma-fence.o dma-fence-array.o dma-fence-chain.o \
3-
reservation.o seqno-fence.o
3+
dma-resv.o seqno-fence.o
44
obj-$(CONFIG_SYNC_FILE) += sync_file.o
55
obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o
66
obj-$(CONFIG_UDMABUF) += udmabuf.o

‎drivers/dma-buf/dma-buf.c‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <linux/module.h>
2222
#include <linux/seq_file.h>
2323
#include <linux/poll.h>
24-
#include <linux/reservation.h>
24+
#include <linux/dma-resv.h>
2525
#include <linux/mm.h>
2626
#include <linux/mount.h>
2727
#include <linux/pseudo_fs.h>
@@ -104,8 +104,8 @@ static int dma_buf_release(struct inode *inode, struct file *file)
104104
list_del(&dmabuf->list_node);
105105
mutex_unlock(&db_list.lock);
106106

107-
if (dmabuf->resv == (struct reservation_object *)&dmabuf[1])
108-
reservation_object_fini(dmabuf->resv);
107+
if (dmabuf->resv == (struct dma_resv *)&dmabuf[1])
108+
dma_resv_fini(dmabuf->resv);
109109

110110
module_put(dmabuf->owner);
111111
kfree(dmabuf);
@@ -165,7 +165,7 @@ static loff_t dma_buf_llseek(struct file *file, loff_t offset, int whence)
165165
* To support cross-device and cross-driver synchronization of buffer access
166166
* implicit fences (represented internally in the kernel with &struct fence) can
167167
* be attached to a &dma_buf. The glue for that and a few related things are
168-
* provided in the &reservation_object structure.
168+
* provided in the &dma_resv structure.
169169
*
170170
* Userspace can query the state of these implicitly tracked fences using poll()
171171
* and related system calls:
@@ -195,8 +195,8 @@ static void dma_buf_poll_cb(struct dma_fence *fence, struct dma_fence_cb *cb)
195195
static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
196196
{
197197
struct dma_buf *dmabuf;
198-
struct reservation_object *resv;
199-
struct reservation_object_list *fobj;
198+
struct dma_resv *resv;
199+
struct dma_resv_list *fobj;
200200
struct dma_fence *fence_excl;
201201
__poll_t events;
202202
unsigned shared_count;
@@ -214,7 +214,7 @@ static __poll_t dma_buf_poll(struct file *file, poll_table *poll)
214214
return 0;
215215

216216
rcu_read_lock();
217-
reservation_object_fences(resv, &fence_excl, &fobj, &shared_count);
217+
dma_resv_fences(resv, &fence_excl, &fobj, &shared_count);
218218
if (fence_excl && (!(events & EPOLLOUT) || shared_count == 0)) {
219219
struct dma_buf_poll_cb_t *dcb = &dmabuf->cb_excl;
220220
__poll_t pevents = EPOLLIN;
@@ -493,13 +493,13 @@ static struct file *dma_buf_getfile(struct dma_buf *dmabuf, int flags)
493493
struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
494494
{
495495
struct dma_buf *dmabuf;
496-
struct reservation_object *resv = exp_info->resv;
496+
struct dma_resv *resv = exp_info->resv;
497497
struct file *file;
498498
size_t alloc_size = sizeof(struct dma_buf);
499499
int ret;
500500

501501
if (!exp_info->resv)
502-
alloc_size += sizeof(struct reservation_object);
502+
alloc_size += sizeof(struct dma_resv);
503503
else
504504
/* prevent &dma_buf[1] == dma_buf->resv */
505505
alloc_size += 1;
@@ -531,8 +531,8 @@ struct dma_buf *dma_buf_export(const struct dma_buf_export_info *exp_info)
531531
dmabuf->cb_excl.active = dmabuf->cb_shared.active = 0;
532532

533533
if (!resv) {
534-
resv = (struct reservation_object *)&dmabuf[1];
535-
reservation_object_init(resv);
534+
resv = (struct dma_resv *)&dmabuf[1];
535+
dma_resv_init(resv);
536536
}
537537
dmabuf->resv = resv;
538538

@@ -896,11 +896,11 @@ static int __dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
896896
{
897897
bool write = (direction == DMA_BIDIRECTIONAL ||
898898
direction == DMA_TO_DEVICE);
899-
struct reservation_object *resv = dmabuf->resv;
899+
struct dma_resv *resv = dmabuf->resv;
900900
long ret;
901901

902902
/* Wait on any implicit rendering fences */
903-
ret = reservation_object_wait_timeout_rcu(resv, write, true,
903+
ret = dma_resv_wait_timeout_rcu(resv, write, true,
904904
MAX_SCHEDULE_TIMEOUT);
905905
if (ret < 0)
906906
return ret;
@@ -1141,8 +1141,8 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
11411141
int ret;
11421142
struct dma_buf *buf_obj;
11431143
struct dma_buf_attachment *attach_obj;
1144-
struct reservation_object *robj;
1145-
struct reservation_object_list *fobj;
1144+
struct dma_resv *robj;
1145+
struct dma_resv_list *fobj;
11461146
struct dma_fence *fence;
11471147
int count = 0, attach_count, shared_count, i;
11481148
size_t size = 0;
@@ -1175,7 +1175,7 @@ static int dma_buf_debug_show(struct seq_file *s, void *unused)
11751175

11761176
robj = buf_obj->resv;
11771177
rcu_read_lock();
1178-
reservation_object_fences(robj, &fence, &fobj, &shared_count);
1178+
dma_resv_fences(robj, &fence, &fobj, &shared_count);
11791179
rcu_read_unlock();
11801180

11811181
if (fence)

‎drivers/dma-buf/dma-fence.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(1);
6060
*
6161
* - Then there's also implicit fencing, where the synchronization points are
6262
* implicitly passed around as part of shared &dma_buf instances. Such
63-
* implicit fences are stored in &struct reservation_object through the
63+
* implicit fences are stored in &struct dma_resv through the
6464
* &dma_buf.resv pointer.
6565
*/
6666

0 commit comments

Comments
 (0)