Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org, zbigniew.kempczynski@intel.com
Subject: [igt-dev] [i-g-t 5/5] lib/igt_kms: Cache xe_device info for kms tests
Date: Tue, 14 Mar 2023 16:24:52 +0530	[thread overview]
Message-ID: <20230314105452.2169208-6-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20230314105452.2169208-1-bhanuprakash.modem@intel.com>

Create or get xe_device data from Cache, so that all KMS tests
will utilize.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 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

  parent reply	other threads:[~2023-03-14 10:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 10:54 [igt-dev] [i-g-t 0/5] Add basic helpers to support display in XE Bhanuprakash Modem
2023-03-14 10:54 ` [igt-dev] [i-g-t 1/5] lib/drmtest: Add helpers to check and require the XE driver Bhanuprakash Modem
2023-03-14 11:14   ` Zbigniew Kempczyński
2023-03-14 11:57   ` Mauro Carvalho Chehab
2023-03-14 10:54 ` [igt-dev] [i-g-t 2/5] i915: s/igt_require_intel/igt_require_i915 Bhanuprakash Modem
2023-03-14 11:15   ` Zbigniew Kempczyński
2023-03-14 12:03   ` Mauro Carvalho Chehab
2023-03-14 14:32     ` Modem, Bhanuprakash
2023-03-14 10:54 ` [igt-dev] [i-g-t 3/5] lib/xe/xe_query: Add dev_id() interface Bhanuprakash Modem
2023-03-14 11:17   ` Zbigniew Kempczyński
2023-03-14 12:06   ` Mauro Carvalho Chehab
2023-03-14 10:54 ` [igt-dev] [i-g-t 4/5] lib/intel_chipset: Add support to XE driver to get devid Bhanuprakash Modem
2023-03-14 11:20   ` Zbigniew Kempczyński
2023-03-14 12:08   ` Mauro Carvalho Chehab
2023-03-14 12:20     ` Zbigniew Kempczyński
2023-03-14 14:30       ` Modem, Bhanuprakash
2023-03-14 10:54 ` Bhanuprakash Modem [this message]
2023-03-14 11:38   ` [igt-dev] [i-g-t 5/5] lib/igt_kms: Cache xe_device info for kms tests Zbigniew Kempczyński
2023-03-14 12:08   ` Mauro Carvalho Chehab
2023-03-14 12:45 ` [igt-dev] ✓ Fi.CI.BAT: success for Add basic helpers to support display in XE Patchwork
2023-03-15 16:57 ` [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=20230314105452.2169208-6-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=zbigniew.kempczynski@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox