[PATCH v10 07/11] drm/etnaviv: Add support for the dma coherent device

Sui Jingfeng suijingfeng at loongson.cn
Wed Jun 21 14:42:08 UTC 2023


On 2023/6/21 18:00, Lucas Stach wrote:
>> +static bool etnaviv_is_dma_coherent(struct device *dev)
>> +{
>> +	struct device_node *np;
>> +	bool coherent;
>> +
>> +	np = etnaviv_of_first_available_node();
>> +	if (np) {
>> +		coherent = of_dma_is_coherent(np);
>> +		of_node_put(np);
>> +	} else {
>> +		coherent = dev_is_dma_coherent(dev);
>> +	}
> This whole dance shouldn't be needed. We transfer the DMA capabilities
> from the first node to the virtual master device in the platform device
> case, so dev_is_dma_coherent(dev) should always return the right thing.
>
OK, I'm fine if this is OK on your platform.
>> +
>> +	return coherent;
>> +}
>> +

-- 
Jingfeng



More information about the dri-devel mailing list