Can be somewhat more informative that way...
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
};
int
-nouveau_client_create_(u32 name, u64 devname, const char *cfg, const char *dbg,
- int length, void **pobject)
+nouveau_client_create_(const char *name, u64 devname, const char *cfg,
+ const char *dbg, int length, void **pobject)
{
struct nouveau_object *device;
struct nouveau_client *client;
atomic_set(&nv_object(client)->usecount, 2);
nouveau_object_ref(device, &client->device);
- client->handle = name;
+ snprintf(client->name, sizeof(client->name), "%s", name);
client->debug = nouveau_dbgopt(dbg, "CLIENT");
return 0;
}
if (level > nv_client(object)->debug)
return;
- snprintf(mfmt, sizeof(mfmt), "%snouveau %c[%8d] %s", pfx,
- name[level], nv_client(object)->handle, fmt);
+ snprintf(mfmt, sizeof(mfmt), "%snouveau %c[%8s] %s", pfx,
+ name[level], nv_client(object)->name, fmt);
} else {
snprintf(mfmt, sizeof(mfmt), "%snouveau: %s", pfx, fmt);
}
struct nouveau_namedb base;
struct nouveau_handle *root;
struct nouveau_object *device;
- u32 handle;
+ char name[16];
u32 debug;
struct nouveau_vm *vm;
};
#define nouveau_client_create(n,c,oc,od,d) \
nouveau_client_create_((n), (c), (oc), (od), sizeof(**d), (void **)d)
-int nouveau_client_create_(u32 name, u64 device, const char *cfg,
+int nouveau_client_create_(const char *name, u64 device, const char *cfg,
const char *dbg, int, void **);
int nouveau_client_init(struct nouveau_client *);
int nouveau_client_fini(struct nouveau_client *, bool suspend);
}
static int
-nouveau_cli_create(struct pci_dev *pdev, u32 name, int size, void **pcli)
+nouveau_cli_create(struct pci_dev *pdev, const char *name,
+ int size, void **pcli)
{
struct nouveau_cli *cli;
int ret;
struct nouveau_drm *drm;
int ret;
- ret = nouveau_cli_create(pdev, 0, sizeof(*drm), (void**)&drm);
+ ret = nouveau_cli_create(pdev, "DRM", sizeof(*drm), (void**)&drm);
if (ret)
return ret;
struct pci_dev *pdev = dev->pdev;
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_cli *cli;
+ char name[16];
int ret;
- ret = nouveau_cli_create(pdev, fpriv->pid, sizeof(*cli), (void **)&cli);
+ snprintf(name, sizeof(name), "%d", fpriv->pid);
+
+ ret = nouveau_cli_create(pdev, name, sizeof(*cli), (void **)&cli);
if (ret)
return ret;