[igt-dev] [PATCH i-g-t] lib/igt_fb: Require FB modifiers only when needed
Daniel Vetter
daniel at ffwll.ch
Fri Oct 12 13:03:07 UTC 2018
On Thu, Oct 11, 2018 at 06:17:36PM -0400, sunpeng.li at amd.com wrote:
> From: Leo Li <sunpeng.li at amd.com>
>
> AMDGPU doesn't have modifier support. However, __kms_addfb requests
> modifier support on all calls to igt_create_fb_with_bo_size.
>
> Therefore, don't request modifier support if not needed.
>
> Signed-off-by: Leo Li <sunpeng.li at amd.com>
Please see
[PATCH i-g-t 4/6] lib: Don't call igt_require_fb_modifiers() when no modifier
and work together with Deepak to find a solution to this issue, since I
think you have the exact same problem.
-Daniel
> ---
> lib/igt_fb.c | 8 +++++++-
> lib/ioctl_wrappers.c | 3 ++-
> 2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 35be2e8..3253236 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -913,6 +913,12 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
> /* FIXME allow the caller to pass these in */
> enum igt_color_encoding color_encoding = IGT_COLOR_YCBCR_BT709;
> enum igt_color_range color_range = IGT_COLOR_YCBCR_LIMITED_RANGE;
> + uint32_t flags = 0;
> +
> + if (tiling != LOCAL_DRM_FORMAT_MOD_NONE &&
> + tiling != LOCAL_I915_FORMAT_MOD_X_TILED)
> + flags = LOCAL_DRM_MODE_FB_MODIFIERS;
> +
>
> fb_init(fb, fd, width, height, format, tiling,
> color_encoding, color_range);
> @@ -935,7 +941,7 @@ igt_create_fb_with_bo_size(int fd, int width, int height,
> fb->width, fb->height,
> fb->drm_format, fb->tiling,
> fb->strides, fb->offsets, fb->num_planes,
> - LOCAL_DRM_MODE_FB_MODIFIERS,
> + flags,
> &fb->fb_id));
>
> return fb->fb_id;
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 0929c43..017314a 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -1678,7 +1678,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)
> + igt_require_fb_modifiers(fd);
>
> memset(&f, 0, sizeof(f));
>
> --
> 2.7.4
>
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
More information about the igt-dev
mailing list