aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/core/core
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-08-13 16:26:07 +1000
committerBen Skeggs <bskeggs@redhat.com>2012-10-03 13:13:03 +1000
commit72a148277701acf56bcec486a1124499600812e1 (patch)
treeb1b53a80b8c4bfd7b7fd731079f35a2d47b51476 /drivers/gpu/drm/nouveau/core/core
parent4c2d42225b5024ad88f736608f44b51f702bd4e4 (diff)
drm/nouveau: restore fifo chid information in engine error messages
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/core')
-rw-r--r--drivers/gpu/drm/nouveau/core/core/engctx.c57
-rw-r--r--drivers/gpu/drm/nouveau/core/core/handle.c34
2 files changed, 47 insertions, 44 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/engctx.c b/drivers/gpu/drm/nouveau/core/core/engctx.c
index ad4bbe106b0..e41b10d5eb5 100644
--- a/drivers/gpu/drm/nouveau/core/core/engctx.c
+++ b/drivers/gpu/drm/nouveau/core/core/engctx.c
@@ -59,7 +59,6 @@ nouveau_engctx_create_(struct nouveau_object *parent,
{
struct nouveau_client *client = nouveau_client(parent);
struct nouveau_engine *engine = nv_engine(engobj);
- struct nouveau_subdev *subdev = nv_subdev(engine);
struct nouveau_object *engctx;
unsigned long save;
int ret;
@@ -210,58 +209,28 @@ _nouveau_engctx_fini(struct nouveau_object *object, bool suspend)
}
struct nouveau_object *
-nouveau_engctx_lookup(struct nouveau_engine *engine, u64 addr)
+nouveau_engctx_get(struct nouveau_engine *engine, u64 addr)
{
struct nouveau_engctx *engctx;
+ unsigned long flags;
+ spin_lock_irqsave(&engine->lock, flags);
list_for_each_entry(engctx, &engine->contexts, head) {
- if (engctx->base.size &&
- nv_gpuobj(engctx)->addr == addr)
+ if (engctx->addr == addr) {
+ engctx->save = flags;
return nv_object(engctx);
+ }
}
-
- return NULL;
-}
-
-struct nouveau_handle *
-nouveau_engctx_lookup_class(struct nouveau_engine *engine, u64 addr, u16 oclass)
-{
- struct nouveau_object *engctx = nouveau_engctx_lookup(engine, addr);
- struct nouveau_namedb *namedb;
-
- if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
- return nouveau_namedb_get_class(namedb, oclass);
-
- return NULL;
-}
-
-struct nouveau_handle *
-nouveau_engctx_lookup_vinst(struct nouveau_engine *engine, u64 addr, u64 vinst)
-{
- struct nouveau_object *engctx = nouveau_engctx_lookup(engine, addr);
- struct nouveau_namedb *namedb;
-
- if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
- return nouveau_namedb_get_vinst(namedb, vinst);
-
- return NULL;
-}
-
-struct nouveau_handle *
-nouveau_engctx_lookup_cinst(struct nouveau_engine *engine, u64 addr, u32 cinst)
-{
- struct nouveau_object *engctx = nouveau_engctx_lookup(engine, addr);
- struct nouveau_namedb *namedb;
-
- if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
- return nouveau_namedb_get_cinst(namedb, cinst);
-
+ spin_unlock_irqrestore(&engine->lock, flags);
return NULL;
}
void
-nouveau_engctx_handle_put(struct nouveau_handle *handle)
+nouveau_engctx_put(struct nouveau_object *object)
{
- if (handle)
- nouveau_namedb_put(handle);
+ if (object) {
+ struct nouveau_engine *engine = nv_engine(object->engine);
+ struct nouveau_engctx *engctx = nv_engctx(object);
+ spin_unlock_irqrestore(&engine->lock, engctx->save);
+ }
}
diff --git a/drivers/gpu/drm/nouveau/core/core/handle.c b/drivers/gpu/drm/nouveau/core/core/handle.c
index f2ab2e85009..b8d2cbf8a7a 100644
--- a/drivers/gpu/drm/nouveau/core/core/handle.c
+++ b/drivers/gpu/drm/nouveau/core/core/handle.c
@@ -187,3 +187,37 @@ nouveau_handle_ref(struct nouveau_object *parent, u32 name)
return object;
}
+
+struct nouveau_handle *
+nouveau_handle_get_class(struct nouveau_object *engctx, u16 oclass)
+{
+ struct nouveau_namedb *namedb;
+ if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
+ return nouveau_namedb_get_class(namedb, oclass);
+ return NULL;
+}
+
+struct nouveau_handle *
+nouveau_handle_get_vinst(struct nouveau_object *engctx, u64 vinst)
+{
+ struct nouveau_namedb *namedb;
+ if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
+ return nouveau_namedb_get_vinst(namedb, vinst);
+ return NULL;
+}
+
+struct nouveau_handle *
+nouveau_handle_get_cinst(struct nouveau_object *engctx, u32 cinst)
+{
+ struct nouveau_namedb *namedb;
+ if (engctx && (namedb = (void *)nv_pclass(engctx, NV_NAMEDB_CLASS)))
+ return nouveau_namedb_get_cinst(namedb, cinst);
+ return NULL;
+}
+
+void
+nouveau_handle_put(struct nouveau_handle *handle)
+{
+ if (handle)
+ nouveau_namedb_put(handle);
+}