• Thierry Reding's avatar
    gpu: host1x: Optimize CDMA push buffer memory usage · e1f338c0
    Thierry Reding authored
    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: default avatarThierry Reding <treding@nvidia.com>
    e1f338c0
cdma.c 16.7 KB