Skip to contentSkip to conversation

drm/nouveau: init some list_heads

PATCH In review Maarten Maathuis 3 participants 3 messages Aug 26, 2009 – Sep 1, 2009 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau: init some list_heads

- In the case of nvbo->head it is really important to avoid an OOPS if ttm_buffer_object_init fails.

---
 drivers/gpu/drm/nouveau/nouveau_bo.c      |    2 ++
 drivers/gpu/drm/nouveau/nouveau_channel.c |    1 +
 drivers/gpu/drm/nouveau/nouveau_object.c  |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -0
index 24d6f8f..6b8ef6b 100644
@@ -63,6 +63,8 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan,
 	nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
 	if (!nvbo)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&nvbo->head);
+	INIT_LIST_HEAD(&nvbo->entry);
 	nvbo->mappable = mappable;
 	nvbo->no_vm = no_vm;
 	nvbo->tile_mode = tile_mode;
drivers/gpu/drm/nouveau/nouveau_channel.c +1 -0
index 382c5b5..6c31d7f 100644
@@ -138,6 +138,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
 		return -ENOMEM;
 	dev_priv->fifo_alloc_count++;
 	chan = dev_priv->fifos[channel];
+	INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
 	chan->dev = dev;
 	chan->id = channel;
 	chan->file_priv = file_priv;
drivers/gpu/drm/nouveau/nouveau_object.c +1 -0
index 65d8d25..efcce79 100644
@@ -468,6 +468,7 @@ nouveau_gpuobj_ref_add(struct drm_device *dev, struct nouveau_channel *chan,
 	ref = kzalloc(sizeof(*ref), GFP_KERNEL);
 	if (!ref)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&ref->list);
 	ref->gpuobj   = gpuobj;
 	ref->channel  = chan;
 	ref->instance = instance;
Signature · 1 line
1.6.4

A message that is not in the archive (sent off-list or not yet received): 1251323616-25702-1-git-send-email-madman2003-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 3 lines · On Wed, 26 Aug 2009 23:53:36 +0200 Maarten Maathuis…

- In the case of nvbo->head it is really important to avoid an OOPS if ttm_buffer_object_init fails.

Aren't you going to push this?
I still haven't really reviewed this, but go ahead.

Quoted 51 lines
---
 drivers/gpu/drm/nouveau/nouveau_bo.c      |    2 ++
 drivers/gpu/drm/nouveau/nouveau_channel.c |    1 +
 drivers/gpu/drm/nouveau/nouveau_object.c  |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -0
index 24d6f8f..6b8ef6b 100644
@@ -63,6 +63,8 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan,
 	nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
 	if (!nvbo)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&nvbo->head);
+	INIT_LIST_HEAD(&nvbo->entry);
 	nvbo->mappable = mappable;
 	nvbo->no_vm = no_vm;
 	nvbo->tile_mode = tile_mode;
drivers/gpu/drm/nouveau/nouveau_channel.c +1 -0
index 382c5b5..6c31d7f 100644
@@ -138,6 +138,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
 		return -ENOMEM;
 	dev_priv->fifo_alloc_count++;
 	chan = dev_priv->fifos[channel];
+	INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
 	chan->dev = dev;
 	chan->id = channel;
 	chan->file_priv = file_priv;
drivers/gpu/drm/nouveau/nouveau_object.c +1 -0
index 65d8d25..efcce79 100644
@@ -468,6 +468,7 @@ nouveau_gpuobj_ref_add(struct drm_device *dev, struct nouveau_channel *chan,
 	ref = kzalloc(sizeof(*ref), GFP_KERNEL);
 	if (!ref)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&ref->list);
 	ref->gpuobj   = gpuobj;
 	ref->channel  = chan;
 	ref->instance = instance;
Signature · 6 lines
1.6.4

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Signature · 2 lines
Pekka Paalanen
http://www.iki.fi/pq/

A message that is not in the archive (sent off-list or not yet received): 20090831213734.22cde00a-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org

#4 lore raw
Quoted 9 lines · Pekka Paalanen
Quoted 3 lines · On Wed, 26 Aug 2009 23:53:36 +0200 Maarten Maathuis…

- In the case of nvbo->head it is really important to avoid an OOPS if ttm_buffer_object_init fails.

Aren't you going to push this?
I still haven't really reviewed this, but go ahead.

Looks fine, pushed.

Quoted 54 lines
Quoted 52 lines
---
 drivers/gpu/drm/nouveau/nouveau_bo.c      |    2 ++
 drivers/gpu/drm/nouveau/nouveau_channel.c |    1 +
 drivers/gpu/drm/nouveau/nouveau_object.c  |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -0
index 24d6f8f..6b8ef6b 100644
@@ -63,6 +63,8 @@ nouveau_bo_new(struct drm_device *dev, struct nouveau_channel *chan,
 	nvbo = kzalloc(sizeof(struct nouveau_bo), GFP_KERNEL);
 	if (!nvbo)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&nvbo->head);
+	INIT_LIST_HEAD(&nvbo->entry);
 	nvbo->mappable = mappable;
 	nvbo->no_vm = no_vm;
 	nvbo->tile_mode = tile_mode;
drivers/gpu/drm/nouveau/nouveau_channel.c +1 -0
index 382c5b5..6c31d7f 100644
@@ -138,6 +138,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
 		return -ENOMEM;
 	dev_priv->fifo_alloc_count++;
 	chan = dev_priv->fifos[channel];
+	INIT_LIST_HEAD(&chan->nvsw.vbl_wait);
 	chan->dev = dev;
 	chan->id = channel;
 	chan->file_priv = file_priv;
drivers/gpu/drm/nouveau/nouveau_object.c +1 -0
index 65d8d25..efcce79 100644
@@ -468,6 +468,7 @@ nouveau_gpuobj_ref_add(struct drm_device *dev, struct nouveau_channel *chan,
 	ref = kzalloc(sizeof(*ref), GFP_KERNEL);
 	if (!ref)
 		return -ENOMEM;
+	INIT_LIST_HEAD(&ref->list);
 	ref->gpuobj   = gpuobj;
 	ref->channel  = chan;
 	ref->instance = instance;
Signature · 6 lines
1.6.4

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau