Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358259
b: refs/heads/master
c: a2896ce
h: refs/heads/master
i:
  358257: bcfce89
  358255: f52d7ee
v: v3
  • Loading branch information
Marcin Slusarz authored and Ben Skeggs committed Feb 20, 2013
1 parent bd844cb commit 619c029
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f533da1027e294a2d6e0b455bf8ee915609ff216
refs/heads/master: a2896cede08ddeed4f2c4fca616943a63dff5fa8
10 changes: 10 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/core/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,13 @@ nouveau_client_fini(struct nouveau_client *client, bool suspend)
nv_debug(client, "%s completed with %d\n", name[suspend], ret);
return ret;
}

const char *
nouveau_client_name(void *obj)
{
const char *client_name = "unknown";
struct nouveau_client *client = nouveau_client(obj);
if (client)
client_name = client->name;
return client_name;
}
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/core/core/enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ nouveau_enum_find(const struct nouveau_enum *en, u32 value)
return NULL;
}

void
const struct nouveau_enum *
nouveau_enum_print(const struct nouveau_enum *en, u32 value)
{
en = nouveau_enum_find(en, value);
if (en)
pr_cont("%s", en->name);
else
pr_cont("(unknown enum 0x%08x)", value);
return en;
}

void
Expand Down
15 changes: 15 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/engine/fifo/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* Authors: Ben Skeggs
*/

#include <core/client.h>
#include <core/object.h>
#include <core/handle.h>
#include <core/class.h>
Expand Down Expand Up @@ -146,6 +147,20 @@ nouveau_fifo_chid(struct nouveau_fifo *priv, struct nouveau_object *object)
return -1;
}

const char *
nouveau_client_name_for_fifo_chid(struct nouveau_fifo *fifo, u32 chid)
{
struct nouveau_fifo_chan *chan = NULL;
unsigned long flags;

spin_lock_irqsave(&fifo->lock, flags);
if (chid >= fifo->min && chid <= fifo->max)
chan = (void *)fifo->channel[chid];
spin_unlock_irqrestore(&fifo->lock, flags);

return nouveau_client_name(chan);
}

void
nouveau_fifo_destroy(struct nouveau_fifo *priv)
{
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/core/include/core/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct nouveau_client {
struct nouveau_namedb base;
struct nouveau_handle *root;
struct nouveau_object *device;
char name[16];
char name[32];
u32 debug;
struct nouveau_vm *vm;
};
Expand Down Expand Up @@ -41,5 +41,6 @@ int nouveau_client_create_(const char *name, u64 device, const char *cfg,

int nouveau_client_init(struct nouveau_client *);
int nouveau_client_fini(struct nouveau_client *, bool suspend);
const char *nouveau_client_name(void *obj);

#endif
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/core/include/core/enum.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ struct nouveau_enum {
u32 value;
const char *name;
const void *data;
u32 data2;
};

const struct nouveau_enum *
nouveau_enum_find(const struct nouveau_enum *, u32 value);

void
const struct nouveau_enum *
nouveau_enum_print(const struct nouveau_enum *en, u32 value);

struct nouveau_bitfield {
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/core/include/engine/fifo.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ int nouveau_fifo_create_(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, int min, int max,
int size, void **);
void nouveau_fifo_destroy(struct nouveau_fifo *);
const char *
nouveau_client_name_for_fifo_chid(struct nouveau_fifo *fifo, u32 chid);

#define _nouveau_fifo_init _nouveau_engine_init
#define _nouveau_fifo_fini _nouveau_engine_fini
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/gpu/drm/nouveau/nouveau_drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,11 @@ nouveau_drm_open(struct drm_device *dev, struct drm_file *fpriv)
struct pci_dev *pdev = dev->pdev;
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_cli *cli;
char name[16];
char name[32], tmpname[TASK_COMM_LEN];
int ret;

snprintf(name, sizeof(name), "%d", pid_nr(fpriv->pid));
get_task_comm(tmpname, current);
snprintf(name, sizeof(name), "%s[%d]", tmpname, pid_nr(fpriv->pid));

ret = nouveau_cli_create(pdev, name, sizeof(*cli), (void **)&cli);
if (ret)
Expand Down

0 comments on commit 619c029

Please sign in to comment.