[Mesa-dev] [PATCH 3/7] nv50,nvc0: simplify screen.fence

Karol Herbst kherbst at redhat.com
Wed Dec 5 21:04:53 UTC 2018


Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 src/gallium/drivers/nouveau/nv50/nv50_screen.c | 4 ++--
 src/gallium/drivers/nouveau/nv50/nv50_screen.h | 1 -
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 4 ++--
 src/gallium/drivers/nouveau/nvc0/nvc0_screen.h | 1 -
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
index 4defb29d369..0fc7002d640 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c
@@ -567,7 +567,8 @@ nv50_screen_fence_emit(struct pipe_screen *pscreen, u32 *sequence)
 static u32
 nv50_screen_fence_update(struct pipe_screen *pscreen)
 {
-   return nv50_screen(pscreen)->fence.map[0];
+   uint32_t *map = nv50_screen(pscreen)->fence.bo->map;
+   return map[0];
 }
 
 static void
@@ -934,7 +935,6 @@ nv50_screen_create(struct nouveau_device *dev)
    }
 
    nouveau_bo_map(screen->fence.bo, 0, NULL);
-   screen->fence.map = screen->fence.bo->map;
    screen->base.fence.emit = nv50_screen_fence_emit;
    screen->base.fence.update = nv50_screen_fence_update;
 
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.h b/src/gallium/drivers/nouveau/nv50/nv50_screen.h
index 6f3b40c37b8..1b7fc4d0247 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_screen.h
+++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.h
@@ -96,7 +96,6 @@ struct nv50_screen {
    } tsc;
 
    struct {
-      uint32_t *map;
       struct nouveau_bo *bo;
    } fence;
 
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 48b36ae4193..6fb95e89712 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -749,7 +749,8 @@ static u32
 nvc0_screen_fence_update(struct pipe_screen *pscreen)
 {
    struct nvc0_screen *screen = nvc0_screen(pscreen);
-   return screen->fence.map[0];
+   uint32_t *map = screen->fence.bo->map;
+   return map[0];
 }
 
 static int
@@ -972,7 +973,6 @@ nvc0_screen_create(struct nouveau_device *dev)
    if (ret)
       FAIL_SCREEN_INIT("Error allocating fence BO: %d\n", ret);
    nouveau_bo_map(screen->fence.bo, 0, NULL);
-   screen->fence.map = screen->fence.bo->map;
    screen->base.fence.emit = nvc0_screen_fence_emit;
    screen->base.fence.update = nvc0_screen_fence_update;
 
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
index d8223ba9d54..aecdb3494ef 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.h
@@ -111,7 +111,6 @@ struct nvc0_screen {
 
    struct {
       struct nouveau_bo *bo;
-      uint32_t *map;
    } fence;
 
    struct {
-- 
2.19.2



More information about the mesa-dev mailing list