OSDN Git Service

drm/nouveau: allow modeset module option to select 'headless mode'
[android-x86/kernel.git] / drivers / gpu / drm / nouveau / nouveau_drv.h
index d7d51de..7fdfad0 100644 (file)
@@ -414,12 +414,13 @@ struct nouveau_gpio_engine {
 };
 
 struct nouveau_pm_voltage_level {
-       u8 voltage;
-       u8 vid;
+       u32 voltage; /* microvolts */
+       u8  vid;
 };
 
 struct nouveau_pm_voltage {
        bool supported;
+       u8 version;
        u8 vid_mask;
 
        struct nouveau_pm_voltage_level *level;
@@ -448,11 +449,19 @@ struct nouveau_pm_level {
        u32 core;
        u32 memory;
        u32 shader;
-       u32 unk05;
-       u32 unk0a;
-
-       u8 voltage;
-       u8 fanspeed;
+       u32 rop;
+       u32 copy;
+       u32 daemon;
+       u32 vdec;
+       u32 unk05;      /* nv50:nva3, roughly.. */
+       u32 unka0;      /* nva3:nvc0 */
+       u32 hub01;      /* nvc0- */
+       u32 hub06;      /* nvc0- */
+       u32 hub07;      /* nvc0- */
+
+       u32 volt_min; /* microvolts */
+       u32 volt_max;
+       u8  fanspeed;
 
        u16 memscript;
        struct nouveau_pm_memtiming *timing;
@@ -496,6 +505,11 @@ struct nouveau_pm_engine {
        void *(*clock_pre)(struct drm_device *, struct nouveau_pm_level *,
                           u32 id, int khz);
        void (*clock_set)(struct drm_device *, void *);
+
+       int  (*clocks_get)(struct drm_device *, struct nouveau_pm_level *);
+       void *(*clocks_pre)(struct drm_device *, struct nouveau_pm_level *);
+       void (*clocks_set)(struct drm_device *, void *);
+
        int (*voltage_get)(struct drm_device *);
        int (*voltage_set)(struct drm_device *, int voltage);
        int (*fanspeed_get)(struct drm_device *);
@@ -504,7 +518,7 @@ struct nouveau_pm_engine {
 };
 
 struct nouveau_vram_engine {
-       struct nouveau_mm *mm;
+       struct nouveau_mm mm;
 
        int  (*init)(struct drm_device *);
        void (*takedown)(struct drm_device *dev);
@@ -623,6 +637,7 @@ enum nouveau_card_type {
        NV_40      = 0x40,
        NV_50      = 0x50,
        NV_C0      = 0xc0,
+       NV_D0      = 0xd0
 };
 
 struct drm_nouveau_private {
@@ -721,7 +736,6 @@ struct drm_nouveau_private {
        uint64_t vram_size;
        uint64_t vram_sys_base;
 
-       uint64_t fb_phys;
        uint64_t fb_available_size;
        uint64_t fb_mappable_pages;
        uint64_t fb_aper_free;
@@ -784,6 +798,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
 }
 
 /* nouveau_drv.c */
+extern int nouveau_modeset;
 extern int nouveau_agpmode;
 extern int nouveau_duallink;
 extern int nouveau_uscript_lvds;
@@ -824,6 +839,8 @@ extern bool nouveau_wait_eq(struct drm_device *, uint64_t timeout,
                            uint32_t reg, uint32_t mask, uint32_t val);
 extern bool nouveau_wait_ne(struct drm_device *, uint64_t timeout,
                            uint32_t reg, uint32_t mask, uint32_t val);
+extern bool nouveau_wait_cb(struct drm_device *, u64 timeout,
+                           bool (*cond)(void *), void *);
 extern bool nouveau_wait_for_idle(struct drm_device *);
 extern int  nouveau_card_init(struct drm_device *);
 
@@ -1179,8 +1196,8 @@ extern int  nva3_copy_create(struct drm_device *dev);
 /* nvc0_copy.c */
 extern int  nvc0_copy_create(struct drm_device *dev, int engine);
 
-/* nv40_mpeg.c */
-extern int  nv40_mpeg_create(struct drm_device *dev);
+/* nv31_mpeg.c */
+extern int  nv31_mpeg_create(struct drm_device *dev);
 
 /* nv50_mpeg.c */
 extern int  nv50_mpeg_create(struct drm_device *dev);
@@ -1448,6 +1465,8 @@ static inline void nv_wr08(struct drm_device *dev, unsigned reg, u8 val)
        nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
 #define nv_wait_ne(dev, reg, mask, val) \
        nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
+#define nv_wait_cb(dev, func, data) \
+       nouveau_wait_cb(dev, 2000000000ULL, (func), (data))
 
 /* PRAMIN access */
 static inline u32 nv_ri32(struct drm_device *dev, unsigned offset)