[Nouveau] [PATCH 1/3] ltc: add hooks for invalidate and flush

Alexandre Courbot acourbot at nvidia.com
Wed Sep 2 23:42:44 PDT 2015


These are useful for systems without a coherent CPU/GPU bus. For such
systems we may need to maintain the L2 ourselves.

Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
 drm/nouveau/include/nvkm/subdev/ltc.h |  3 +++
 drm/nouveau/nvkm/subdev/ltc/base.c    | 14 ++++++++++++++
 drm/nouveau/nvkm/subdev/ltc/priv.h    |  3 +++
 3 files changed, 20 insertions(+)

diff --git a/drm/nouveau/include/nvkm/subdev/ltc.h b/drm/nouveau/include/nvkm/subdev/ltc.h
index c773b5e958b4..5464fcf482f1 100644
--- a/drm/nouveau/include/nvkm/subdev/ltc.h
+++ b/drm/nouveau/include/nvkm/subdev/ltc.h
@@ -30,6 +30,9 @@ void nvkm_ltc_tags_clear(struct nvkm_ltc *, u32 first, u32 count);
 int nvkm_ltc_zbc_color_get(struct nvkm_ltc *, int index, const u32[4]);
 int nvkm_ltc_zbc_depth_get(struct nvkm_ltc *, int index, const u32);
 
+void nvkm_ltc_invalidate(struct nvkm_ltc *);
+void nvkm_ltc_flush(struct nvkm_ltc *);
+
 int gf100_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
 int gk104_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
 int gm107_ltc_new(struct nvkm_device *, int, struct nvkm_ltc **);
diff --git a/drm/nouveau/nvkm/subdev/ltc/base.c b/drm/nouveau/nvkm/subdev/ltc/base.c
index 930d25b6e63c..85b1464c0194 100644
--- a/drm/nouveau/nvkm/subdev/ltc/base.c
+++ b/drm/nouveau/nvkm/subdev/ltc/base.c
@@ -67,6 +67,20 @@ nvkm_ltc_zbc_depth_get(struct nvkm_ltc *ltc, int index, const u32 depth)
 	return index;
 }
 
+void
+nvkm_ltc_invalidate(struct nvkm_ltc *ltc)
+{
+	if (ltc->func->invalidate)
+		ltc->func->invalidate(ltc);
+}
+
+void
+nvkm_ltc_flush(struct nvkm_ltc *ltc)
+{
+	if (ltc->func->flush)
+		ltc->func->flush(ltc);
+}
+
 static void
 nvkm_ltc_intr(struct nvkm_subdev *subdev)
 {
diff --git a/drm/nouveau/nvkm/subdev/ltc/priv.h b/drm/nouveau/nvkm/subdev/ltc/priv.h
index 4e05037cc99f..6f66bd03f829 100644
--- a/drm/nouveau/nvkm/subdev/ltc/priv.h
+++ b/drm/nouveau/nvkm/subdev/ltc/priv.h
@@ -17,6 +17,9 @@ struct nvkm_ltc_func {
 	int zbc;
 	void (*zbc_clear_color)(struct nvkm_ltc *, int, const u32[4]);
 	void (*zbc_clear_depth)(struct nvkm_ltc *, int, const u32);
+
+	void (*invalidate)(struct nvkm_ltc *);
+	void (*flush)(struct nvkm_ltc *);
 };
 
 int gf100_ltc_oneinit(struct nvkm_ltc *);
-- 
2.5.1



More information about the Nouveau mailing list