summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_bufmgr.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-10-20 11:50:03 -0700
committerEric Anholt <[email protected]>2016-10-21 14:12:22 -0700
commit83ffb607b7c54cff43db3dd6be70878cf32a4805 (patch)
tree31e381de6381be18086931118bcf4df4a84d8f13 /src/gallium/drivers/vc4/vc4_bufmgr.c
parent1c38ee380dc6c847c62e8a83978b31382f55bcff (diff)
vc4: Move simulator winsys mapping and tracking to the simulator.
One tiny hack is left in vc4_bufmgr.c for what kind of mapping we got so that we can free it.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_bufmgr.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_bufmgr.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c
index 1ed2e7fb9d3..9cff4e68f42 100644
--- a/src/gallium/drivers/vc4/vc4_bufmgr.c
+++ b/src/gallium/drivers/vc4/vc4_bufmgr.c
@@ -199,14 +199,13 @@ vc4_bo_free(struct vc4_bo *bo)
struct vc4_screen *screen = bo->screen;
if (bo->map) {
-#ifdef USE_VC4_SIMULATOR
- if (bo->simulator_winsys_map) {
+ if (using_vc4_simulator && bo->name &&
+ strcmp(bo->name, "winsys") == 0) {
free(bo->map);
- bo->map = bo->simulator_winsys_map;
+ } else {
+ munmap(bo->map, bo->size);
+ VG(VALGRIND_FREELIKE_BLOCK(bo->map, 0));
}
-#endif
- munmap(bo->map, bo->size);
- VG(VALGRIND_FREELIKE_BLOCK(bo->map, 0));
}
struct drm_gem_close c;
@@ -351,9 +350,6 @@ vc4_bo_open_handle(struct vc4_screen *screen,
#ifdef USE_VC4_SIMULATOR
vc4_simulator_open_from_handle(screen->fd, winsys_stride,
bo->handle, bo->size);
- vc4_bo_map(bo);
- bo->simulator_winsys_map = bo->map;
- bo->simulator_winsys_stride = winsys_stride;
bo->map = malloc(bo->size);
#endif