]> git.baikalelectronics.ru Git - kernel.git/commit
gpu: host1x: Optimize CDMA push buffer memory usage
authorThierry Reding <treding@nvidia.com>
Fri, 1 Feb 2019 13:28:30 +0000 (14:28 +0100)
committerThierry Reding <treding@nvidia.com>
Thu, 7 Feb 2019 17:28:59 +0000 (18:28 +0100)
commit0eabf06b03df896b7bec10ba31032192061b1c71
tree5f68c4e9a35909349f67f38ac8e9a9ed82fc6ff6
parent6c8bd7b1fd67a7f30ccd3ff37a65dfc550f22c17
gpu: host1x: Optimize CDMA push buffer memory usage

The host1x CDMA push buffer is terminated by a special opcode (RESTART)
that tells the CDMA to wrap around to the beginning of the push buffer.
To accomodate the RESTART opcode, an extra 4 bytes are allocated on top
of the 512 * 8 = 4096 bytes needed for the 512 slots (1 slot = 2 words)
that are used for other commands passed to CDMA. This requires that two
memory pages are allocated, but most of the second page (4092 bytes) is
never used.

Decrease the number of slots to 511 so that the RESTART opcode fits
within the page. Adjust the push buffer wraparound code to take into
account push buffer sizes that are not a power of two.

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