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 BD0EB10E77B for ; Tue, 14 Mar 2023 10:58:35 +0000 (UTC) From: Bhanuprakash Modem To: igt-dev@lists.freedesktop.org, zbigniew.kempczynski@intel.com Date: Tue, 14 Mar 2023 16:24:52 +0530 Message-Id: <20230314105452.2169208-6-bhanuprakash.modem@intel.com> In-Reply-To: <20230314105452.2169208-1-bhanuprakash.modem@intel.com> References: <20230314105452.2169208-1-bhanuprakash.modem@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [i-g-t 5/5] lib/igt_kms: Cache xe_device info for kms tests List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: Create or get xe_device data from Cache, so that all KMS tests will utilize. Signed-off-by: Bhanuprakash Modem --- lib/igt_kms.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/igt_kms.c b/lib/igt_kms.c index 84091d5ce..d88863a90 100644 --- a/lib/igt_kms.c +++ b/lib/igt_kms.c @@ -59,6 +59,7 @@ #include "igt_device.h" #include "igt_sysfs.h" #include "sw_sync.h" +#include "xe/xe_query.h" #ifdef HAVE_CHAMELIUM #include "igt_chamelium.h" #endif @@ -2541,6 +2542,9 @@ void igt_display_require(igt_display_t *display, int drm_fd) } #endif + if (is_xe_device(drm_fd)) + xe_device_get(drm_fd); + /* * With non-contiguous pipes display, crtc mapping is not always same * as pipe mapping, In i915 pipe is enum id of i915's crtc object. @@ -2889,6 +2893,10 @@ static void igt_output_fini(igt_output_t *output) void igt_display_fini(igt_display_t *display) { int i; + int drm_fd = display->drm_fd; + + if (is_xe_device(drm_fd)) + xe_device_put(drm_fd); for (i = 0; i < display->n_planes; ++i) { igt_plane_t *plane = &display->planes[i]; -- 2.39.1