Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 371591
b: refs/heads/master
c: db91d68
h: refs/heads/master
i:
  371589: 9d64a36
  371587: b6d9b76
  371583: af447ba
v: v3
  • Loading branch information
Ben Skeggs committed Apr 26, 2013
1 parent ccbfc3b commit 4d7b40f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 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: 43e6e51c037cafac5047a65cfa9d37b450157af1
refs/heads/master: db91d68c9b5ca22e1fa25569bbde4895ade9dac0
19 changes: 13 additions & 6 deletions trunk/drivers/gpu/drm/nouveau/core/core/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,26 +136,30 @@ nouveau_object_ctor(struct nouveau_object *parent,
struct nouveau_object **pobject)
{
struct nouveau_ofuncs *ofuncs = oclass->ofuncs;
struct nouveau_object *object = NULL;
int ret;

*pobject = NULL;

ret = ofuncs->ctor(parent, engine, oclass, data, size, pobject);
ret = ofuncs->ctor(parent, engine, oclass, data, size, &object);
*pobject = object;
if (ret < 0) {
if (ret != -ENODEV) {
nv_error(parent, "failed to create 0x%08x, %d\n",
oclass->handle, ret);
}

if (*pobject) {
ofuncs->dtor(*pobject);
if (object) {
ofuncs->dtor(object);
*pobject = NULL;
}

return ret;
}

nv_debug(*pobject, "created\n");
if (ret == 0) {
nv_debug(object, "created\n");
atomic_set(&object->refcount, 1);
}

return 0;
}

Expand Down Expand Up @@ -327,6 +331,7 @@ nouveau_object_inc(struct nouveau_object *object)
}

ret = nv_ofuncs(object)->init(object);
atomic_set(&object->usecount, 1);
if (ret) {
nv_error(object, "init failed, %d\n", ret);
goto fail_self;
Expand Down Expand Up @@ -357,6 +362,7 @@ nouveau_object_decf(struct nouveau_object *object)
nv_trace(object, "stopping...\n");

ret = nv_ofuncs(object)->fini(object, false);
atomic_set(&object->usecount, 0);
if (ret)
nv_warn(object, "failed fini, %d\n", ret);

Expand All @@ -381,6 +387,7 @@ nouveau_object_decs(struct nouveau_object *object)
nv_trace(object, "suspending...\n");

ret = nv_ofuncs(object)->fini(object, true);
atomic_set(&object->usecount, 0);
if (ret) {
nv_error(object, "failed suspend, %d\n", ret);
return ret;
Expand Down

0 comments on commit 4d7b40f

Please sign in to comment.