fd_ringbuffer_grow
fd_ringbuffer_new
fd_ringbuffer_reloc
+fd_ringbuffer_reloc2
fd_ringbuffer_reset
fd_ringbuffer_set_parent
fd_ringbuffer_timestamp
fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
{
struct fd_pipe *pipe = NULL;
+ uint64_t val;
if (id > FD_PIPE_MAX) {
ERROR_MSG("invalid pipe id: %d", id);
pipe->dev = dev;
pipe->id = id;
+ fd_pipe_get_param(pipe, FD_GPU_ID, &val);
+ pipe->gpu_id = val;
+
return pipe;
fail:
if (pipe)
struct fd_pipe {
struct fd_device *dev;
enum fd_pipe_id id;
+ uint32_t gpu_id;
const struct fd_pipe_funcs *funcs;
};
void fd_ringbuffer_reloc(struct fd_ringbuffer *ring,
const struct fd_reloc *reloc)
{
+ assert(ring->pipe->gpu_id < 500);
+ ring->funcs->emit_reloc(ring, reloc);
+}
+
+void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring,
+ const struct fd_reloc *reloc)
+{
ring->funcs->emit_reloc(ring, reloc);
}
{
uint32_t submit_offset, size;
+ /* This function is deprecated and not supported on 64b devices: */
+ assert(ring->pipe->gpu_id < 500);
assert(target->ring == end->ring);
submit_offset = offset_bytes(target->cur, target->ring->start);
uint32_t offset;
uint32_t or;
int32_t shift;
+ uint32_t orhi; /* used for a5xx+ */
};
-void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
+/* NOTE: relocs are 2 dwords on a5xx+ */
+
+void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
+will_be_deprecated void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, const struct fd_reloc *reloc);
will_be_deprecated void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
struct fd_ringmarker *target, struct fd_ringmarker *end);
uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring);
GETPROP(fd, VERSION, kgsl_pipe->version);
GETPROP(fd, DEVICE_INFO, kgsl_pipe->devinfo);
+ if (kgsl_pipe->devinfo.gpu_id >= 500) {
+ ERROR_MSG("64b unsupported with kgsl");
+ goto fail;
+ }
+
INFO_MSG("Pipe Info:");
INFO_MSG(" Device: %s", paths[id]);
INFO_MSG(" Chip-id: %d.%d.%d.%d",
reloc->submit_offset = offset_bytes(ring->cur, ring->start);
addr = msm_bo->presumed;
- if (r->shift < 0)
- addr >>= -r->shift;
+ if (reloc->shift < 0)
+ addr >>= -reloc->shift;
else
- addr <<= r->shift;
+ addr <<= reloc->shift;
(*ring->cur++) = addr | r->or;
+
+ if (ring->pipe->gpu_id >= 500) {
+ struct drm_msm_gem_submit_reloc *reloc_hi;
+
+ idx = APPEND(cmd, relocs);
+
+ reloc_hi = &cmd->relocs[idx];
+
+ reloc_hi->reloc_idx = reloc->reloc_idx;
+ reloc_hi->reloc_offset = r->offset;
+ reloc_hi->or = r->orhi;
+ reloc_hi->shift = r->shift - 32;
+ reloc_hi->submit_offset = offset_bytes(ring->cur, ring->start);
+
+ addr = msm_bo->presumed >> 32;
+ if (reloc_hi->shift < 0)
+ addr >>= -reloc_hi->shift;
+ else
+ addr <<= reloc_hi->shift;
+ (*ring->cur++) = addr | r->orhi;
+ }
}
static uint32_t msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,