From: <sunpeng.li@amd.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t] lib/igt_fb: Require FB modifiers only when needed
Date: Thu, 11 Oct 2018 18:17:36 -0400 [thread overview]
Message-ID: <1539296256-16598-1-git-send-email-sunpeng.li@amd.com> (raw)
From: Leo Li <sunpeng.li@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@amd.com>
---
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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next reply other threads:[~2018-10-11 22:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 22:17 sunpeng.li [this message]
2018-10-11 22:54 ` [igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_fb: Require FB modifiers only when needed Patchwork
2018-10-12 12:17 ` [igt-dev] [PATCH i-g-t] " Ville Syrjälä
2018-10-12 13:03 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1539296256-16598-1-git-send-email-sunpeng.li@amd.com \
--to=sunpeng.li@amd.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox