From 92970b1515995ded9f4e93b4fb7a4cd07855b24c Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Mon, 30 Jan 2023 20:12:00 -0600 Subject: [PATCH] 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: --- src/nouveau/mme/mme_builder.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/nouveau/mme/mme_builder.h b/src/nouveau/mme/mme_builder.h index 639654201ce..842fe4e0289 100644 --- a/src/nouveau/mme/mme_builder.h +++ b/src/nouveau/mme/mme_builder.h @@ -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) {