@@ -57,7 +57,7 @@ struct igt_drm_clients *igt_drm_clients_init(void *private_data)
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;
@@ -69,7 +69,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;
}
@@ -123,9 +124,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;
@@ -359,11 +361,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);
@@ -87,7 +87,7 @@ igt_drm_clients_scan(struct igt_drm_clients *clients,
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);
struct igt_drm_clients *
igt_drm_clients_sort(struct igt_drm_clients *clients,