2012-07-14 19:09:17 +10:00
|
|
|
#ifndef __NOUVEAU_BAR_H__
|
|
|
|
|
#define __NOUVEAU_BAR_H__
|
|
|
|
|
|
|
|
|
|
#include <core/subdev.h>
|
|
|
|
|
#include <core/device.h>
|
|
|
|
|
|
2013-12-23 01:51:16 +10:00
|
|
|
struct nouveau_mem;
|
2012-07-14 19:09:17 +10:00
|
|
|
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 *);
|
2014-06-27 19:28:50 +09:00
|
|
|
|
|
|
|
|
/* whether the BAR supports to be ioremapped WC or should be uncached */
|
|
|
|
|
bool iomap_uncached;
|
2012-07-14 19:09:17 +10:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static inline struct nouveau_bar *
|
|
|
|
|
nouveau_bar(void *obj)
|
|
|
|
|
{
|
2014-12-03 17:07:22 +10:00
|
|
|
return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BAR);
|
2012-07-14 19:09:17 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern struct nouveau_oclass nv50_bar_oclass;
|
|
|
|
|
extern struct nouveau_oclass nvc0_bar_oclass;
|
2014-06-27 20:36:54 +09:00
|
|
|
extern struct nouveau_oclass gk20a_bar_oclass;
|
2012-07-14 19:09:17 +10:00
|
|
|
|
|
|
|
|
#endif
|