[Nouveau] [mesa v2 4/9] nouveau: return nouveau_screen from hw-specific creation functions

Ben Skeggs skeggsb at gmail.com
Thu Nov 26 17:04:56 PST 2015


From: Ben Skeggs <bskeggs at redhat.com>

Kills off a void cast.

Signed-off-by: Ben Skeggs <bskeggs at redhat.com>
---
 src/gallium/drivers/nouveau/nouveau_winsys.h        | 6 +++---
 src/gallium/drivers/nouveau/nv30/nv30_screen.c      | 4 ++--
 src/gallium/drivers/nouveau/nv50/nv50_screen.c      | 4 ++--
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c      | 4 ++--
 src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
index 1319c32..3a686bd 100644
--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
@@ -79,13 +79,13 @@ nouveau_screen_transfer_flags(unsigned pipe)
    return flags;
 }
 
-extern struct pipe_screen *
+extern struct nouveau_screen *
 nv30_screen_create(struct nouveau_device *);
 
-extern struct pipe_screen *
+extern struct nouveau_screen *
 nv50_screen_create(struct nouveau_device *);
 
-extern struct pipe_screen *
+extern struct nouveau_screen *
 nvc0_screen_create(struct nouveau_device *);
 
 #endif
diff --git a/src/gallium/drivers/nouveau/nv30/nv30_screen.c b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
index 154c3d3..ea29811 100644
--- a/src/gallium/drivers/nouveau/nv30/nv30_screen.c
+++ b/src/gallium/drivers/nouveau/nv30/nv30_screen.c
@@ -417,7 +417,7 @@ nv30_screen_destroy(struct pipe_screen *pscreen)
       return NULL;                                    \
    } while(0)
 
-struct pipe_screen *
+struct nouveau_screen *
 nv30_screen_create(struct nouveau_device *dev)
 {
    struct nv30_screen *screen = CALLOC_STRUCT(nv30_screen);
@@ -693,5 +693,5 @@ nv30_screen_create(struct nouveau_device *dev)
    nouveau_pushbuf_kick(push, push->channel);
 
    nouveau_fence_new(&screen->base, &screen->base.fence.current, false);
-   return pscreen;
+   return &screen->base;
 }
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 87a3576..82b9e93 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -747,7 +747,7 @@ int nv50_tls_realloc(struct nv50_screen *screen, unsigned tls_space)
    return 1;
 }
 
-struct pipe_screen *
+struct nouveau_screen *
 nv50_screen_create(struct nouveau_device *dev)
 {
    struct nv50_screen *screen;
@@ -961,7 +961,7 @@ nv50_screen_create(struct nouveau_device *dev)
 
    nouveau_fence_new(&screen->base, &screen->base.fence.current, false);
 
-   return pscreen;
+   return &screen->base;
 
 fail:
    nv50_screen_destroy(pscreen);
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 45ac7f3..e45031a 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -621,7 +621,7 @@ nvc0_screen_resize_tls_area(struct nvc0_screen *screen,
       return NULL;                                    \
    } while(0)
 
-struct pipe_screen *
+struct nouveau_screen *
 nvc0_screen_create(struct nouveau_device *dev)
 {
    struct nvc0_screen *screen;
@@ -1062,7 +1062,7 @@ nvc0_screen_create(struct nouveau_device *dev)
 
    nouveau_fence_new(&screen->base, &screen->base.fence.current, false);
 
-   return pscreen;
+   return &screen->base;
 
 fail:
    nvc0_screen_destroy(pscreen);
diff --git a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
index 3ed644e..e117dfc 100644
--- a/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
+++ b/src/gallium/winsys/nouveau/drm/nouveau_drm_winsys.c
@@ -58,7 +58,7 @@ PUBLIC struct pipe_screen *
 nouveau_drm_screen_create(int fd)
 {
 	struct nouveau_device *dev = NULL;
-	struct pipe_screen *(*init)(struct nouveau_device *);
+	struct nouveau_screen *(*init)(struct nouveau_device *);
 	struct nouveau_screen *screen;
 	int ret, dupfd = -1;
 
@@ -116,7 +116,7 @@ nouveau_drm_screen_create(int fd)
 		goto err;
 	}
 
-	screen = (struct nouveau_screen*)init(dev);
+	screen = init(dev);
 	if (!screen)
 		goto err;
 
-- 
2.6.3



More information about the Nouveau mailing list