]> asedeno.scripts.mit.edu Git - linux.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)
commite1f338c0f8a9aacf351e42e5cfd0639fc73dc5b9
tree5f68c4e9a35909349f67f38ac8e9a9ed82fc6ff6
parent0e43b8da154a95f4369da4068a43ad9d700f4cea
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