summaryrefslogtreecommitdiff
path: root/drm/nouveau/include/nvkm/subdev/bar.h
diff options
context:
space:
mode:
Diffstat (limited to 'drm/nouveau/include/nvkm/subdev/bar.h')
-rw-r--r--drm/nouveau/include/nvkm/subdev/bar.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/drm/nouveau/include/nvkm/subdev/bar.h b/drm/nouveau/include/nvkm/subdev/bar.h
new file mode 100644
index 000000000..960e33a30
--- /dev/null
+++ b/drm/nouveau/include/nvkm/subdev/bar.h
@@ -0,0 +1,37 @@
+#ifndef __NOUVEAU_BAR_H__
+#define __NOUVEAU_BAR_H__
+
+#include <core/subdev.h>
+#include <core/device.h>
+
+struct nouveau_mem;
+struct nouveau_vma;
+
+struct nouveau_bar {
+ struct nouveau_subdev base;
+
+ int (*alloc)(struct nouveau_bar *, struct nouveau_object *,
+ struct nouveau_mem *, struct nouveau_object **);
+
+ int (*kmap)(struct nouveau_bar *, struct nouveau_mem *,
+ u32 flags, struct nouveau_vma *);
+ int (*umap)(struct nouveau_bar *, struct nouveau_mem *,
+ u32 flags, struct nouveau_vma *);
+ void (*unmap)(struct nouveau_bar *, struct nouveau_vma *);
+ void (*flush)(struct nouveau_bar *);
+
+ /* whether the BAR supports to be ioremapped WC or should be uncached */
+ bool iomap_uncached;
+};
+
+static inline struct nouveau_bar *
+nouveau_bar(void *obj)
+{
+ return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BAR);
+}
+
+extern struct nouveau_oclass nv50_bar_oclass;
+extern struct nouveau_oclass nvc0_bar_oclass;
+extern struct nouveau_oclass gk20a_bar_oclass;
+
+#endif