All of lore.kernel.org
 help / color / mirror / Atom feed
From: Victor Stinner <victor.stinner-XgyrR7WU8tJ8UrSeD/g0lQ@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH] Fix nouveau_pipe_create() / nouveau_context_init()
Date: Fri, 06 Mar 2009 13:59:45 +0100	[thread overview]
Message-ID: <49B11E41.8050804@haypocalc.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 159 bytes --]

My first patch to help the gallium driver :-)

Fix nouveau_pipe_create() / nouveau_context_init(): raise an error if 
the screen/pipe creation failed.

Victor

[-- Attachment #2: 0001-Fix-nouveau_pipe_create-nouveau_context_init.patch --]
[-- Type: text/x-patch, Size: 1920 bytes --]

From 69086668a51278c0e985ef3018df14477e41416b Mon Sep 17 00:00:00 2001
From: Victor Stinner <victor.stinner-XgyrR7WU8tJ8UrSeD/g0lQ@public.gmane.org>
Date: Fri, 6 Mar 2009 13:52:19 +0100
Subject: [PATCH] Fix nouveau_pipe_create() / nouveau_context_init(): raise an error if
 the screen/pipe creation failed

---
 .../winsys/drm/nouveau/common/nouveau_context.c    |    6 ++++--
 .../winsys/drm/nouveau/common/nouveau_winsys.c     |    7 ++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
index 25c9845..d9321ea 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_context.c
@@ -132,8 +132,10 @@ nouveau_context_init(struct nouveau_screen *nv_screen,
 		struct pipe_screen *pscreen;
 
 		pipe = nouveau_pipe_create(nv);
-		if (!pipe)
+		if (!pipe) {
 			NOUVEAU_ERR("Couldn't create hw pipe\n");
+			return 1;
+		}
 		pscreen = nvc->pscreen;
 
 		nv->cap.hw_vertex_buffer =
@@ -199,7 +201,7 @@ nouveau_context_cleanup(struct nouveau_context *nv)
 			nv->nv_screen->nvc = NULL;
 		}
 	}
-	
+
 	/* XXX: Who cleans up the pipe? */
 }
 
diff --git a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
index b6199f8..52c3b02 100644
--- a/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
+++ b/src/gallium/winsys/drm/nouveau/common/nouveau_winsys.c
@@ -133,8 +133,13 @@ nouveau_pipe_create(struct nouveau_context *nv)
 
 	ws = nouveau_create_pipe_winsys(nv);
 
-	if (!nvc->pscreen)
+	if (!nvc->pscreen) {
 		nvc->pscreen = hws_create(ws, nvws);
+		if (!nvc->pscreen) {
+			NOUVEAU_ERR("Couldn't create hw screen\n");
+			return NULL;
+		}
+	}
 	nvc->pctx[nv->pctx_id] = hw_create(nvc->pscreen, nv->pctx_id);
 	return nvc->pctx[nv->pctx_id];
 }
-- 
1.5.6.3


[-- Attachment #3: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

             reply	other threads:[~2009-03-06 12:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06 12:59 Victor Stinner [this message]
     [not found] ` <49B11E41.8050804-XgyrR7WU8tJ8UrSeD/g0lQ@public.gmane.org>
2009-03-07  7:51   ` [PATCH] Fix nouveau_pipe_create() / nouveau_context_init() Ben Skeggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49B11E41.8050804@haypocalc.com \
    --to=victor.stinner-xgyrr7wu8tj8ursed/g0lq@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.