These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / gpu / drm / nouveau / include / nvkm / subdev / bar.h
index c7a007b..d3071b5 100644 (file)
@@ -1,33 +1,24 @@
 #ifndef __NVKM_BAR_H__
 #define __NVKM_BAR_H__
 #include <core/subdev.h>
-struct nvkm_mem;
 struct nvkm_vma;
 
 struct nvkm_bar {
-       struct nvkm_subdev base;
+       const struct nvkm_bar_func *func;
+       struct nvkm_subdev subdev;
 
-       int  (*alloc)(struct nvkm_bar *, struct nvkm_object *,
-                     struct nvkm_mem *, struct nvkm_object **);
-
-       int  (*kmap)(struct nvkm_bar *, struct nvkm_mem *, u32 flags,
-                    struct nvkm_vma *);
-       int  (*umap)(struct nvkm_bar *, struct nvkm_mem *, u32 flags,
-                    struct nvkm_vma *);
-       void (*unmap)(struct nvkm_bar *, struct nvkm_vma *);
-       void (*flush)(struct nvkm_bar *);
+       spinlock_t lock;
 
        /* whether the BAR supports to be ioremapped WC or should be uncached */
        bool iomap_uncached;
 };
 
-static inline struct nvkm_bar *
-nvkm_bar(void *obj)
-{
-       return (void *)nvkm_subdev(obj, NVDEV_SUBDEV_BAR);
-}
+void nvkm_bar_flush(struct nvkm_bar *);
+struct nvkm_vm *nvkm_bar_kmap(struct nvkm_bar *);
+int nvkm_bar_umap(struct nvkm_bar *, u64 size, int type, struct nvkm_vma *);
 
-extern struct nvkm_oclass nv50_bar_oclass;
-extern struct nvkm_oclass gf100_bar_oclass;
-extern struct nvkm_oclass gk20a_bar_oclass;
+int nv50_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
+int g84_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
+int gf100_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
+int gk20a_bar_new(struct nvkm_device *, int, struct nvkm_bar **);
 #endif