aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_drv.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_drv.h')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_drv.h133
1 files changed, 91 insertions, 42 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h
index 4c0be3a4ed8..38134a9c757 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drv.h
+++ b/drivers/gpu/drm/nouveau/nouveau_drv.h
@@ -163,6 +163,9 @@ enum nouveau_flags {
163#define NVOBJ_ENGINE_COPY0 3 163#define NVOBJ_ENGINE_COPY0 3
164#define NVOBJ_ENGINE_COPY1 4 164#define NVOBJ_ENGINE_COPY1 4
165#define NVOBJ_ENGINE_MPEG 5 165#define NVOBJ_ENGINE_MPEG 5
166#define NVOBJ_ENGINE_PPP NVOBJ_ENGINE_MPEG
167#define NVOBJ_ENGINE_BSP 6
168#define NVOBJ_ENGINE_VP 7
166#define NVOBJ_ENGINE_DISPLAY 15 169#define NVOBJ_ENGINE_DISPLAY 15
167#define NVOBJ_ENGINE_NR 16 170#define NVOBJ_ENGINE_NR 16
168 171
@@ -229,6 +232,7 @@ struct nouveau_channel {
229 /* mapping of the regs controlling the fifo */ 232 /* mapping of the regs controlling the fifo */
230 void __iomem *user; 233 void __iomem *user;
231 uint32_t user_get; 234 uint32_t user_get;
235 uint32_t user_get_hi;
232 uint32_t user_put; 236 uint32_t user_put;
233 237
234 /* Fencing */ 238 /* Fencing */
@@ -246,7 +250,7 @@ struct nouveau_channel {
246 struct nouveau_gpuobj *pushbuf; 250 struct nouveau_gpuobj *pushbuf;
247 struct nouveau_bo *pushbuf_bo; 251 struct nouveau_bo *pushbuf_bo;
248 struct nouveau_vma pushbuf_vma; 252 struct nouveau_vma pushbuf_vma;
249 uint32_t pushbuf_base; 253 uint64_t pushbuf_base;
250 254
251 /* Notifier memory */ 255 /* Notifier memory */
252 struct nouveau_bo *notifier_bo; 256 struct nouveau_bo *notifier_bo;
@@ -393,24 +397,25 @@ struct nouveau_display_engine {
393 int (*early_init)(struct drm_device *); 397 int (*early_init)(struct drm_device *);
394 void (*late_takedown)(struct drm_device *); 398 void (*late_takedown)(struct drm_device *);
395 int (*create)(struct drm_device *); 399 int (*create)(struct drm_device *);
396 int (*init)(struct drm_device *);
397 void (*destroy)(struct drm_device *); 400 void (*destroy)(struct drm_device *);
401 int (*init)(struct drm_device *);
402 void (*fini)(struct drm_device *);
403
404 struct drm_property *dithering_mode;
405 struct drm_property *dithering_depth;
406 struct drm_property *underscan_property;
407 struct drm_property *underscan_hborder_property;
408 struct drm_property *underscan_vborder_property;
398}; 409};
399 410
400struct nouveau_gpio_engine { 411struct nouveau_gpio_engine {
401 void *priv; 412 spinlock_t lock;
402 413 struct list_head isr;
403 int (*init)(struct drm_device *); 414 int (*init)(struct drm_device *);
404 void (*takedown)(struct drm_device *); 415 void (*fini)(struct drm_device *);
405 416 int (*drive)(struct drm_device *, int line, int dir, int out);
406 int (*get)(struct drm_device *, enum dcb_gpio_tag); 417 int (*sense)(struct drm_device *, int line);
407 int (*set)(struct drm_device *, enum dcb_gpio_tag, int state); 418 void (*irq_enable)(struct drm_device *, int line, bool);
408
409 int (*irq_register)(struct drm_device *, enum dcb_gpio_tag,
410 void (*)(void *, int), void *);
411 void (*irq_unregister)(struct drm_device *, enum dcb_gpio_tag,
412 void (*)(void *, int), void *);
413 bool (*irq_enable)(struct drm_device *, enum dcb_gpio_tag, bool on);
414}; 419};
415 420
416struct nouveau_pm_voltage_level { 421struct nouveau_pm_voltage_level {
@@ -484,7 +489,7 @@ struct nouveau_pm_level {
484 u32 copy; 489 u32 copy;
485 u32 daemon; 490 u32 daemon;
486 u32 vdec; 491 u32 vdec;
487 u32 unk05; /* nv50:nva3, roughly.. */ 492 u32 dom6;
488 u32 unka0; /* nva3:nvc0 */ 493 u32 unka0; /* nva3:nvc0 */
489 u32 hub01; /* nvc0- */ 494 u32 hub01; /* nvc0- */
490 u32 hub06; /* nvc0- */ 495 u32 hub06; /* nvc0- */
@@ -518,6 +523,12 @@ struct nouveau_pm_memtimings {
518 int nr_timing; 523 int nr_timing;
519}; 524};
520 525
526struct nouveau_pm_fan {
527 u32 min_duty;
528 u32 max_duty;
529 u32 pwm_freq;
530};
531
521struct nouveau_pm_engine { 532struct nouveau_pm_engine {
522 struct nouveau_pm_voltage voltage; 533 struct nouveau_pm_voltage voltage;
523 struct nouveau_pm_level perflvl[NOUVEAU_PM_MAX_LEVEL]; 534 struct nouveau_pm_level perflvl[NOUVEAU_PM_MAX_LEVEL];
@@ -525,6 +536,8 @@ struct nouveau_pm_engine {
525 struct nouveau_pm_memtimings memtimings; 536 struct nouveau_pm_memtimings memtimings;
526 struct nouveau_pm_temp_sensor_constants sensor_constants; 537 struct nouveau_pm_temp_sensor_constants sensor_constants;
527 struct nouveau_pm_threshold_temp threshold_temp; 538 struct nouveau_pm_threshold_temp threshold_temp;
539 struct nouveau_pm_fan fan;
540 u32 pwm_divisor;
528 541
529 struct nouveau_pm_level boot; 542 struct nouveau_pm_level boot;
530 struct nouveau_pm_level *cur; 543 struct nouveau_pm_level *cur;
@@ -532,19 +545,14 @@ struct nouveau_pm_engine {
532 struct device *hwmon; 545 struct device *hwmon;
533 struct notifier_block acpi_nb; 546 struct notifier_block acpi_nb;
534 547
535 int (*clock_get)(struct drm_device *, u32 id);
536 void *(*clock_pre)(struct drm_device *, struct nouveau_pm_level *,
537 u32 id, int khz);
538 void (*clock_set)(struct drm_device *, void *);
539
540 int (*clocks_get)(struct drm_device *, struct nouveau_pm_level *); 548 int (*clocks_get)(struct drm_device *, struct nouveau_pm_level *);
541 void *(*clocks_pre)(struct drm_device *, struct nouveau_pm_level *); 549 void *(*clocks_pre)(struct drm_device *, struct nouveau_pm_level *);
542 void (*clocks_set)(struct drm_device *, void *); 550 int (*clocks_set)(struct drm_device *, void *);
543 551
544 int (*voltage_get)(struct drm_device *); 552 int (*voltage_get)(struct drm_device *);
545 int (*voltage_set)(struct drm_device *, int voltage); 553 int (*voltage_set)(struct drm_device *, int voltage);
546 int (*fanspeed_get)(struct drm_device *); 554 int (*pwm_get)(struct drm_device *, int line, u32*, u32*);
547 int (*fanspeed_set)(struct drm_device *, int fanspeed); 555 int (*pwm_set)(struct drm_device *, int line, u32, u32);
548 int (*temp_get)(struct drm_device *); 556 int (*temp_get)(struct drm_device *);
549}; 557};
550 558
@@ -780,6 +788,8 @@ struct drm_nouveau_private {
780 struct nouveau_vm *chan_vm; 788 struct nouveau_vm *chan_vm;
781 789
782 struct nvbios vbios; 790 struct nvbios vbios;
791 u8 *mxms;
792 struct list_head i2c_ports;
783 793
784 struct nv04_mode_state mode_reg; 794 struct nv04_mode_state mode_reg;
785 struct nv04_mode_state saved_reg; 795 struct nv04_mode_state saved_reg;
@@ -850,6 +860,7 @@ extern char *nouveau_perflvl;
850extern int nouveau_perflvl_wr; 860extern int nouveau_perflvl_wr;
851extern int nouveau_msi; 861extern int nouveau_msi;
852extern int nouveau_ctxfw; 862extern int nouveau_ctxfw;
863extern int nouveau_mxmdcb;
853 864
854extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state); 865extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
855extern int nouveau_pci_resume(struct pci_dev *pdev); 866extern int nouveau_pci_resume(struct pci_dev *pdev);
@@ -1000,7 +1011,10 @@ extern int nouveau_sgdma_init(struct drm_device *);
1000extern void nouveau_sgdma_takedown(struct drm_device *); 1011extern void nouveau_sgdma_takedown(struct drm_device *);
1001extern uint32_t nouveau_sgdma_get_physical(struct drm_device *, 1012extern uint32_t nouveau_sgdma_get_physical(struct drm_device *,
1002 uint32_t offset); 1013 uint32_t offset);
1003extern struct ttm_backend *nouveau_sgdma_init_ttm(struct drm_device *); 1014extern struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
1015 unsigned long size,
1016 uint32_t page_flags,
1017 struct page *dummy_read_page);
1004 1018
1005/* nouveau_debugfs.c */ 1019/* nouveau_debugfs.c */
1006#if defined(CONFIG_DRM_NOUVEAU_DEBUG) 1020#if defined(CONFIG_DRM_NOUVEAU_DEBUG)
@@ -1072,8 +1086,6 @@ extern int nouveau_run_vbios_init(struct drm_device *);
1072extern void nouveau_bios_run_init_table(struct drm_device *, uint16_t table, 1086extern void nouveau_bios_run_init_table(struct drm_device *, uint16_t table,
1073 struct dcb_entry *, int crtc); 1087 struct dcb_entry *, int crtc);
1074extern void nouveau_bios_init_exec(struct drm_device *, uint16_t table); 1088extern void nouveau_bios_init_exec(struct drm_device *, uint16_t table);
1075extern struct dcb_gpio_entry *nouveau_bios_gpio_entry(struct drm_device *,
1076 enum dcb_gpio_tag);
1077extern struct dcb_connector_table_entry * 1089extern struct dcb_connector_table_entry *
1078nouveau_bios_connector_entry(struct drm_device *, int index); 1090nouveau_bios_connector_entry(struct drm_device *, int index);
1079extern u32 get_pll_register(struct drm_device *, enum pll_types); 1091extern u32 get_pll_register(struct drm_device *, enum pll_types);
@@ -1091,11 +1103,18 @@ extern int call_lvds_script(struct drm_device *, struct dcb_entry *, int head,
1091 enum LVDS_script, int pxclk); 1103 enum LVDS_script, int pxclk);
1092bool bios_encoder_match(struct dcb_entry *, u32 hash); 1104bool bios_encoder_match(struct dcb_entry *, u32 hash);
1093 1105
1106/* nouveau_mxm.c */
1107int nouveau_mxm_init(struct drm_device *dev);
1108void nouveau_mxm_fini(struct drm_device *dev);
1109
1094/* nouveau_ttm.c */ 1110/* nouveau_ttm.c */
1095int nouveau_ttm_global_init(struct drm_nouveau_private *); 1111int nouveau_ttm_global_init(struct drm_nouveau_private *);
1096void nouveau_ttm_global_release(struct drm_nouveau_private *); 1112void nouveau_ttm_global_release(struct drm_nouveau_private *);
1097int nouveau_ttm_mmap(struct file *, struct vm_area_struct *); 1113int nouveau_ttm_mmap(struct file *, struct vm_area_struct *);
1098 1114
1115/* nouveau_hdmi.c */
1116void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *);
1117
1099/* nouveau_dp.c */ 1118/* nouveau_dp.c */
1100int nouveau_dp_auxch(struct nouveau_i2c_chan *auxch, int cmd, int addr, 1119int nouveau_dp_auxch(struct nouveau_i2c_chan *auxch, int cmd, int addr,
1101 uint8_t *data, int data_nr); 1120 uint8_t *data, int data_nr);
@@ -1222,6 +1241,9 @@ extern int nvc0_graph_isr_chid(struct drm_device *dev, u64 inst);
1222/* nv84_crypt.c */ 1241/* nv84_crypt.c */
1223extern int nv84_crypt_create(struct drm_device *); 1242extern int nv84_crypt_create(struct drm_device *);
1224 1243
1244/* nv98_crypt.c */
1245extern int nv98_crypt_create(struct drm_device *dev);
1246
1225/* nva3_copy.c */ 1247/* nva3_copy.c */
1226extern int nva3_copy_create(struct drm_device *dev); 1248extern int nva3_copy_create(struct drm_device *dev);
1227 1249
@@ -1234,6 +1256,17 @@ extern int nv31_mpeg_create(struct drm_device *dev);
1234/* nv50_mpeg.c */ 1256/* nv50_mpeg.c */
1235extern int nv50_mpeg_create(struct drm_device *dev); 1257extern int nv50_mpeg_create(struct drm_device *dev);
1236 1258
1259/* nv84_bsp.c */
1260/* nv98_bsp.c */
1261extern int nv84_bsp_create(struct drm_device *dev);
1262
1263/* nv84_vp.c */
1264/* nv98_vp.c */
1265extern int nv84_vp_create(struct drm_device *dev);
1266
1267/* nv98_ppp.c */
1268extern int nv98_ppp_create(struct drm_device *dev);
1269
1237/* nv04_instmem.c */ 1270/* nv04_instmem.c */
1238extern int nv04_instmem_init(struct drm_device *); 1271extern int nv04_instmem_init(struct drm_device *);
1239extern void nv04_instmem_takedown(struct drm_device *); 1272extern void nv04_instmem_takedown(struct drm_device *);
@@ -1311,13 +1344,19 @@ extern int nv17_tv_create(struct drm_connector *, struct dcb_entry *);
1311extern int nv04_display_early_init(struct drm_device *); 1344extern int nv04_display_early_init(struct drm_device *);
1312extern void nv04_display_late_takedown(struct drm_device *); 1345extern void nv04_display_late_takedown(struct drm_device *);
1313extern int nv04_display_create(struct drm_device *); 1346extern int nv04_display_create(struct drm_device *);
1314extern int nv04_display_init(struct drm_device *);
1315extern void nv04_display_destroy(struct drm_device *); 1347extern void nv04_display_destroy(struct drm_device *);
1348extern int nv04_display_init(struct drm_device *);
1349extern void nv04_display_fini(struct drm_device *);
1316 1350
1317/* nvd0_display.c */ 1351/* nvd0_display.c */
1318extern int nvd0_display_create(struct drm_device *); 1352extern int nvd0_display_create(struct drm_device *);
1319extern int nvd0_display_init(struct drm_device *);
1320extern void nvd0_display_destroy(struct drm_device *); 1353extern void nvd0_display_destroy(struct drm_device *);
1354extern int nvd0_display_init(struct drm_device *);
1355extern void nvd0_display_fini(struct drm_device *);
1356struct nouveau_bo *nvd0_display_crtc_sema(struct drm_device *, int crtc);
1357void nvd0_display_flip_stop(struct drm_crtc *);
1358int nvd0_display_flip_next(struct drm_crtc *, struct drm_framebuffer *,
1359 struct nouveau_channel *, u32 swap_interval);
1321 1360
1322/* nv04_crtc.c */ 1361/* nv04_crtc.c */
1323extern int nv04_crtc_create(struct drm_device *, int index); 1362extern int nv04_crtc_create(struct drm_device *, int index);
@@ -1412,6 +1451,10 @@ extern int nouveau_gem_ioctl_info(struct drm_device *, void *,
1412 struct drm_file *); 1451 struct drm_file *);
1413 1452
1414/* nouveau_display.c */ 1453/* nouveau_display.c */
1454int nouveau_display_create(struct drm_device *dev);
1455void nouveau_display_destroy(struct drm_device *dev);
1456int nouveau_display_init(struct drm_device *dev);
1457void nouveau_display_fini(struct drm_device *dev);
1415int nouveau_vblank_enable(struct drm_device *dev, int crtc); 1458int nouveau_vblank_enable(struct drm_device *dev, int crtc);
1416void nouveau_vblank_disable(struct drm_device *dev, int crtc); 1459void nouveau_vblank_disable(struct drm_device *dev, int crtc);
1417int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb, 1460int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
@@ -1426,23 +1469,22 @@ int nouveau_display_dumb_destroy(struct drm_file *, struct drm_device *,
1426 uint32_t handle); 1469 uint32_t handle);
1427 1470
1428/* nv10_gpio.c */ 1471/* nv10_gpio.c */
1429int nv10_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag); 1472int nv10_gpio_init(struct drm_device *dev);
1430int nv10_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state); 1473void nv10_gpio_fini(struct drm_device *dev);
1474int nv10_gpio_drive(struct drm_device *dev, int line, int dir, int out);
1475int nv10_gpio_sense(struct drm_device *dev, int line);
1476void nv10_gpio_irq_enable(struct drm_device *, int line, bool on);
1431 1477
1432/* nv50_gpio.c */ 1478/* nv50_gpio.c */
1433int nv50_gpio_init(struct drm_device *dev); 1479int nv50_gpio_init(struct drm_device *dev);
1434void nv50_gpio_fini(struct drm_device *dev); 1480void nv50_gpio_fini(struct drm_device *dev);
1435int nv50_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag); 1481int nv50_gpio_drive(struct drm_device *dev, int line, int dir, int out);
1436int nv50_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state); 1482int nv50_gpio_sense(struct drm_device *dev, int line);
1437int nvd0_gpio_get(struct drm_device *dev, enum dcb_gpio_tag tag); 1483void nv50_gpio_irq_enable(struct drm_device *, int line, bool on);
1438int nvd0_gpio_set(struct drm_device *dev, enum dcb_gpio_tag tag, int state); 1484int nvd0_gpio_drive(struct drm_device *dev, int line, int dir, int out);
1439int nv50_gpio_irq_register(struct drm_device *, enum dcb_gpio_tag, 1485int nvd0_gpio_sense(struct drm_device *dev, int line);
1440 void (*)(void *, int), void *); 1486
1441void nv50_gpio_irq_unregister(struct drm_device *, enum dcb_gpio_tag, 1487/* nv50_calc.c */
1442 void (*)(void *, int), void *);
1443bool nv50_gpio_irq_enable(struct drm_device *, enum dcb_gpio_tag, bool on);
1444
1445/* nv50_calc. */
1446int nv50_calc_pll(struct drm_device *, struct pll_lims *, int clk, 1488int nv50_calc_pll(struct drm_device *, struct pll_lims *, int clk,
1447 int *N1, int *M1, int *N2, int *M2, int *P); 1489 int *N1, int *M1, int *N2, int *M2, int *P);
1448int nva3_calc_pll(struct drm_device *, struct pll_lims *, 1490int nva3_calc_pll(struct drm_device *, struct pll_lims *,
@@ -1565,6 +1607,13 @@ extern void nv_wo32(struct nouveau_gpuobj *, u32 offset, u32 val);
1565#define NV_TRACEWARN(d, fmt, arg...) NV_PRINTK(KERN_NOTICE, d, fmt, ##arg) 1607#define NV_TRACEWARN(d, fmt, arg...) NV_PRINTK(KERN_NOTICE, d, fmt, ##arg)
1566#define NV_TRACE(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg) 1608#define NV_TRACE(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg)
1567#define NV_WARN(d, fmt, arg...) NV_PRINTK(KERN_WARNING, d, fmt, ##arg) 1609#define NV_WARN(d, fmt, arg...) NV_PRINTK(KERN_WARNING, d, fmt, ##arg)
1610#define NV_WARNONCE(d, fmt, arg...) do { \
1611 static int _warned = 0; \
1612 if (!_warned) { \
1613 NV_WARN(d, fmt, ##arg); \
1614 _warned = 1; \
1615 } \
1616} while(0)
1568 1617
1569/* nouveau_reg_debug bitmask */ 1618/* nouveau_reg_debug bitmask */
1570enum { 1619enum {