diff --git a/src/gallium/drivers/nouveau/nouveau_video.h b/src/gallium/drivers/nouveau/nouveau_video.h index 3ef6f89ce28..bcbe4bb04c4 100644 --- a/src/gallium/drivers/nouveau/nouveau_video.h +++ b/src/gallium/drivers/nouveau/nouveau_video.h @@ -50,36 +50,6 @@ nouveau_vpe_write(struct nouveau_decoder *dec, unsigned data) { dec->cmds[dec->ofs++] = data; } -#define SUBC_MPEG(mthd) 1, mthd -#define NV31_MPEG(mthd) SUBC_MPEG(NV31_MPEG_##mthd) -#define NV84_MPEG(mthd) SUBC_MPEG(NV84_MPEG_##mthd) - -static inline uint32_t -NV04_FIFO_PKHDR(int subc, int mthd, unsigned size) -{ - return 0x00000000 | (size << 18) | (subc << 13) | mthd; -} - -static inline uint32_t -NV04_FIFO_PKHDR_NI(int subc, int mthd, unsigned size) -{ - return 0x40000000 | (size << 18) | (subc << 13) | mthd; -} - -static inline void -BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) -{ - PUSH_SPACE(push, size + 1); - PUSH_DATA (push, NV04_FIFO_PKHDR(subc, mthd, size)); -} - -static inline void -BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) -{ - PUSH_SPACE(push, size + 1); - PUSH_DATA (push, NV04_FIFO_PKHDR_NI(subc, mthd, size)); -} - static inline void PUSH_MTHDl(struct nouveau_pushbuf *push, int subc, int mthd, struct nouveau_bo *bo, uint32_t offset, @@ -93,4 +63,8 @@ PUSH_MTHDl(struct nouveau_pushbuf *push, int subc, int mthd, PUSH_DATA(push, bo->offset + offset); } +#define SUBC_MPEG(mthd) 1, mthd +#define NV31_MPEG(mthd) SUBC_MPEG(NV31_MPEG_##mthd) +#define NV84_MPEG(mthd) SUBC_MPEG(NV84_MPEG_##mthd) + #endif diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h index 6a479ef6689..9049b53812e 100644 --- a/src/gallium/drivers/nouveau/nouveau_winsys.h +++ b/src/gallium/drivers/nouveau/nouveau_winsys.h @@ -109,6 +109,36 @@ PUSH_VAL(struct nouveau_pushbuf *push) return res; } +static inline uint32_t +NV04_FIFO_PKHDR(int subc, int mthd, unsigned size) +{ + return 0x00000000 | (size << 18) | (subc << 13) | mthd; +} + +static inline uint32_t +NV04_FIFO_PKHDR_NI(int subc, int mthd, unsigned size) +{ + return 0x40000000 | (size << 18) | (subc << 13) | mthd; +} + +static inline void +BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) +{ +#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING + PUSH_SPACE(push, size + 1); +#endif + PUSH_DATA (push, NV04_FIFO_PKHDR(subc, mthd, size)); +} + +static inline void +BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) +{ +#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING + PUSH_SPACE(push, size + 1); +#endif + PUSH_DATA (push, NV04_FIFO_PKHDR_NI(subc, mthd, size)); +} + static inline int BO_MAP(struct nouveau_screen *screen, struct nouveau_bo *bo, uint32_t access, struct nouveau_client *client) { diff --git a/src/gallium/drivers/nouveau/nv30/nv30_winsys.h b/src/gallium/drivers/nouveau/nv30/nv30_winsys.h index a72af87c9b6..e2e058de506 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_winsys.h +++ b/src/gallium/drivers/nouveau/nv30/nv30_winsys.h @@ -103,20 +103,6 @@ PUSH_RESRC(struct nouveau_pushbuf *push, int subc, int mthd, int bin, r->domain | access, vor, tor)->priv = r; } -static inline void -BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, int size) -{ - PUSH_SPACE(push, size + 1); - PUSH_DATA (push, 0x00000000 | (size << 18) | (subc << 13) | mthd); -} - -static inline void -BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, int size) -{ - PUSH_SPACE(push, size + 1); - PUSH_DATA (push, 0x40000000 | (size << 18) | (subc << 13) | mthd); -} - /* subchannel assignment * * 0: <1.0.0 - used by kernel for m2mf diff --git a/src/gallium/drivers/nouveau/nv50/nv50_winsys.h b/src/gallium/drivers/nouveau/nv50/nv50_winsys.h index cda05cedee9..ecfd8b21f2b 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_winsys.h +++ b/src/gallium/drivers/nouveau/nv50/nv50_winsys.h @@ -86,24 +86,6 @@ PUSH_DATAh(struct nouveau_pushbuf *push, uint64_t data) *push->cur++ = (uint32_t)(data >> 32); } -static inline void -BEGIN_NV04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) -{ -#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING - PUSH_SPACE(push, size + 1); -#endif - PUSH_DATA (push, NV50_FIFO_PKHDR(subc, mthd, size)); -} - -static inline void -BEGIN_NI04(struct nouveau_pushbuf *push, int subc, int mthd, unsigned size) -{ -#ifndef NV50_PUSH_EXPLICIT_SPACE_CHECKING - PUSH_SPACE(push, size + 1); -#endif - PUSH_DATA (push, NV50_FIFO_PKHDR_NI(subc, mthd, size)); -} - /* long, non-incremental, nv50-only */ static inline void BEGIN_NL50(struct nouveau_pushbuf *push, int subc, int mthd, uint32_t size)