freedreno/a6xx: Drop "hardpin" support

The upstream kernel supported everything needed to stop doing
kernel-side relocs before the first things with a6xx were fully
supported in upstream kernel.  Take advantage to drop some extra
overhead in OUT_RELOC() and equiv in the pack macros.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18646>
This commit is contained in:
Rob Clark 2022-08-04 15:58:15 -07:00 committed by Marge Bot
parent 3fb60e9cef
commit 8609d62e4d
19 changed files with 65 additions and 11 deletions

View file

@ -288,6 +288,21 @@ OUT_RING(struct fd_ringbuffer *ring, uint32_t data)
fd_ringbuffer_emit(ring, data);
}
static inline uint64_t
__reloc_iova(struct fd_bo *bo, uint32_t offset, uint64_t orval, int32_t shift)
{
uint64_t iova = fd_bo_get_iova(bo) + offset;
if (shift < 0)
iova >>= -shift;
else
iova <<= shift;
iova |= orval;
return iova;
}
/*
* NOTE: OUT_RELOC() is 2 dwords (64b) on a5xx+
*/
@ -301,15 +316,14 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset,
}
assert(offset < fd_bo_size(bo));
uint64_t iova = fd_bo_get_iova(bo) + offset;
if (shift < 0)
iova >>= -shift;
else
iova <<= shift;
iova |= orval;
uint64_t iova = __reloc_iova(bo, offset, orval, shift);
#if FD_BO_NO_HARDPIN
uint64_t *cur = (uint64_t *)ring->cur;
*cur = iova;
ring->cur += 2;
fd_ringbuffer_attach_bo(ring, bo);
#else
struct fd_reloc reloc = {
.bo = bo,
.iova = iova,
@ -319,6 +333,7 @@ OUT_RELOC(struct fd_ringbuffer *ring, struct fd_bo *bo, uint32_t offset,
};
fd_ringbuffer_reloc(ring, &reloc);
#endif
}
static inline void

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_blend.h"
#include "util/u_dual_blend.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "util/format_srgb.h"
#include "util/half_float.h"
#include "util/u_dump.h"

View file

@ -24,6 +24,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_dump.h"
#include "u_tracepoints.h"

View file

@ -22,6 +22,8 @@
* SOFTWARE.
*/
#define FD_BO_NO_HARDPIN 1
#include "fd6_const.h"
#include "fd6_pack.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "freedreno_query_acc.h"
#include "freedreno_state.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_prim.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/format/u_format.h"
#include "util/u_helpers.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include <stdio.h>
#include "pipe/p_state.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "freedreno_resource.h"

View file

@ -50,6 +50,10 @@ struct fd_reg_pair {
} \
} while (0)
#if !FD_BO_NO_HARDPIN
# error 'Hardpin unsupported'
#endif
#define __ONE_REG(i, ...) \
do { \
const struct fd_reg_pair regs[] = {__VA_ARGS__}; \
@ -57,10 +61,11 @@ struct fd_reg_pair {
if (i < ARRAY_SIZE(regs) && (i == 0 || regs[i].reg > 0)) { \
__assert_eq(regs[0].reg + i, regs[i].reg); \
if (regs[i].bo) { \
ring->cur = p; \
uint64_t *p64 = (uint64_t *)p; \
*p64 = __reloc_iova(regs[i].bo, regs[i].bo_offset, regs[i].value, \
regs[i].bo_shift); \
p += 2; \
OUT_RELOC(ring, regs[i].bo, regs[i].bo_offset, regs[i].value, \
regs[i].bo_shift); \
fd_ringbuffer_attach_bo(ring, regs[i].bo); \
} else { \
*p++ = regs[i].value; \
if (regs[i].is_address) \

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/bitset.h"
#include "util/format/u_format.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
/* NOTE: see https://gitlab.freedesktop.org/freedreno/freedreno/-/wikis/A5xx-Queries */
#include "freedreno_query_acc.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_string.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "drm-uapi/drm_fourcc.h"
#include "fd6_resource.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "drm-uapi/drm_fourcc.h"
#include "pipe/p_screen.h"
#include "util/format/u_format.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/format/u_format.h"
#include "util/hash_table.h"

View file

@ -21,6 +21,8 @@
* SOFTWARE.
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_prim.h"

View file

@ -25,6 +25,8 @@
* Rob Clark <robclark@freedesktop.org>
*/
#define FD_BO_NO_HARDPIN 1
#include "pipe/p_state.h"
#include "util/u_memory.h"
#include "util/u_string.h"