From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t 4/8] libdrmclient: Support multiple DRM cards
Date: Fri, 11 Nov 2022 15:58:40 +0000 [thread overview]
Message-ID: <20221111155844.3290531-5-tvrtko.ursulin@linux.intel.com> (raw)
In-Reply-To: <20221111155844.3290531-1-tvrtko.ursulin@linux.intel.com>
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Require DRM minor match during client lookup.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
lib/igt_drm_clients.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/lib/igt_drm_clients.c b/lib/igt_drm_clients.c
index c23a3fae9793..e11c8b18188f 100644
--- a/lib/igt_drm_clients.c
+++ b/lib/igt_drm_clients.c
@@ -49,7 +49,7 @@ struct igt_drm_clients *igt_drm_clients_init(void *private_data)
static struct igt_drm_client *
igt_drm_clients_find(struct igt_drm_clients *clients,
enum igt_drm_client_status status,
- unsigned int id)
+ unsigned int drm_minor, unsigned int id)
{
unsigned int start, num;
struct igt_drm_client *c;
@@ -61,7 +61,8 @@ igt_drm_clients_find(struct igt_drm_clients *clients,
if (status != c->status)
continue;
- if (status == IGT_DRM_CLIENT_FREE || c->id == id)
+ if (status == IGT_DRM_CLIENT_FREE ||
+ (drm_minor == c->drm_minor && c->id == id))
return c;
}
@@ -119,9 +120,10 @@ igt_drm_client_add(struct igt_drm_clients *clients,
{
struct igt_drm_client *c;
- assert(!igt_drm_clients_find(clients, IGT_DRM_CLIENT_ALIVE, info->id));
+ assert(!igt_drm_clients_find(clients, IGT_DRM_CLIENT_ALIVE,
+ drm_minor, info->id));
- c = igt_drm_clients_find(clients, IGT_DRM_CLIENT_FREE, 0);
+ c = igt_drm_clients_find(clients, IGT_DRM_CLIENT_FREE, 0, 0);
if (!c) {
unsigned int idx = clients->num_clients;
@@ -411,11 +413,11 @@ igt_drm_clients_scan(struct igt_drm_clients *clients,
continue;
if (igt_drm_clients_find(clients, IGT_DRM_CLIENT_ALIVE,
- info.id))
+ minor, info.id))
continue; /* Skip duplicate fds. */
c = igt_drm_clients_find(clients, IGT_DRM_CLIENT_PROBE,
- info.id);
+ minor, info.id);
if (!c)
igt_drm_client_add(clients, &info, client_pid,
client_name, minor);
--
2.34.1
next prev parent reply other threads:[~2022-11-11 15:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-11 15:58 [igt-dev] [PATCH i-g-t 0/8] Vendor agnostic gputop Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 1/8] lib: Extract igt_drm_clients from intel_gpu_top Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 2/8] libdrmfdinfo: Allow specifying custom engine map Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 3/8] libdrmclients: Record client drm minor Tvrtko Ursulin
2022-11-11 15:58 ` Tvrtko Ursulin [this message]
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 5/8] libdrmfdinfo: Track largest engine index Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 6/8] libdrmclient/intel_gpu_top: Decouple hardcoded engine assumptions Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 7/8] libdrmclient: Enforce client status sort order in the library Tvrtko Ursulin
2022-11-11 15:58 ` [igt-dev] [PATCH i-g-t 8/8] gputop: Basic vendor agnostic GPU top tool Tvrtko Ursulin
2022-11-16 13:43 ` Philipp Zabel
2022-11-11 17:22 ` [igt-dev] ✓ Fi.CI.BAT: success for Vendor agnostic gputop (rev4) Patchwork
2022-11-12 10:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-01-26 17:02 ` [igt-dev] [Intel-gfx] [PATCH i-g-t 0/8] Vendor agnostic gputop Kamil Konieczny
2023-01-27 13:41 ` Tvrtko Ursulin
-- strict thread matches above, loose matches on Subject: below --
2022-06-16 14:06 [igt-dev] " Tvrtko Ursulin
2022-06-16 14:06 ` [igt-dev] [PATCH i-g-t 4/8] libdrmclient: Support multiple DRM cards Tvrtko Ursulin
2022-05-11 12:18 [igt-dev] [PATCH i-g-t 0/8] Vendor agnostic gputop Tvrtko Ursulin
2022-05-11 12:18 ` [igt-dev] [PATCH i-g-t 4/8] libdrmclient: Support multiple DRM cards Tvrtko Ursulin
2022-04-05 8:41 [igt-dev] [PATCH i-g-t 0/8] Vendor agnostic gputop Tvrtko Ursulin
2022-04-05 8:41 ` [igt-dev] [PATCH i-g-t 4/8] libdrmclient: Support multiple DRM cards Tvrtko Ursulin
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=20221111155844.3290531-5-tvrtko.ursulin@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=Intel-gfx@lists.freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@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