Dmitry Osipenko <dmitry.osipe...@collabora.com> writes:

> On 11/1/24 20:16, Alex Bennée wrote:
>> Also what is the subtlety behind using both stride and bytes_pp in the
>> calculation. My naive thought would be:
>> 
>>   fb.bytes_pp * ss.r.width == fb.stride
>> 
>> Can anyone enlighten me?
>
> GPUs want image line size to be aligned to a power of 2 value, like 64
> bytes for example. This aligned size of the line is called stride.
>
> GPU's DMA engine operates with a predefined granularity when it accesses
> memory, it reads/writes memory chunks that are multiple of a stride.
> GPUs almost never support memory accesses at a granularity of one byte,
> like CPUs do it.

Ok that seems worth covering in a comment. Also what is going on with:

    fb->offset = ss->offsets[0] + ss->r.x * fb->bytes_pp + ss->r.y * fb->stride;

and then calculating fbend from offset + the calculation? Is this
because we need 2 full frames of storage? Can that ever change?

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

Reply via email to