Re: [PATCH v9 27/28] media: iris: enable video driver probe of SM8250 SoC

From: Hans Verkuil
Date: Wed Jan 08 2025 - 02:47:58 EST


On 08/01/2025 08:43, Dikshita Agarwal wrote:
>
>
> On 1/7/2025 7:27 PM, Nicolas Dufresne wrote:
>> Le lundi 23 décembre 2024 à 16:21 +0530, Dikshita Agarwal a écrit :
>>>
>>> On 12/23/2024 4:00 PM, Mauro Carvalho Chehab wrote:
>>>> Em Thu, 12 Dec 2024 17:21:49 +0530
>>>> Dikshita Agarwal <quic_dikshita@xxxxxxxxxxx> escreveu:
>>>>
>>>>> + .dma_mask = GENMASK(31, 29) - 1,
>>>>
>>>> Setting a mask to GENMASK() - 1 sounds weird. Is it really what you want?
>>>> I so, why?
>>>>
>>> Hi Mauro,
>>>
>>> the value of this dma mask should be 0xe0000000 -1.
>>>
>>> The background for the same is, 0xe0000000 onward memory space is allocated
>>> for IO register space so we are restricting the driver buffer allocations
>>> to 0xe0000000 - 1.
>>>
>>> Based on the comments received in the past, we are using GENMASK to
>>> generate 0xe0000000.
>>>
>>> Does this answer your query or I missed something?
>>
>> I'm not sure it will do what you want. (0xe0000000 -1) matches ~BIT(29). Perhaps
>> you wanted to use ~0xe0000000.
>>
> value of dma mask is coming as expected with GENMASK(31, 29) - 1
>
> qcom-iris aa00000.video-codec: dma_mask DFFFFFFF (0xe0000000 -1)

Isn't this just the equivalent of GENMASK(28, 0)? Can't you use that?

It's much easier to understand than GENMASK()-1.

Regards,

Hans

>
> Thanks,
> Dikshita
>> Nicolas
>>
>>>
>>> Thanks,
>>> Dikshita
>>>> Thanks,
>>>> Mauro
>>