From: <mla...@ke...> - 2014-10-23 06:25:46
|
src/nouveau_dri2.c | 10 ++++++---- src/nouveau_glamor.c | 2 ++ src/nv_driver.c | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) New commits: commit 90ba0bb6a371a5beebdf6d363bcd73659b7c9f1f Author: Maarten Lankhorst <maa...@ub...> Date: Thu Oct 23 08:25:01 2014 +0200 check memory allocation in nouveau_glamor_set_shared_pixmap_backing As reported by Roy Spliet. diff --git a/src/nouveau_glamor.c b/src/nouveau_glamor.c index 165e997..b8bca17 100644 --- a/src/nouveau_glamor.c +++ b/src/nouveau_glamor.c @@ -131,6 +131,8 @@ nouveau_glamor_set_shared_pixmap_backing(PixmapPtr pixmap, void *_handle) if (!priv) { priv = calloc(1, sizeof(*priv)); + if (!priv) + return FALSE; nouveau_glamor_pixmap_set(pixmap, priv); } commit 4dfa13c77a1f6cee1affea05b5f3a0b26827d366 Author: Maarten Lankhorst <maa...@ub...> Date: Thu Oct 23 08:21:55 2014 +0200 rework initialization to prevent some crashes diff --git a/src/nv_driver.c b/src/nv_driver.c index 8c33e0e..e726292 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -1352,8 +1352,6 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL) } nouveau_copy_init(pScreen); - nouveau_sync_init(pScreen); - nouveau_dri2_init(pScreen); /* Allocate and map memory areas we need */ if (!NVMapMem(pScrn)) @@ -1462,15 +1460,17 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL) xf86SetBlackWhitePixels(pScreen); nouveau_present_init(pScreen); + nouveau_sync_init(pScreen); + nouveau_dri2_init(pScreen); if (pNv->AccelMethod == GLAMOR) { if (!nouveau_glamor_init(pScreen)) return FALSE; } else if (pNv->AccelMethod == EXA) { - if (!nouveau_exa_init(pScreen)) + if (!nouveau_dri3_screen_init(pScreen)) return FALSE; - if (!nouveau_dri3_screen_init(pScreen)) + if (!nouveau_exa_init(pScreen)) return FALSE; } commit 485902e61b18aff864226db62ba10399aab40128 Author: Maarten Lankhorst <maa...@ub...> Date: Wed Oct 22 15:52:22 2014 +0200 fix !DRI3 case diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c index 6c1260c..6876f9c 100644 --- a/src/nouveau_dri2.c +++ b/src/nouveau_dri2.c @@ -1112,10 +1112,12 @@ static dri3_screen_info_rec nouveau_dri3_screen_info = { .pixmap_from_fd = nouveau_dri3_pixmap_from_fd, .fd_from_pixmap = nouveau_dri3_fd_from_pixmap }; +#endif Bool nouveau_dri3_screen_init(ScreenPtr screen) { +#ifdef DRI3 ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); NVPtr pNv = NVPTR(pScrn); struct stat master, render; @@ -1131,9 +1133,9 @@ nouveau_dri3_screen_init(ScreenPtr screen) (render.st_rdev & ~0x80) == master.st_rdev) pNv->render_node = strdup(buf); - if (!pNv->render_node) - return TRUE; + if (pNv->render_node) + return dri3_screen_init(screen, &nouveau_dri3_screen_info); +#endif - return dri3_screen_init(screen, &nouveau_dri3_screen_info); + return TRUE; } -#endif |