Skip to content

Commit 9fcdece

Browse files
gerddieChristian Gmeiner
authored andcommitted
drm/etnaviv: Add a new function to emit a series of states to cmd stream
v2: fix formatting and remove superfluous masking (Lucas) Signed-off-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com> Tested-by: Marek Vasut <marek.vasut@mailbox.org> # STM32MP255C DHCOS DHSBC Link: https://patch.msgid.link/20251119164624.9297-4-gert.wollny@collabora.com Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
1 parent 9934873 commit 9fcdece

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/gpu/drm/etnaviv/etnaviv_buffer.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ static inline void CMD_LOAD_STATE(struct etnaviv_cmdbuf *buffer, u32 reg,
3636
OUT(buffer, value);
3737
}
3838

39+
static inline void CMD_LOAD_STATES_START(struct etnaviv_cmdbuf *buffer, u32 reg,
40+
u32 nvalues)
41+
{
42+
u32 index = reg >> VIV_FE_LOAD_STATE_HEADER_OFFSET__SHR;
43+
44+
buffer->user_size = ALIGN(buffer->user_size, 8);
45+
46+
/* write a register via cmd stream */
47+
OUT(buffer, VIV_FE_LOAD_STATE_HEADER_OP_LOAD_STATE |
48+
VIV_FE_LOAD_STATE_HEADER_OFFSET(index) |
49+
VIV_FE_LOAD_STATE_HEADER_COUNT(nvalues));
50+
}
51+
3952
static inline void CMD_END(struct etnaviv_cmdbuf *buffer)
4053
{
4154
buffer->user_size = ALIGN(buffer->user_size, 8);

0 commit comments

Comments
 (0)