freedreno: Extra casting to make C++ happy
authorRob Clark <robdclark@chromium.org>
Sun, 23 Apr 2023 14:54:54 +0000 (07:54 -0700)
committerMarge Bot <emma+marge@anholt.net>
Mon, 24 Apr 2023 22:42:03 +0000 (22:42 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22646>

src/freedreno/common/fd6_pack.h
src/freedreno/drm/freedreno_ringbuffer.h

index 354ccae..954a4fe 100644 (file)
@@ -93,7 +93,7 @@ __reg_iova(const struct fd_reg_pair *reg)
                                                                                \
       BEGIN_RING(ring, count + 1);                                             \
       uint32_t *__p = ring->cur;                                               \
-      *__p++ = pm4_pkt4_hdr(__regs[0].reg, count);                             \
+      *__p++ = pm4_pkt4_hdr((uint16_t)__regs[0].reg, (uint16_t)count);         \
                                                                                \
       __ONE_REG(0, __VA_ARGS__);                                               \
       __ONE_REG(1, __VA_ARGS__);                                               \
index 3c2be70..49652d7 100644 (file)
@@ -375,14 +375,14 @@ static inline void
 OUT_PKT4(struct fd_ringbuffer *ring, uint16_t regindx, uint16_t cnt)
 {
    BEGIN_RING(ring, cnt + 1);
-   OUT_RING(ring, pm4_pkt4_hdr(regindx, cnt));
+   OUT_RING(ring, pm4_pkt4_hdr((uint16_t)regindx, (uint16_t)cnt));
 }
 
 static inline void
-OUT_PKT7(struct fd_ringbuffer *ring, uint8_t opcode, uint16_t cnt)
+OUT_PKT7(struct fd_ringbuffer *ring, uint32_t opcode, uint32_t cnt)
 {
    BEGIN_RING(ring, cnt + 1);
-   OUT_RING(ring, pm4_pkt7_hdr(opcode, cnt));
+   OUT_RING(ring, pm4_pkt7_hdr((uint8_t)opcode, (uint16_t)cnt));
 }
 
 static inline void