@@ -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);