From: Deepak Rawat <drawat@vmware.com>
To: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
linux-graphics-maintainer@vmware.com
Cc: Deepak Rawat <drawat@vmware.com>, petri.latvala@intel.com
Subject: [igt-dev] [PATCH i-g-t 3/5] lib: Don't call igt_require_fb_modifiers() when no modifier
Date: Tue, 16 Oct 2018 15:23:39 -0700 [thread overview]
Message-ID: <20181016222341.1537-3-drawat@vmware.com> (raw)
In-Reply-To: <20181016222341.1537-1-drawat@vmware.com>
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>
---
lib/igt_fb.c | 7 +++++--
lib/ioctl_wrappers.c | 24 +++++++++++++++---------
lib/ioctl_wrappers.h | 1 +
3 files changed, 21 insertions(+), 11 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;
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 0929c43f..10d32bec 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1646,13 +1646,7 @@ void prime_sync_end(int dma_buf_fd, bool write)
do_ioctl(dma_buf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end);
}
-/**
- * igt_require_fb_modifiers:
- * @fd: Open DRM file descriptor.
- *
- * Requires presence of DRM_CAP_ADDFB2_MODIFIERS.
- */
-void igt_require_fb_modifiers(int fd)
+bool igt_has_fb_modifiers(int fd)
{
static bool has_modifiers, cap_modifiers_tested;
@@ -1666,7 +1660,18 @@ void igt_require_fb_modifiers(int fd)
cap_modifiers_tested = true;
}
- igt_require(has_modifiers);
+ return has_modifiers;
+}
+
+/**
+ * igt_require_fb_modifiers:
+ * @fd: Open DRM file descriptor.
+ *
+ * Requires presence of DRM_CAP_ADDFB2_MODIFIERS.
+ */
+void igt_require_fb_modifiers(int fd)
+{
+ igt_require(igt_has_fb_modifiers(fd));
}
int __kms_addfb(int fd, uint32_t handle,
@@ -1678,7 +1683,8 @@ int __kms_addfb(int fd, uint32_t handle,
struct drm_mode_fb_cmd2 f;
int ret, i;
- igt_require_fb_modifiers(fd);
+ if (flags & DRM_MODE_FB_MODIFIERS)
+ igt_require_fb_modifiers(fd);
memset(&f, 0, sizeof(f));
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index c4e1956c..b22b36b0 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -227,6 +227,7 @@ struct local_drm_mode_fb_cmd2 {
#define LOCAL_DRM_CAP_ADDFB2_MODIFIERS 0x10
+bool igt_has_fb_modifiers(int fd);
void igt_require_fb_modifiers(int fd);
/**
--
2.17.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
WARNING: multiple messages have this Message-ID (diff)
From: Deepak Rawat <drawat@vmware.com>
To: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
linux-graphics-maintainer@vmware.com
Cc: Leo Li <sunpeng.li@amd.com>, Deepak Rawat <drawat@vmware.com>
Subject: [PATCH i-g-t 3/5] lib: Don't call igt_require_fb_modifiers() when no modifier
Date: Tue, 16 Oct 2018 15:23:39 -0700 [thread overview]
Message-ID: <20181016222341.1537-3-drawat@vmware.com> (raw)
In-Reply-To: <20181016222341.1537-1-drawat@vmware.com>
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>
---
lib/igt_fb.c | 7 +++++--
lib/ioctl_wrappers.c | 24 +++++++++++++++---------
lib/ioctl_wrappers.h | 1 +
3 files changed, 21 insertions(+), 11 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;
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 0929c43f..10d32bec 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -1646,13 +1646,7 @@ void prime_sync_end(int dma_buf_fd, bool write)
do_ioctl(dma_buf_fd, LOCAL_DMA_BUF_IOCTL_SYNC, &sync_end);
}
-/**
- * igt_require_fb_modifiers:
- * @fd: Open DRM file descriptor.
- *
- * Requires presence of DRM_CAP_ADDFB2_MODIFIERS.
- */
-void igt_require_fb_modifiers(int fd)
+bool igt_has_fb_modifiers(int fd)
{
static bool has_modifiers, cap_modifiers_tested;
@@ -1666,7 +1660,18 @@ void igt_require_fb_modifiers(int fd)
cap_modifiers_tested = true;
}
- igt_require(has_modifiers);
+ return has_modifiers;
+}
+
+/**
+ * igt_require_fb_modifiers:
+ * @fd: Open DRM file descriptor.
+ *
+ * Requires presence of DRM_CAP_ADDFB2_MODIFIERS.
+ */
+void igt_require_fb_modifiers(int fd)
+{
+ igt_require(igt_has_fb_modifiers(fd));
}
int __kms_addfb(int fd, uint32_t handle,
@@ -1678,7 +1683,8 @@ int __kms_addfb(int fd, uint32_t handle,
struct drm_mode_fb_cmd2 f;
int ret, i;
- igt_require_fb_modifiers(fd);
+ if (flags & DRM_MODE_FB_MODIFIERS)
+ igt_require_fb_modifiers(fd);
memset(&f, 0, sizeof(f));
diff --git a/lib/ioctl_wrappers.h b/lib/ioctl_wrappers.h
index c4e1956c..b22b36b0 100644
--- a/lib/ioctl_wrappers.h
+++ b/lib/ioctl_wrappers.h
@@ -227,6 +227,7 @@ struct local_drm_mode_fb_cmd2 {
#define LOCAL_DRM_CAP_ADDFB2_MODIFIERS 0x10
+bool igt_has_fb_modifiers(int fd);
void igt_require_fb_modifiers(int fd);
/**
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-10-16 22:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 22:23 [igt-dev] [PATCH i-g-t 1/5] lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffers Deepak Rawat
2018-10-16 22:23 ` Deepak Rawat
2018-10-16 22:23 ` [Intel-gfx] [PATCH i-g-t 2/5] lib/igt_fb: Check for cairo surface success Deepak Rawat
2018-10-16 22:23 ` Deepak Rawat
2018-10-16 22:23 ` Deepak Rawat [this message]
2018-10-16 22:23 ` [PATCH i-g-t 3/5] lib: Don't call igt_require_fb_modifiers() when no modifier Deepak Rawat
2018-10-16 22:23 ` [igt-dev] [PATCH i-g-t 4/5] tests/kms_atomic: Add a new test case for FB_DAMAGE_CLIPS plane property Deepak Rawat
2018-10-16 22:23 ` Deepak Rawat
2018-10-16 22:23 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_selftest: Integrate kernel selftest test-drm_modeset Deepak Rawat
2018-10-16 22:23 ` Deepak Rawat
2019-06-20 13:20 ` [igt-dev] [Intel-gfx] " Daniel Vetter
2019-06-20 13:20 ` Daniel Vetter
2019-06-25 6:01 ` [igt-dev] [Intel-gfx] " Arkadiusz Hiler
2019-06-25 6:01 ` Arkadiusz Hiler
2019-06-25 15:37 ` [igt-dev] [Intel-gfx] " Daniel Vetter
2019-06-25 15:37 ` Daniel Vetter
2019-07-03 10:37 ` [igt-dev] [Intel-gfx] " Daniel Vetter
2019-07-03 10:37 ` Daniel Vetter
2019-07-03 10:53 ` [igt-dev] [Intel-gfx] " Arkadiusz Hiler
2019-07-03 10:53 ` Arkadiusz Hiler
2018-10-17 0:09 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] lib/igt_fb: Call dumb_destroy ioctl in case of dumb buffers Patchwork
2018-10-17 2:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
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=20181016222341.1537-3-drawat@vmware.com \
--to=drawat@vmware.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=petri.latvala@intel.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.