freedreno/drm: Combine upper and lower 32b of OR val

The original reason it was split was because of libdrm ABI.  But that no
longer applies since we pulled it into mesa.

While we are at it, remove the c++ workaround.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17817>
This commit is contained in:
Rob Clark
2022-07-30 08:12:21 -07:00
committed by Marge Bot
parent cccadf7db6
commit 7a62f6e3a3
2 changed files with 14 additions and 17 deletions

View File

@@ -196,13 +196,12 @@ fd_ringbuffer_emit(struct fd_ringbuffer *ring, uint32_t data)
struct fd_reloc {
struct fd_bo *bo;
uint64_t iova;
uint64_t orval;
#define FD_RELOC_READ 0x0001
#define FD_RELOC_WRITE 0x0002
#define FD_RELOC_DUMP 0x0004
uint32_t offset;
uint32_t orlo;
int32_t shift;
uint32_t orhi; /* used for a5xx+ */
};
/* We always mark BOs for write, instead of tracking it across reloc
@@ -278,10 +277,9 @@ OUT_RING(struct fd_ringbuffer *ring, uint32_t data)
/*
* NOTE: OUT_RELOC() is 2 dwords (64b) on a5xx+
*/
#ifndef __cplusplus
static inline void
OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset,
uint64_t or, int32_t shift)
uint64_t orval, int32_t shift)
{
if (LOG_DWORDS) {
fprintf(stderr, "ring[%p]: OUT_RELOC %04x: %p+%u << %d", ring,
@@ -296,19 +294,18 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset,
else
iova <<= shift;
iova |= or ;
iova |= orval;
fd_ringbuffer_reloc(ring, &(struct fd_reloc){
.bo = bo,
.iova = iova,
.offset = offset,
.orlo = or
,
.shift = shift,
.orhi = or >> 32,
});
struct fd_reloc reloc = {
.bo = bo,
.iova = iova,
.orval = orval,
.offset = offset,
.shift = shift,
};
fd_ringbuffer_reloc(ring, &reloc);
}
#endif
static inline void
OUT_RB(struct fd_ringbuffer *ring, struct fd_ringbuffer *target)

View File

@@ -503,7 +503,7 @@ msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
(struct drm_msm_gem_submit_reloc){
.reloc_idx = reloc_idx,
.reloc_offset = reloc->offset,
.or = reloc->orlo,
.or = reloc->orval,
.shift = reloc->shift,
.submit_offset =
offset_bytes(ring->cur, ring->start) + msm_ring->offset,
@@ -516,7 +516,7 @@ msm_ringbuffer_emit_reloc(struct fd_ringbuffer *ring,
(struct drm_msm_gem_submit_reloc){
.reloc_idx = reloc_idx,
.reloc_offset = reloc->offset,
.or = reloc->orhi,
.or = reloc->orval >> 32,
.shift = reloc->shift - 32,
.submit_offset =
offset_bytes(ring->cur, ring->start) + msm_ring->offset,