nouveau/drm: remove nouveau_client::id

No idea what was the original purpose, but in the imported code we don't
need any of that.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27853>
This commit is contained in:
Karol Herbst
2024-02-29 02:15:22 +01:00
committed by Marge Bot
parent 9583fb8d00
commit 4f165117dc
2 changed files with 5 additions and 43 deletions
+5 -42
View File
@@ -318,8 +318,6 @@ struct nouveau_device_priv {
struct nouveau_device base;
simple_mtx_t lock;
struct list_head bo_list;
uint32_t *client;
uint32_t nr_client;
int gart_limit_percent;
int vram_limit_percent;
};
@@ -453,7 +451,6 @@ nouveau_device_del(struct nouveau_device **pdev)
return;
simple_mtx_destroy(&nvdev->lock);
free(nvdev->client);
free(nvdev);
*pdev = NULL;
}
@@ -488,55 +485,21 @@ nouveau_client(struct nouveau_client *client)
int
nouveau_client_new(struct nouveau_device *dev, struct nouveau_client **pclient)
{
struct nouveau_device_priv *nvdev = nouveau_device(dev);
struct nouveau_client_priv *pcli;
int id = 0;
int ret = -ENOMEM;
uint32_t *clients;
simple_mtx_lock(&nvdev->lock);
int i;
for (i = 0; i < nvdev->nr_client; i++) {
id = ffs(nvdev->client[i]) - 1;
if (id >= 0)
goto out;
}
clients = realloc(nvdev->client, sizeof(uint32_t) * (i + 1));
if (!clients)
goto unlock;
nvdev->client = clients;
nvdev->client[i] = 0;
nvdev->nr_client++;
out:
pcli = calloc(1, sizeof(*pcli));
if (pcli) {
nvdev->client[i] |= (1 << id);
pcli->base.device = dev;
pcli->base.id = (i * 32) + id;
ret = 0;
}
struct nouveau_client_priv *pcli = calloc(1, sizeof(*pcli));
if (!pcli)
return -ENOMEM;
pcli->base.device = dev;
*pclient = &pcli->base;
unlock:
simple_mtx_unlock(&nvdev->lock);
return ret;
return 0;
}
void
nouveau_client_del(struct nouveau_client **pclient)
{
struct nouveau_client_priv *pcli = nouveau_client(*pclient);
struct nouveau_device_priv *nvdev;
if (pcli) {
int id = pcli->base.id;
nvdev = nouveau_device(pcli->base.device);
simple_mtx_lock(&nvdev->lock);
nvdev->client[id / 32] &= ~(1 << (id % 32));
simple_mtx_unlock(&nvdev->lock);
free(pcli->kref);
free(pcli);
}
-1
View File
@@ -54,7 +54,6 @@ struct nouveau_device {
struct nouveau_client {
struct nouveau_device *device;
int id;
};
union nouveau_bo_config {