Hi,

On 23 March 2018 at 14:49, Ville Syrjälä <ville.syrj...@linux.intel.com> wrote:
> On Fri, Mar 23, 2018 at 01:45:52PM +0000, Daniel Stone wrote:
>> +     for (i = 0; i < ARRAY_SIZE(r->handles); i++) {
>> +             r->handles[i] = 0;
>> +             r->pitches[i] = 0;
>> +             r->offsets[i] = 0;
>> +             r->modifier[i] = DRM_FORMAT_MOD_INVALID;
>
> Don't we want to leave this zeroed too? For addfb2 we require any unused
> modifier to be 0, so if someone does 'getfb2(&cmd); addfb2(&cmd);' they
> would get an error from the addfb2().

My thinking is that since the primary userspace for this doesn't have
symmetry with add (args for add, struct for get), that it was better
to feed in INVALID directly. This is going to change, e.g., X server
to:
  modifier = (fb->flags ? DRM_MODE_FB_MODIFIERS) ? fb->modifier :
DRM_FORMAT_MOD_INVALID;

It's a good point about the symmetry though. Do you know of direct
non-libdrm users? Apart from igt of course ;)

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to