diff options
author | Victor Stinner <[email protected]> | 2009-03-06 13:52:19 +0100 |
---|---|---|
committer | Ben Skeggs <[email protected]> | 2009-03-07 17:49:08 +1000 |
commit | 19229fcf3a6eaf5e64b10b43aa5e8619444791b4 (patch) | |
tree | b7bbbdfc9f0cecdbc1dbdb1192e6dc2396b50c7f /src | |
parent | a06dd4de8756d7ebe99ed414c8d8dca5083241b8 (diff) |
Fix nouveau_pipe_create() / nouveau_context_init(): raise an error if the screen/pipe creation failed
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/winsys/drm/nouveau/common/nouveau_context.c | 6 | ||||
-rw-r--r-- | src/gallium/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 25c98456ac4..d9321eaa3f9 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 b6199f8e6db..52c3b022475 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]; } |