#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;
u32 tile_mode;
u32 tile_flags;
- struct nouveau_tile_reg *tile;
+ struct nouveau_drm_tile *tile;
struct drm_gem_object *gem;
int pin_refcnt;
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 **);
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