From: Haneen Mohammed <hamohammed.sa@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_cursor_crc: Open DRM device with DRIVER_ANY
Date: Sun, 12 Aug 2018 23:03:41 +0300 [thread overview]
Message-ID: <20180812200341.GA17162@haneenDRM> (raw)
So that this test can be run in drivers other than i915.
Remove devid and only check it if the driver is i915.
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
tests/kms_cursor_crc.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a164839e..870d7fec 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -59,7 +59,6 @@ typedef struct {
int curw, curh; /* cursor size */
int cursor_max_w, cursor_max_h;
igt_pipe_crc_t *pipe_crc;
- uint32_t devid;
unsigned flags;
} data_t;
@@ -108,6 +107,13 @@ static void cursor_disable(data_t *data)
static bool chv_cursor_broken(data_t *data, int x)
{
+ uint32_t devid;
+
+ if (!is_i915_device(data->drm_fd))
+ return false;
+
+ devid = intel_get_drm_devid(data->drm_fd);
+
/*
* CHV gets a FIFO underrun on pipe C when cursor x coordinate
* is negative and the cursor visible.
@@ -121,7 +127,7 @@ static bool chv_cursor_broken(data_t *data, int x)
if (x >= 0)
return false;
- return IS_CHERRYVIEW(data->devid) && data->pipe == PIPE_C;
+ return IS_CHERRYVIEW(devid) && data->pipe == PIPE_C;
}
static bool cursor_visible(data_t *data, int x, int y)
@@ -459,8 +465,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
igt_put_cairo_ctx(data->drm_fd, &data->fb, cr);
}
-static bool has_nonsquare_cursors(uint32_t devid)
+static bool has_nonsquare_cursors(data_t *data)
{
+ uint32_t devid;
+
+ if (!is_i915_device(data->drm_fd))
+ return true;
+
+ devid = intel_get_drm_devid(data->drm_fd);
+
/*
* Test non-square cursors a bit on the platforms
* that support such things.
@@ -616,19 +629,19 @@ static void run_test_generic(data_t *data)
/* Using created cursor FBs to test cursor support */
igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_onscreen, w, h);
}
igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_offscreen, w, h);
}
igt_subtest_f("cursor-%dx%d-sliding", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_sliding, w, h);
}
igt_subtest_f("cursor-%dx%d-random", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_random, w, h);
}
@@ -647,9 +660,7 @@ igt_main
igt_skip_on_simulation();
igt_fixture {
- data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
-
- data.devid = intel_get_drm_devid(data.drm_fd);
+ data.drm_fd = drm_open_driver_master(DRIVER_ANY);
ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
igt_assert(ret == 0 || errno == EINVAL);
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Haneen Mohammed <hamohammed.sa@gmail.com>
To: igt-dev@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t] tests/kms_cursor_crc: Open DRM device with DRIVER_ANY
Date: Sun, 12 Aug 2018 23:03:41 +0300 [thread overview]
Message-ID: <20180812200341.GA17162@haneenDRM> (raw)
So that this test can be run in drivers other than i915.
Remove devid and only check it if the driver is i915.
Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
---
tests/kms_cursor_crc.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index a164839e..870d7fec 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -59,7 +59,6 @@ typedef struct {
int curw, curh; /* cursor size */
int cursor_max_w, cursor_max_h;
igt_pipe_crc_t *pipe_crc;
- uint32_t devid;
unsigned flags;
} data_t;
@@ -108,6 +107,13 @@ static void cursor_disable(data_t *data)
static bool chv_cursor_broken(data_t *data, int x)
{
+ uint32_t devid;
+
+ if (!is_i915_device(data->drm_fd))
+ return false;
+
+ devid = intel_get_drm_devid(data->drm_fd);
+
/*
* CHV gets a FIFO underrun on pipe C when cursor x coordinate
* is negative and the cursor visible.
@@ -121,7 +127,7 @@ static bool chv_cursor_broken(data_t *data, int x)
if (x >= 0)
return false;
- return IS_CHERRYVIEW(data->devid) && data->pipe == PIPE_C;
+ return IS_CHERRYVIEW(devid) && data->pipe == PIPE_C;
}
static bool cursor_visible(data_t *data, int x, int y)
@@ -459,8 +465,15 @@ static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
igt_put_cairo_ctx(data->drm_fd, &data->fb, cr);
}
-static bool has_nonsquare_cursors(uint32_t devid)
+static bool has_nonsquare_cursors(data_t *data)
{
+ uint32_t devid;
+
+ if (!is_i915_device(data->drm_fd))
+ return true;
+
+ devid = intel_get_drm_devid(data->drm_fd);
+
/*
* Test non-square cursors a bit on the platforms
* that support such things.
@@ -616,19 +629,19 @@ static void run_test_generic(data_t *data)
/* Using created cursor FBs to test cursor support */
igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_onscreen, w, h);
}
igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_offscreen, w, h);
}
igt_subtest_f("cursor-%dx%d-sliding", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_sliding, w, h);
}
igt_subtest_f("cursor-%dx%d-random", w, h) {
- igt_require(has_nonsquare_cursors(data->devid));
+ igt_require(has_nonsquare_cursors(data));
run_test(data, test_crc_random, w, h);
}
@@ -647,9 +660,7 @@ igt_main
igt_skip_on_simulation();
igt_fixture {
- data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
-
- data.devid = intel_get_drm_devid(data.drm_fd);
+ data.drm_fd = drm_open_driver_master(DRIVER_ANY);
ret = drmGetCap(data.drm_fd, DRM_CAP_CURSOR_WIDTH, &cursor_width);
igt_assert(ret == 0 || errno == EINVAL);
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next reply other threads:[~2018-08-12 20:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-12 20:03 Haneen Mohammed [this message]
2018-08-12 20:03 ` [PATCH i-g-t] tests/kms_cursor_crc: Open DRM device with DRIVER_ANY Haneen Mohammed
2018-08-14 8:54 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-08-14 9:24 ` [igt-dev] [PATCH i-g-t] " Daniel Vetter
2018-08-14 9:24 ` Daniel Vetter
2018-08-14 10:06 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=20180812200341.GA17162@haneenDRM \
--to=hamohammed.sa@gmail.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@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 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.