]> 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)
commitcac36c7098c7f59a3f56c33d4a204ff2dddfd2f2
tree5f68c4e9a35909349f67f38ac8e9a9ed82fc6ff6
parent618f39ec2432acfa8c450ec98d2456b61b78b68e
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