From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 07FC110E8BA for ; Fri, 23 Sep 2022 19:52:32 +0000 (UTC) From: Umesh Nerlige Ramappa To: igt-dev@lists.freedesktop.org, Lionel G Landwerlin , Ashutosh Dixit Date: Fri, 23 Sep 2022 19:52:17 +0000 Message-Id: <20220923195224.283045-11-umesh.nerlige.ramappa@intel.com> In-Reply-To: <20220923195224.283045-1-umesh.nerlige.ramappa@intel.com> References: <20220923195224.283045-1-umesh.nerlige.ramappa@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t v4 10/17] i915/perf: Skip tests that use rendercopy List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Running tests that require rendercopy sometimes leaves the DUT in an unsusable state. Further tests fail to run and DUT requires reboot. Since it affects CI efficiency, skip tests is rendercopy is missing. Signed-off-by: Umesh Nerlige Ramappa Reviewed-by: Lionel Landwerlin --- tests/i915/perf.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/i915/perf.c b/tests/i915/perf.c index 989f1fce..6079d1b1 100644 --- a/tests/i915/perf.c +++ b/tests/i915/perf.c @@ -41,6 +41,7 @@ #include "i915/gem.h" #include "i915/perf.h" #include "igt.h" +#include "igt_perf.h" #include "igt_sysfs.h" #include "drm.h" @@ -4968,6 +4969,19 @@ static int i915_perf_revision(int fd) return value; } +static bool has_class_instance(int i915, uint16_t class, uint16_t instance) +{ + int fd; + + fd = perf_i915_open(i915, I915_PMU_ENGINE_BUSY(class, instance)); + if (fd >= 0) { + close(fd); + return true; + } + + return false; +} + igt_main { igt_fixture { @@ -5012,7 +5026,8 @@ igt_main gt_max_freq_mhz = sysfs_read(RPS_RP0_FREQ_MHZ); - render_copy = igt_get_render_copyfunc(devid); + if (has_class_instance(drm_fd, I915_ENGINE_CLASS_RENDER, 0)) + render_copy = igt_get_render_copyfunc(devid); } igt_subtest("non-system-wide-paranoid") -- 2.25.1