[PATCH] drm/etnaviv: fix DMA direction handling for cached read/write buffers

Sui Jingfeng sui.jingfeng at linux.dev
Thu Feb 8 06:19:32 UTC 2024


Hi,


On 2024/1/29 18:29, Daniel Stone wrote:
> Hi Lucas,
>
> On Fri, 26 Jan 2024 at 17:00, Lucas Stach <l.stach at pengutronix.de> wrote:
>> The dma sync operation needs to be done with DMA_BIDIRECTIONAL when
>> the BO is prepared for both read and write operations. With the
>> current inverted if ladder it would only be synced for DMA_FROM_DEVICE.
>>
>> [...]
>>
>>   static inline enum dma_data_direction etnaviv_op_to_dma_dir(u32 op)
>>   {
>> -       if (op & ETNA_PREP_READ)
>> +       if (op & (ETNA_PREP_READ | ETNA_PREP_WRITE))
>> +               return DMA_BIDIRECTIONAL;
> This test will always be true for _either_ read or write.


Haha, I think it should be"if ((op & ETNA_PREP_READ) && (op & ETNA_PREP_WRITE))"


> Cheers,
> Daniel


More information about the dri-devel mailing list