diff options
author | Deepak Rawat <drawat@vmware.com> | 2018-10-16 15:23:39 -0700 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-10-17 09:41:00 +0200 |
commit | 759af708db65d8f9fc2218e3445cfb903c8be72a (patch) | |
tree | f846396bbc469f8974d10e84e60e42e6a004d282 /lib/igt_fb.c | |
parent | c7034c780629b6f678dfe5021c38bc820a34e19d (diff) |
lib: Don't call igt_require_fb_modifiers() when no modifier
vmwgfx and amdgpu doesn't support fb modifiers, yet kms_addfb() requires
modifier support. Since many tests don't need this to run, the
requirement can be made less broad.
Therefore, tighten the requirement to cases where modifiers are actually
needed.
v2:
* In create_fb() calls to kms_addfb(), remove the modifier flag iff the
driver doesn't support modifiers and the modifer is 0
* Don't modify the flag in kms_addfb().
Signed-off-by: Deepak Rawat <drawat@vmware.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/igt_fb.c')
-rw-r--r-- | lib/igt_fb.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/igt_fb.c b/lib/igt_fb.c index 1bb6d324..5dca1cfa 100644 --- a/lib/igt_fb.c +++ b/lib/igt_fb.c @@ -913,6 +913,7 @@ 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; fb_init(fb, fd, width, height, format, tiling, color_encoding, color_range); @@ -931,11 +932,13 @@ igt_create_fb_with_bo_size(int fd, int width, int height, igt_debug("%s(handle=%d, pitch=%d)\n", __func__, fb->gem_handle, fb->strides[0]); + if (fb->tiling || igt_has_fb_modifiers(fd)) + flags = LOCAL_DRM_MODE_FB_MODIFIERS; + do_or_die(__kms_addfb(fb->fd, fb->gem_handle, fb->width, fb->height, fb->drm_format, fb->tiling, - fb->strides, fb->offsets, fb->num_planes, - LOCAL_DRM_MODE_FB_MODIFIERS, + fb->strides, fb->offsets, fb->num_planes, flags, &fb->fb_id)); return fb->fb_id; |