Re: [PATCH v2 1/6] drm/plane: Make format_mod_supported truly optional

From: Simon Ser
Date: Thu Dec 23 2021 - 08:42:43 EST


On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> wrote:

> > - /* If we can't determine support, just bail */
> > - if (!plane->funcs->format_mod_supported)
> > - goto done;
> > -
> > mod = modifiers_ptr(blob_data);
> > for (i = 0; i < plane->modifier_count; i++) {
> > for (j = 0; j < plane->format_count; j++) {
> > - if (plane->funcs->format_mod_supported(plane,
> > + if (!plane->funcs->format_mod_supported ||
> > + plane->funcs->format_mod_supported(plane,
> > plane->format_types[j],
> > plane->modifiers[i])) {
>
> So instead of skipping the whole loop you just skip doing anything
> inside the loop? Can't see how that achieves anything at all.

No, the check is skipped when the function isn't populated by the driver.