Revert "bus: remove cpu_coherent flag"
PATCH 1/2 Revert "bus: remove cpu_coherent flag"
This reverts commit 01bbcb69f80e1058395b737ae399c6f4ef48691b.
The commit caused fence timeouts within nvc0_screen_destroy and most likely other places as well.
The most obvious effect is, that userspace processes take minutes to actually quit.
--- drm/nouveau/include/nvkm/core/device.h | 1 + drm/nouveau/nouveau_bo.c | 3 ++- drm/nouveau/nvkm/engine/device/pci.c | 1 + drm/nouveau/nvkm/engine/device/tegra.c | 1 + lib/include/nvif/os.h | 6 ++++++ 5 files changed, 11 insertions(+), 1 deletion(-)
drm/nouveau/include/nvkm/core/device.h +1 -0
@@ -175,6 +175,7 @@ struct nvkm_device_func {void (*fini)(struct nvkm_device *,bool suspend);resource_size_t (*resource_addr)(struct nvkm_device *,unsigned bar);resource_size_t (*resource_size)(struct nvkm_device *,unsigned bar); +bool cpu_coherent; };struct nvkm_device_quirk {
drm/nouveau/nouveau_bo.c +2 -1
@@ -209,7 +209,8 @@ nouveau_bo_new(struct drm_device *dev, int size, int align, nvbo->tile_flags = tile_flags; nvbo->bo.bdev = &drm->ttm.bdev; - nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; +if (!nvxx_device (&drm->device)->func->cpu_coherent) + nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; nvbo->page_shift =12 ;if (drm->client.vm) {
drm/nouveau/nvkm/engine/device/pci.c +1 -0
@@ -1614,6 +1614,7 @@ nvkm_device_pci_func = { .fini = nvkm_device_pci_fini, .resource_addr = nvkm_device_pci_resource_addr, .resource_size = nvkm_device_pci_resource_size, + .cpu_coherent = !IS_ENABLED(CONFIG_ARM), };int
drm/nouveau/nvkm/engine/device/tegra.c +1 -0
@@ -245,6 +245,7 @@ nvkm_device_tegra_func = { .fini = nvkm_device_tegra_fini, .resource_addr = nvkm_device_tegra_resource_addr, .resource_size = nvkm_device_tegra_resource_size, + .cpu_coherent = false, };int
lib/include/nvif/os.h +6 -0
@@ -124,6 +124,12 @@ typedef dma_addr_t resource_size_t;#define __printf (a,b)#define __user +#if defined(CONFIG_ARM ) +#define IS_ENABLED_CONFIG_ARM 1 +#else +#define IS_ENABLED_CONFIG_ARM 0 +#endif +#if defined(CONFIG_IOMMU_API )#define IS_ENABLED_CONFIG_IOMMU_API 1#else
Signature · 6 lines
2.10.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20160918102157.3921-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 2/2 nouveau: Fix compile error due to bad include
Cought while working on travis-ci integration
--- drm/nouveau/uapi/drm/nouveau_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drm/nouveau/uapi/drm/nouveau_drm.h +1 -1
@@ -27,7 +27,7 @@#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 -#include "drm.h" +#include "drm/drm.h" #if defined(__cplusplus)extern "C" {
Signature · 6 lines
2.10.0 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20160918102157.3921-2-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 2/2] nouveau: Fix compile error due to bad include
Every other *_drm.h does #include "drm.h". Something else is wrong.
Quoted 23 lines · Karol Herbst
Cought while working on travis-ci integration
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/uapi/drm/nouveau_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drm/nouveau/uapi/drm/nouveau_drm.h +1
-2@@ -27,7 +27,7 @@#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 -#include "drm.h" +#include "drm/drm.h" #if defined(__cplusplus)extern "C" { --2.10.0
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): CAKb7Uvg=no4KWS8rLDbNJMk9a6tT_Bt+2oXoy5gzAWYjR5OOCA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] nouveau: Fix compile error due to bad include
odd, let me check again
2016-09-18 16:18 GMT+02:00 Ilia Mirkin <[email protected]>:
Quoted 26 lines
Every other *_drm.h does #include "
drm.h". Something else is wrong.Quoted 23 lines · Karol Herbst
Cought while working on travis-ci integration
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/uapi/drm/nouveau_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drm/nouveau/uapi/drm/nouveau_drm.h +1
-2@@ -27,7 +27,7 @@#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 -#include "drm.h" +#include "drm/drm.h" #if defined(__cplusplus)extern "C" { --2.10.0
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): CAEXux-anwQoo+vMd+BRp--KAUhz9AJGxu+61ePikMCgB+kW17w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Re: [PATCH 2/2] nouveau: Fix compile error due to bad include
FWIW I also have to carry a local patch doing this, otherwise I cannot perform an out-of-tree module build.
Quoted 29 lines · Karol Herbst
odd, let me check again
2016-09-18 16:18 GMT+02:00 Ilia Mirkin <[email protected]>:
Quoted 26 lines
Every other *_drm.h does #include "
drm.h". Something else is wrong.Quoted 23 lines · Karol Herbst
Cought while working on travis-ci integration
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/uapi/drm/nouveau_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drm/nouveau/uapi/drm/nouveau_drm.h +1
-2@@ -27,7 +27,7 @@#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 -#include "drm.h" +#include "drm/drm.h" #if defined(__cplusplus)extern "C" { --2.10.0
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Re: [PATCH 2/2] nouveau: Fix compile error due to bad include
In reply to a message not in the archiveQuoted 12 lines · Karol Herbst
Cought while working on travis-ci integration
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/uapi/drm/nouveau_drm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drm/nouveau/uapi/drm/nouveau_drm.h +0
-0
drm/nouveau/uapi/drm/nouveau_drm.h line 31
Quoted 6 lines
drm/nouveau/uapi/drm/nouveau_drm.h +1
-1@@ -27,7 +27,7 @@#define DRM_NOUVEAU_EVENT_NVIF 0x80000000 -#include "drm.h" +#include "drm/drm.h"
Afaict this is a side effect of an "incomplete sync" with the kernel code. In there we have the respective header alongside the nouveau_drm.h one.
One workaround is to track drm.h in the nouveau repo, with another to adjust KBUILD_OPTS to honour the upstream one.
KBUILD_OPTS += KCPPFLAGS="-I$(LINUXDIR)/include/uapi/drm"
The above (untested) sounds like the better solution imho.
Regards,
Emil
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
Alexandre Courbot
Acked-byQuoted 7 lines · Karol Herbst
This reverts commit
01bbcb69f80e1058395b737ae399c6f4ef48691b.The commit caused fence timeouts within
nvc0_screen_destroyand most likely other places as well.The most obvious effect is, that userspace processes take minutes to actually quit.
Quoted 80 lines
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/include/nvkm/core/device.h | 1 + drm/nouveau/nouveau_bo.c | 3 ++- drm/nouveau/nvkm/engine/device/pci.c | 1 + drm/nouveau/nvkm/engine/device/tegra.c | 1 + lib/include/nvif/os.h | 6 ++++++ 5 files changed, 11 insertions(+), 1 deletion(-)drm/nouveau/include/nvkm/core/device.h +1
-0@@ -175,6 +175,7 @@ struct nvkm_device_func {void (*fini)(struct nvkm_device *,bool suspend);resource_size_t (*resource_addr)(struct nvkm_device *,unsigned bar);resource_size_t (*resource_size)(struct nvkm_device *,unsigned bar); +bool cpu_coherent; };struct nvkm_device_quirk {drm/nouveau/nouveau_bo.c +2
-1@@ -209,7 +209,8 @@ nouveau_bo_new(struct drm_device *dev, int size, int align, nvbo->tile_flags = tile_flags; nvbo->bo.bdev = &drm->ttm.bdev; - nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; +if (!nvxx_device (&drm->device)->func->cpu_coherent) + nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; nvbo->page_shift =12 ;if (drm->client.vm) {drm/nouveau/nvkm/engine/device/pci.c +1
-0@@ -1614,6 +1614,7 @@ nvkm_device_pci_func = { .fini = nvkm_device_pci_fini, .resource_addr = nvkm_device_pci_resource_addr, .resource_size = nvkm_device_pci_resource_size, + .cpu_coherent = !IS_ENABLED(CONFIG_ARM), };int drm/nouveau/nvkm/engine/device/tegra.c +1
-0@@ -245,6 +245,7 @@ nvkm_device_tegra_func = { .fini = nvkm_device_tegra_fini, .resource_addr = nvkm_device_tegra_resource_addr, .resource_size = nvkm_device_tegra_resource_size, + .cpu_coherent = false, };int lib/include/nvif/os.h +6
-1@@ -124,6 +124,12 @@ typedef dma_addr_t resource_size_t;#define __printf (a,b)#define __user +#if defined(CONFIG_ARM ) +#define IS_ENABLED_CONFIG_ARM 1 +#else +#define IS_ENABLED_CONFIG_ARM 0 +#endif +#if defined(CONFIG_IOMMU_API )#define IS_ENABLED_CONFIG_IOMMU_API 1#else --2.10.0
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): CAAVeFuL2mGPzfe1PJJmhOc7wv+XVDXomAUz4n8Fj8RHov-fBMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 2 lines · Alexandre Courbot
Quoted 1 line · Karol Herbst
This reverts commit
01bbcb69f80e1058395b737ae399c6f4ef48691b.
I think you meant aff51175cdbf345740ec9203eff88e772af88059 - that's the commit id that matters, not the one in Ben's non-linux repo.
Quoted 8 lines
Quoted 6 lines
The commit caused fence timeouts within
nvc0_screen_destroyand most likely other places as well.The most obvious effect is, that userspace processes take minutes to actually quit.
If this doesn't make it into v4.8 (which is due to be released in a week), it should get tagged for stable as well.
By the way, Alexandre, I believe Martin was reporting issues like this on his TK1 before this change as well. Probably worth investigating - sounds like there's a wider issue with TTM_PL_FLAG_UNCACHED and/or force_coherent.
Quoted 81 lines
Quoted 81 lines
Signed-off-by Karol Herbst <[email protected]>--- drm/nouveau/include/nvkm/core/device.h | 1 + drm/nouveau/nouveau_bo.c | 3 ++- drm/nouveau/nvkm/engine/device/pci.c | 1 + drm/nouveau/nvkm/engine/device/tegra.c | 1 + lib/include/nvif/os.h | 6 ++++++ 5 files changed, 11 insertions(+), 1 deletion(-)drm/nouveau/include/nvkm/core/device.h +1
-0@@ -175,6 +175,7 @@ struct nvkm_device_func {void (*fini)(struct nvkm_device *,bool suspend);resource_size_t (*resource_addr)(struct nvkm_device *,unsigned bar);resource_size_t (*resource_size)(struct nvkm_device *,unsigned bar); +bool cpu_coherent; };struct nvkm_device_quirk {drm/nouveau/nouveau_bo.c +2
-1@@ -209,7 +209,8 @@ nouveau_bo_new(struct drm_device *dev, int size, int align, nvbo->tile_flags = tile_flags; nvbo->bo.bdev = &drm->ttm.bdev; - nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; +if (!nvxx_device (&drm->device)->func->cpu_coherent) + nvbo->force_coherent = flags &TTM_PL_FLAG_UNCACHED ; nvbo->page_shift =12 ;if (drm->client.vm) {drm/nouveau/nvkm/engine/device/pci.c +1
-0@@ -1614,6 +1614,7 @@ nvkm_device_pci_func = { .fini = nvkm_device_pci_fini, .resource_addr = nvkm_device_pci_resource_addr, .resource_size = nvkm_device_pci_resource_size, + .cpu_coherent = !IS_ENABLED(CONFIG_ARM), };int drm/nouveau/nvkm/engine/device/tegra.c +1
-0@@ -245,6 +245,7 @@ nvkm_device_tegra_func = { .fini = nvkm_device_tegra_fini, .resource_addr = nvkm_device_tegra_resource_addr, .resource_size = nvkm_device_tegra_resource_size, + .cpu_coherent = false, };int lib/include/nvif/os.h +6
-1@@ -124,6 +124,12 @@ typedef dma_addr_t resource_size_t;#define __printf (a,b)#define __user +#if defined(CONFIG_ARM ) +#define IS_ENABLED_CONFIG_ARM 1 +#else +#define IS_ENABLED_CONFIG_ARM 0 +#endif +#if defined(CONFIG_IOMMU_API )#define IS_ENABLED_CONFIG_IOMMU_API 1#else --2.10.0
Quoted 8 lines
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): CAKb7UvhEZtnj-wyKzUtg1ASSJj0Ce9p9y+bC_+05ikbo8fcdiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 16 lines · Ilia Mirkin
Quoted 2 lines · Alexandre Courbot
Quoted 1 line · Karol Herbst
This reverts commit
01bbcb69f80e1058395b737ae399c6f4ef48691b.I think you meant
aff51175cdbf345740ec9203eff88e772af88059- that's the commit id that matters, not the one in Ben's non-linux repo.Quoted 8 lines
Quoted 6 lines
The commit caused fence timeouts within
nvc0_screen_destroyand most likely other places as well.The most obvious effect is, that userspace processes take minutes to actually quit.
Quoted 7 lines
If this doesn't make it into v4.8 (which is due to be released in a week), it should get tagged for stable as well.
By the way, Alexandre, I believe Martin was reporting issues like this on his TK1 before this change as well. Probably worth investigating - sounds like there's a wider issue with
TTM_PL_FLAG_UNCACHEDand/orforce_coherent.
Yes, it may be indeed related. I need to sync with Martin to understand his exact repro case.
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): CAAVeFuL3V3MZNcDSUPvsnjLPABGvccF0GzZ-xL4C8DaKX_-eJA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 16 lines · Alexandre Courbot
Quoted 15 lines · Ilia Mirkin
Quoted 2 lines · Alexandre Courbot
Quoted 1 line · Karol Herbst
This reverts commit
01bbcb69f80e1058395b737ae399c6f4ef48691b.I think you meant
aff51175cdbf345740ec9203eff88e772af88059- that's the commit id that matters, not the one in Ben's non-linux repo.Quoted 6 lines
Quoted 5 lines
The commit caused fence timeouts within
nvc0_screen_destroyand most likely other places as well.The most obvious effect is, that userspace processes take minutes to actually quit.
If this doesn't make it into v4.8 (which is due to be released in a week), it should get tagged for stable as well.
Quoted 6 lines
Quoted 4 lines
By the way, Alexandre, I believe Martin was reporting issues like this on his TK1 before this change as well. Probably worth investigating - sounds like there's a wider issue with
TTM_PL_FLAG_UNCACHEDand/orforce_coherent.Yes, it may be indeed related. I need to sync with Martin to understand his exact repro case.
Running piglit on the tk1 is enough for me, but I will try to update the kernel again to see if it helps.
The issue is that mesa is waiting on a fence that never gets synced on in the gbm destructor. The probably of having the timeout is about 50/50, so it is easy-enough to reproduce in my case :s
Martin
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau