]> Pileus Git - ~andy/linux/blobdiff - drivers/gpu/drm/nouveau/nouveau_bo.h
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
[~andy/linux] / drivers / gpu / drm / nouveau / nouveau_bo.h
index a0a889cbf5ca06035dc909348cba32fab5e3dad8..dec51b1098feeb98ca8bf043d32f4b9d246dc09f 100644 (file)
@@ -2,13 +2,9 @@
 #define __NOUVEAU_BO_H__
 
 struct nouveau_channel;
+struct nouveau_fence;
 struct nouveau_vma;
 
-struct nouveau_tile_reg {
-       bool used;
-       struct nouveau_fence *fence;
-};
-
 struct nouveau_bo {
        struct ttm_buffer_object bo;
        struct ttm_placement placement;
@@ -29,7 +25,7 @@ struct nouveau_bo {
 
        u32 tile_mode;
        u32 tile_flags;
-       struct nouveau_tile_reg *tile;
+       struct nouveau_drm_tile *tile;
 
        struct drm_gem_object *gem;
        int pin_refcnt;
@@ -65,7 +61,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
 
 extern struct ttm_bo_driver nouveau_bo_driver;
 
-void nouveau_bo_move_init(struct nouveau_channel *);
+void nouveau_bo_move_init(struct nouveau_drm *);
 int  nouveau_bo_new(struct drm_device *, int size, int align, u32 flags,
                    u32 tile_mode, u32 tile_flags, struct sg_table *sg,
                    struct nouveau_bo **);
@@ -89,4 +85,15 @@ int  nouveau_bo_vma_add(struct nouveau_bo *, struct nouveau_vm *,
                        struct nouveau_vma *);
 void nouveau_bo_vma_del(struct nouveau_bo *, struct nouveau_vma *);
 
+/* TODO: submit equivalent to TTM generic API upstream? */
+static inline void __iomem *
+nvbo_kmap_obj_iovirtual(struct nouveau_bo *nvbo)
+{
+       bool is_iomem;
+       void __iomem *ioptr = (void __force __iomem *)ttm_kmap_obj_virtual(
+                                               &nvbo->kmap, &is_iomem);
+       WARN_ON_ONCE(ioptr && !is_iomem);
+       return ioptr;
+}
+
 #endif