[igt-dev] [PATCH i-g-t v2] lib: Don't call igt_require_fb_modifiers() when no modifier

Daniel Stone daniel at fooishbar.org
Sat Oct 13 12:04:08 UTC 2018


Hi Deepak,

On Fri, 12 Oct 2018 at 16:24, <sunpeng.li at amd.com> wrote:
> * In create_fb() calls to kms_addfb(), remove the modifier flag iff the
>   driver doesn't support modifiers and the modifer is 0

I know this wasn't your idea and you were just following the
suggestion - but 0 _is_ a valid modifier with a very specific meaning,
which is to always interpret the buffer as linear, no matter what.

DRM_FORMAT_MOD_INVALID is a non-zero value, and should be passed
anywhere that modifiers are not supported or their use is not wanted.

> @@ -1678,7 +1682,8 @@ int __kms_addfb(int fd, uint32_t handle,
>         struct drm_mode_fb_cmd2 f;
>         int ret, i;
>
> -       igt_require_fb_modifiers(fd);
> +       if (modifier || flags & DRM_MODE_FB_MODIFIERS)

So I would suggest changing this test to modifier !=
DRM_FORMAT_MOD_INVALID, and passing INVALID rather than 0 where
required.

Cheers,
Daniel


More information about the igt-dev mailing list