summaryrefslogtreecommitdiff
path: root/freedreno
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2018-10-10 11:10:39 -0400
committerRob Clark <robclark@freedesktop.org>2018-10-13 17:23:12 -0400
commit5c4722e9078a845dce097168731f1be88cf61e75 (patch)
tree6bdc97108d84031d30ae09a014bd9f6e0d5bbda3 /freedreno
parent96b625240cb621531b49b8cb05249dafba4e0817 (diff)
freedreno/msm: simplify emit_reloc_ring() vfunc
Now that it doesn't have to deal with the ringmarker case, we can make some simplifications. Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno')
-rw-r--r--freedreno/freedreno_priv.h3
-rw-r--r--freedreno/freedreno_ringbuffer.c3
-rw-r--r--freedreno/kgsl/kgsl_ringbuffer.c7
-rw-r--r--freedreno/msm/msm_ringbuffer.c8
4 files changed, 9 insertions, 12 deletions
diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
index 48cd6380..b8eac4b2 100644
--- a/freedreno/freedreno_priv.h
+++ b/freedreno/freedreno_priv.h
@@ -140,8 +140,7 @@ struct fd_ringbuffer_funcs {
void (*emit_reloc)(struct fd_ringbuffer *ring,
const struct fd_reloc *reloc);
uint32_t (*emit_reloc_ring)(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size);
+ struct fd_ringbuffer *target, uint32_t cmd_idx);
uint32_t (*cmd_count)(struct fd_ringbuffer *ring);
void (*destroy)(struct fd_ringbuffer *ring);
};
diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c
index ddaa4632..8f0093ae 100644
--- a/freedreno/freedreno_ringbuffer.c
+++ b/freedreno/freedreno_ringbuffer.c
@@ -166,8 +166,7 @@ drm_public uint32_t
fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
struct fd_ringbuffer *target, uint32_t cmd_idx)
{
- uint32_t size = offset_bytes(target->cur, target->start);
- return ring->funcs->emit_reloc_ring(ring, target, cmd_idx, 0, size);
+ return ring->funcs->emit_reloc_ring(ring, target, cmd_idx);
}
drm_public uint32_t
diff --git a/freedreno/kgsl/kgsl_ringbuffer.c b/freedreno/kgsl/kgsl_ringbuffer.c
index 7361f7d5..42a0e0aa 100644
--- a/freedreno/kgsl/kgsl_ringbuffer.c
+++ b/freedreno/kgsl/kgsl_ringbuffer.c
@@ -174,13 +174,12 @@ static void kgsl_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
}
static uint32_t kgsl_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size)
+ struct fd_ringbuffer *target, uint32_t cmd_idx)
{
struct kgsl_ringbuffer *target_ring = to_kgsl_ringbuffer(target);
assert(cmd_idx == 0);
- (*ring->cur++) = target_ring->bo->gpuaddr + submit_offset;
- return size;
+ (*ring->cur++) = target_ring->bo->gpuaddr;
+ return offset_bytes(target->cur, target->start);
}
static void kgsl_ringbuffer_destroy(struct fd_ringbuffer *ring)
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index 304be119..24aa9fd4 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -566,15 +566,14 @@ static void msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
}
static uint32_t msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
- struct fd_ringbuffer *target, uint32_t cmd_idx,
- uint32_t submit_offset, uint32_t size)
+ struct fd_ringbuffer *target, uint32_t cmd_idx)
{
struct msm_cmd *cmd = NULL;
struct msm_ringbuffer *msm_target = to_msm_ringbuffer(target);
uint32_t idx = 0;
int added_cmd = FALSE;
-
- submit_offset += msm_target->offset;
+ uint32_t size;
+ uint32_t submit_offset = msm_target->offset;
LIST_FOR_EACH_ENTRY(cmd, &msm_target->cmd_list, list) {
if (idx == cmd_idx)
@@ -593,6 +592,7 @@ static uint32_t msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
size = cmd->size;
} else {
struct fd_ringbuffer *parent = ring->parent ? ring->parent : ring;
+ size = offset_bytes(target->cur, target->start);
added_cmd = get_cmd(parent, cmd, submit_offset, size,
MSM_SUBMIT_CMD_IB_TARGET_BUF);
}