Mesa (master): nvc0: create screen fence objects with coherent attribute
Martin Peres
mperes at kemper.freedesktop.org
Wed Jul 1 23:18:31 UTC 2015
Module: Mesa
Branch: master
Commit: e212a80db37b0fc9d57beb91dbca1c43ae4476a0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e212a80db37b0fc9d57beb91dbca1c43ae4476a0
Author: Alexandre Courbot <acourbot at nvidia.com>
Date: Tue Jun 30 22:37:40 2015 +0900
nvc0: create screen fence objects with coherent attribute
This is required on non-coherent architectures to ensure the value of
the fence is correct at all times. Failure to do this results in the
display freezing for a few seconds every now and then on Tegra.
The NOUVEAU_BO_COHERENT is a no-op for coherent architectures, so behavior
on x86 should not be affected by this patch.
Also bump the required libdrm version to 2.4.62, which introduced this
flag.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
Reviewed-by: Martin Peres <martin.peres at free.fr>
---
configure.ac | 2 +-
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 60d180d..ea0f069 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ LIBDRM_REQUIRED=2.4.38
LIBDRM_RADEON_REQUIRED=2.4.56
LIBDRM_INTEL_REQUIRED=2.4.60
LIBDRM_NVVIEUX_REQUIRED=2.4.33
-LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
+LIBDRM_NOUVEAU_REQUIRED=2.4.62
LIBDRM_FREEDRENO_REQUIRED=2.4.57
DRI2PROTO_REQUIRED=2.6
DRI3PROTO_REQUIRED=1.0
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
index 4c53106..95e246b 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
@@ -614,6 +614,7 @@ nvc0_screen_create(struct nouveau_device *dev)
struct nouveau_pushbuf *push;
uint64_t value;
uint32_t obj_class;
+ uint32_t flags;
int ret;
unsigned i;
@@ -669,8 +670,11 @@ nvc0_screen_create(struct nouveau_device *dev)
screen->base.base.get_video_param = nouveau_vp3_screen_get_video_param;
screen->base.base.is_video_format_supported = nouveau_vp3_screen_video_supported;
- ret = nouveau_bo_new(dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, 4096, NULL,
- &screen->fence.bo);
+ flags = NOUVEAU_BO_GART | NOUVEAU_BO_MAP;
+ if (dev->drm_version >= 0x01000202)
+ flags |= NOUVEAU_BO_COHERENT;
+
+ ret = nouveau_bo_new(dev, flags, 0, 4096, NULL, &screen->fence.bo);
if (ret)
goto fail;
nouveau_bo_map(screen->fence.bo, 0, NULL);
More information about the mesa-commit
mailing list