nouveau/mme: Add a couple helpers for working 64-bit addresses

In the command stream, they always come high bits first which is
backwards from little endian. These helpers follow that same convention
so that MMEs use the same conventions as other registers.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
Faith Ekstrand 2023-01-30 20:12:00 -06:00 committed by Marge Bot
parent 54fd3604ef
commit 92970b1515

View file

@ -464,6 +464,14 @@ mme_load(struct mme_builder *b)
return dst;
}
static inline struct mme_value64
mme_load_addr64(struct mme_builder *b)
{
struct mme_value hi = mme_load(b);
struct mme_value lo = mme_load(b);
return mme_value64(lo, hi);
}
static inline void
mme_mthd_arr(struct mme_builder *b, uint16_t mthd,
struct mme_value index)
@ -484,6 +492,13 @@ mme_emit(struct mme_builder *b,
mme_tu104_emit(b, data);
}
static inline void
mme_emit_addr64(struct mme_builder *b, struct mme_value64 addr)
{
mme_tu104_emit(b, addr.hi);
mme_tu104_emit(b, addr.lo);
}
static inline void
mme_start_loop(struct mme_builder *b, struct mme_value count)
{