]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gpu: host1x: Introduce support for wide opcodes
authorThierry Reding <treding@nvidia.com>
Fri, 1 Feb 2019 13:28:24 +0000 (14:28 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 7 Feb 2019 17:28:35 +0000 (18:28 +0100)
commit5a5fccbd8c315c08db01e585e1cbe88e30b70691
tree773c23591e5b8589e4546d7ef3006f804898f01e
parentde5469c21ff9c3e5ba6162dae58379ed51443164
gpu: host1x: Introduce support for wide opcodes

The CDMA push buffer can currently only handle opcodes that take a
single word parameter. However, the host1x implementation on Tegra186
and later supports opcodes that require multiple words as parameters.

Unfortunately the way the push buffer is structured, these wide opcodes
cannot simply be composed of two regular opcodes because that could
result in the wide opcode being split across the end of the push buffer
and the final RESTART opcode required to wrap the push buffer around
would break the wide opcode.

One way to fix this would be to remove the concept of slots to simplify
push buffer operations. However, that's not entirely trivial and should
be done in a separate patch. For now, simply use a different function
to push four-word opcodes into the push buffer. Technically only three
words are pushed, with the fourth word used as padding to preserve the
2-word alignment required by the slots abstraction. The fourth word is
always a NOP opcode.

Additional care must be taken when the end of the push buffer is
reached. If a four-word opcode doesn't fit into the push buffer without
being split by the boundary, NOP opcodes will be introduced and the new
wide opcode placed at the beginning of the push buffer.

Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/cdma.c
drivers/gpu/host1x/cdma.h
include/trace/events/host1x.h