[PATCH RFC 099/111] staging: etnaviv: add flag to force buffer through MMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At least the GC2000 I'm testing with seems to have a bug that all vertex
streams have to be mapped either through the MMU or without it. Mixing
between both mapping types in a single draw command results in corrupted
vertex data.

As we can not quarantee that a buffer may be mappable without the MMU
all vertex buffers need to go through the MMU. As the userspace knows
which buffers may be used as vertex buffers at allocation time this
adds a flagfor userspace to specify in this situation.

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/staging/etnaviv/etnaviv_mmu.c | 2 +-
 include/uapi/drm/etnaviv_drm.h        | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/etnaviv/etnaviv_mmu.c b/drivers/staging/etnaviv/etnaviv_mmu.c
index f2a9f7c049e4..a59d27a2adfe 100644
--- a/drivers/staging/etnaviv/etnaviv_mmu.c
+++ b/drivers/staging/etnaviv/etnaviv_mmu.c
@@ -109,7 +109,7 @@ int etnaviv_iommu_map_gem(struct etnaviv_iommu *mmu,
 	mapping->mmu = mmu;
 
 	/* v1 MMU can optimize single entry (contiguous) scatterlists */
-	if (sgt->nents == 1) {
+	if (sgt->nents == 1 && !(etnaviv_obj->flags & ETNA_BO_FORCE_MMU)) {
 		uint32_t iova;
 
 		iova = sg_dma_address(sgt->sgl) - memory_base;
diff --git a/include/uapi/drm/etnaviv_drm.h b/include/uapi/drm/etnaviv_drm.h
index a4c109ffbea4..52c6989ad93f 100644
--- a/include/uapi/drm/etnaviv_drm.h
+++ b/include/uapi/drm/etnaviv_drm.h
@@ -86,6 +86,8 @@ struct drm_etnaviv_param {
 #define ETNA_BO_CACHED       0x00010000
 #define ETNA_BO_WC           0x00020000
 #define ETNA_BO_UNCACHED     0x00040000
+/* map flags */
+#define ETNA_BO_FORCE_MMU    0x00100000
 
 struct drm_etnaviv_gem_new {
 	uint64_t size;           /* in */
-- 
2.1.4

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux