[Mesa-dev] [PATCH v2 06/11] gbm: Check harder for supported formats

Daniel Stone daniel at fooishbar.org
Fri Jul 14 13:38:47 UTC 2017


Hi,

On 14 July 2017 at 12:01, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> On 13 July 2017 at 17:07, Jason Ekstrand <jason at jlekstrand.net> wrote:
>> What happened to the ARGB formats?
>>
> I think you meant the "BO_FORMAT" formats. And yes, those seems to
> have disappeared and we'd want them back.

Indeed I guess so. I ultimately added a helper which was dissimilar
enough (and seemed to fix quite a few more cases of GBM_BO_FORMAT not
being checked) that I sent out a v3 for this.

>>> +   if (!dri->image->queryDmaBufModifiers(dri->screen, format, 0, NULL,
>>> NULL,
>>> +                                         &count) || count == 0) {
>>
>>
>> The "|| count == 0" here really threw me off.  It could be dropped in favor
>> of "return count != 0;".  .it sure if that's really better though.
>>
> We'll need to initialise count since it remains unchanged, when the
> function call fails.
>
> Suggestion seems simpler/easier to read.

Yeah, I've done that. It doesn't need to be initialised though: if the
function call fails, the conditional will be short-circuited and the
value of 'count' never checked. If it succeeds, 'count' will have been
set by the function.

Cheers,
Daniel


More information about the mesa-dev mailing list