[Mesa-dev] [PATCH 06/19] etnaviv: GC7000: Support BLT as recipient for etna_stall
When the BLT is involved as source or target, add an extra BLT enable/disable sequence around the sync sequence. Signed-off-by: Wladimir J. van der Laan --- src/gallium/drivers/etnaviv/etnaviv_emit.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c index 6f7ce68..f388a89 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c @@ -41,6 +41,7 @@ #include "etnaviv_zsa.h" #include "hw/common.xml.h" #include "hw/state.xml.h" +#include "hw/state_blt.xml.h" #include "util/u_math.h" struct etna_coalesce { @@ -60,8 +61,15 @@ CMD_STALL(struct etna_cmd_stream *stream, uint32_t from, uint32_t to) void etna_stall(struct etna_cmd_stream *stream, uint32_t from, uint32_t to) { - etna_cmd_stream_reserve(stream, 4); + bool blt = (from == SYNC_RECIPIENT_BLT) || (to == SYNC_RECIPIENT_BLT); + etna_cmd_stream_reserve(stream, blt ? 8 : 4); + if (blt) { + etna_emit_load_state(stream, VIVS_BLT_ENABLE >> 2, 1, 0); + etna_cmd_stream_emit(stream, 1); + } + + /* TODO: set bit 28/29 of token after BLT COPY_BUFFER */ etna_emit_load_state(stream, VIVS_GL_SEMAPHORE_TOKEN >> 2, 1, 0); etna_cmd_stream_emit(stream, VIVS_GL_SEMAPHORE_TOKEN_FROM(from) | VIVS_GL_SEMAPHORE_TOKEN_TO(to)); @@ -73,6 +81,11 @@ etna_stall(struct etna_cmd_stream *stream, uint32_t from, uint32_t to) etna_emit_load_state(stream, VIVS_GL_STALL_TOKEN >> 2, 1, 0); etna_cmd_stream_emit(stream, VIVS_GL_STALL_TOKEN_FROM(from) | VIVS_GL_STALL_TOKEN_TO(to)); } + + if (blt) { + etna_emit_load_state(stream, VIVS_BLT_ENABLE >> 2, 1, 0); + etna_cmd_stream_emit(stream, 0); + } } static void -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/19] etnaviv: GC7000: Support BLT as recipient for etna_stall
2017-10-30 17:16 GMT+01:00 Wladimir J. van der Laan : > When the BLT is involved as source or target, add an extra BLT > enable/disable sequence around the sync sequence. > Does this mean we are doing lazy blit operations? Or why is this needed at all? > Signed-off-by: Wladimir J. van der Laan > --- > src/gallium/drivers/etnaviv/etnaviv_emit.c | 15 ++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c > b/src/gallium/drivers/etnaviv/etnaviv_emit.c > index 6f7ce68..f388a89 100644 > --- a/src/gallium/drivers/etnaviv/etnaviv_emit.c > +++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c > @@ -41,6 +41,7 @@ > #include "etnaviv_zsa.h" > #include "hw/common.xml.h" > #include "hw/state.xml.h" > +#include "hw/state_blt.xml.h" > #include "util/u_math.h" > > struct etna_coalesce { > @@ -60,8 +61,15 @@ CMD_STALL(struct etna_cmd_stream *stream, uint32_t from, > uint32_t to) > void > etna_stall(struct etna_cmd_stream *stream, uint32_t from, uint32_t to) > { > - etna_cmd_stream_reserve(stream, 4); > + bool blt = (from == SYNC_RECIPIENT_BLT) || (to == SYNC_RECIPIENT_BLT); > + etna_cmd_stream_reserve(stream, blt ? 8 : 4); > > + if (blt) { > + etna_emit_load_state(stream, VIVS_BLT_ENABLE >> 2, 1, 0); > + etna_cmd_stream_emit(stream, 1); > + } > + > + /* TODO: set bit 28/29 of token after BLT COPY_BUFFER */ > etna_emit_load_state(stream, VIVS_GL_SEMAPHORE_TOKEN >> 2, 1, 0); > etna_cmd_stream_emit(stream, VIVS_GL_SEMAPHORE_TOKEN_FROM(from) | > VIVS_GL_SEMAPHORE_TOKEN_TO(to)); > > @@ -73,6 +81,11 @@ etna_stall(struct etna_cmd_stream *stream, uint32_t from, > uint32_t to) >etna_emit_load_state(stream, VIVS_GL_STALL_TOKEN >> 2, 1, 0); >etna_cmd_stream_emit(stream, VIVS_GL_STALL_TOKEN_FROM(from) | > VIVS_GL_STALL_TOKEN_TO(to)); > } > + > + if (blt) { > + etna_emit_load_state(stream, VIVS_BLT_ENABLE >> 2, 1, 0); > + etna_cmd_stream_emit(stream, 0); > + } > } > > static void > -- > 2.7.4 > -- greets -- Christian Gmeiner, MSc https://christian-gmeiner.info ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/19] etnaviv: GC7000: Support BLT as recipient for etna_stall
On Sun, Nov 5, 2017 at 12:47 PM, Christian Gmeiner wrote: > 2017-10-30 17:16 GMT+01:00 Wladimir J. van der Laan : >> When the BLT is involved as source or target, add an extra BLT >> enable/disable sequence around the sync sequence. >> > > Does this mean we are doing lazy blit operations? Or why is this needed at > all? How do you mean with "lazy blit"? This is required. Any syncing with the BLT will otherwise crash. The Vivante blob does it, also. Wladimir ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 06/19] etnaviv: GC7000: Support BLT as recipient for etna_stall
2017-11-05 12:54 GMT+01:00 Wladimir : > On Sun, Nov 5, 2017 at 12:47 PM, Christian Gmeiner > wrote: >> 2017-10-30 17:16 GMT+01:00 Wladimir J. van der Laan : >>> When the BLT is involved as source or target, add an extra BLT >>> enable/disable sequence around the sync sequence. >>> >> >> Does this mean we are doing lazy blit operations? Or why is this needed at >> all? > > How do you mean with "lazy blit"? > > This is required. Any syncing with the BLT will otherwise crash. The > Vivante blob does it, also. > See comments for patch "[PATCH 07/19] etnaviv: GC7000: Add etnaviv_blt" -- greets -- Christian Gmeiner, MSc https://christian-gmeiner.info ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev