nouveau_drv.h 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096
  1. /*
  2. * Copyright 2005 Stephane Marchesin.
  3. * All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  9. * and/or sell copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice (including the next
  13. * paragraph) shall be included in all copies or substantial portions of the
  14. * Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  19. * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  20. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  21. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  22. * OTHER DEALINGS IN THE SOFTWARE.
  23. */
  24. #ifndef __NOUVEAU_DRV_H__
  25. #define __NOUVEAU_DRV_H__
  26. #define DRIVER_AUTHOR "Stephane Marchesin"
  27. #define DRIVER_EMAIL "nouveau@lists.freedesktop.org"
  28. #define DRIVER_NAME "nouveau"
  29. #define DRIVER_DESC "nVidia Riva/TNT/GeForce"
  30. #define DRIVER_DATE "20120316"
  31. #define DRIVER_MAJOR 1
  32. #define DRIVER_MINOR 0
  33. #define DRIVER_PATCHLEVEL 0
  34. #define NOUVEAU_FAMILY 0x0000FFFF
  35. #define NOUVEAU_FLAGS 0xFFFF0000
  36. #include "ttm/ttm_bo_api.h"
  37. #include "ttm/ttm_bo_driver.h"
  38. #include "ttm/ttm_placement.h"
  39. #include "ttm/ttm_memory.h"
  40. #include "ttm/ttm_module.h"
  41. #define XXX_THIS_IS_A_HACK
  42. #include <subdev/vm.h>
  43. #include <subdev/fb.h>
  44. #include <core/gpuobj.h>
  45. enum blah {
  46. NV_MEM_TYPE_UNKNOWN = 0,
  47. NV_MEM_TYPE_STOLEN,
  48. NV_MEM_TYPE_SGRAM,
  49. NV_MEM_TYPE_SDRAM,
  50. NV_MEM_TYPE_DDR1,
  51. NV_MEM_TYPE_DDR2,
  52. NV_MEM_TYPE_DDR3,
  53. NV_MEM_TYPE_GDDR2,
  54. NV_MEM_TYPE_GDDR3,
  55. NV_MEM_TYPE_GDDR4,
  56. NV_MEM_TYPE_GDDR5
  57. };
  58. struct nouveau_fpriv {
  59. spinlock_t lock;
  60. struct list_head channels;
  61. struct nouveau_vm *vm;
  62. };
  63. static inline struct nouveau_fpriv *
  64. nouveau_fpriv(struct drm_file *file_priv)
  65. {
  66. return file_priv ? file_priv->driver_priv : NULL;
  67. }
  68. #define DRM_FILE_PAGE_OFFSET (0x100000000ULL >> PAGE_SHIFT)
  69. #include <nouveau_drm.h>
  70. #include "nouveau_reg.h"
  71. #include <nouveau_bios.h>
  72. #include "nouveau_util.h"
  73. struct nouveau_grctx;
  74. struct nouveau_mem;
  75. #include <subdev/bios/pll.h>
  76. #include "nouveau_compat.h"
  77. #define nouveau_gpuobj_new(d,c,s,a,f,o) \
  78. _nouveau_gpuobj_new((d), (c) ? ((struct nouveau_channel *)(c))->ramin : NULL, \
  79. (s), (a), (f), (o))
  80. #define nouveau_vm_new(d,o,l,m,v) \
  81. _nouveau_vm_new((d), (o), (l), (m), (v))
  82. #define nv50_vm_flush_engine(d,e) \
  83. _nv50_vm_flush_engine((d), (e))
  84. #define MAX_NUM_DCB_ENTRIES 16
  85. #define NOUVEAU_MAX_CHANNEL_NR 4096
  86. #define NOUVEAU_MAX_TILE_NR 15
  87. #include "nouveau_bo.h"
  88. #include "nouveau_gem.h"
  89. /* TODO: submit equivalent to TTM generic API upstream? */
  90. static inline void __iomem *
  91. nvbo_kmap_obj_iovirtual(struct nouveau_bo *nvbo)
  92. {
  93. bool is_iomem;
  94. void __iomem *ioptr = (void __force __iomem *)ttm_kmap_obj_virtual(
  95. &nvbo->kmap, &is_iomem);
  96. WARN_ON_ONCE(ioptr && !is_iomem);
  97. return ioptr;
  98. }
  99. enum nouveau_flags {
  100. NV_NFORCE = 0x10000000,
  101. NV_NFORCE2 = 0x20000000
  102. };
  103. #define NVOBJ_ENGINE_SW 0
  104. #define NVOBJ_ENGINE_GR 1
  105. #define NVOBJ_ENGINE_CRYPT 2
  106. #define NVOBJ_ENGINE_COPY0 3
  107. #define NVOBJ_ENGINE_COPY1 4
  108. #define NVOBJ_ENGINE_MPEG 5
  109. #define NVOBJ_ENGINE_PPP NVOBJ_ENGINE_MPEG
  110. #define NVOBJ_ENGINE_BSP 6
  111. #define NVOBJ_ENGINE_VP 7
  112. #define NVOBJ_ENGINE_FIFO 14
  113. #define NVOBJ_ENGINE_FENCE 15
  114. #define NVOBJ_ENGINE_NR 16
  115. #define NVOBJ_ENGINE_DISPLAY (NVOBJ_ENGINE_NR + 0) /*XXX*/
  116. struct nouveau_page_flip_state {
  117. struct list_head head;
  118. struct drm_pending_vblank_event *event;
  119. int crtc, bpp, pitch, x, y;
  120. uint64_t offset;
  121. };
  122. enum nouveau_channel_mutex_class {
  123. NOUVEAU_UCHANNEL_MUTEX,
  124. NOUVEAU_KCHANNEL_MUTEX
  125. };
  126. struct nouveau_channel {
  127. struct drm_device *dev;
  128. struct list_head list;
  129. int id;
  130. /* references to the channel data structure */
  131. struct kref ref;
  132. /* users of the hardware channel resources, the hardware
  133. * context will be kicked off when it reaches zero. */
  134. atomic_t users;
  135. struct mutex mutex;
  136. /* owner of this fifo */
  137. struct drm_file *file_priv;
  138. /* mapping of the fifo itself */
  139. struct drm_local_map *map;
  140. /* mapping of the regs controlling the fifo */
  141. void __iomem *user;
  142. uint32_t user_get;
  143. uint32_t user_get_hi;
  144. uint32_t user_put;
  145. /* DMA push buffer */
  146. struct nouveau_gpuobj *pushbuf;
  147. struct nouveau_bo *pushbuf_bo;
  148. struct nouveau_vma pushbuf_vma;
  149. uint64_t pushbuf_base;
  150. /* Notifier memory */
  151. struct nouveau_bo *notifier_bo;
  152. struct nouveau_vma notifier_vma;
  153. struct drm_mm notifier_heap;
  154. /* PFIFO context */
  155. struct nouveau_gpuobj *engptr;
  156. struct nouveau_gpuobj *ramfc;
  157. /* Execution engine contexts */
  158. void *engctx[NVOBJ_ENGINE_NR];
  159. /* NV50 VM */
  160. struct nouveau_vm *vm;
  161. struct nouveau_gpuobj *vm_pd;
  162. /* Objects */
  163. struct nouveau_gpuobj *ramin; /* Private instmem */
  164. struct nouveau_ramht *ramht; /* Hash table */
  165. /* GPU object info for stuff used in-kernel (mm_enabled) */
  166. uint32_t m2mf_ntfy;
  167. uint32_t vram_handle;
  168. uint32_t gart_handle;
  169. bool accel_done;
  170. /* Push buffer state (only for drm's channel on !mm_enabled) */
  171. struct {
  172. int max;
  173. int free;
  174. int cur;
  175. int put;
  176. /* access via pushbuf_bo */
  177. int ib_base;
  178. int ib_max;
  179. int ib_free;
  180. int ib_put;
  181. } dma;
  182. struct {
  183. bool active;
  184. char name[32];
  185. struct drm_info_list info;
  186. } debugfs;
  187. };
  188. struct nouveau_exec_engine {
  189. void (*destroy)(struct drm_device *, int engine);
  190. int (*init)(struct drm_device *, int engine);
  191. int (*fini)(struct drm_device *, int engine, bool suspend);
  192. int (*context_new)(struct nouveau_channel *, int engine);
  193. void (*context_del)(struct nouveau_channel *, int engine);
  194. int (*object_new)(struct nouveau_channel *, int engine,
  195. u32 handle, u16 class);
  196. void (*set_tile_region)(struct drm_device *dev, int i);
  197. void (*tlb_flush)(struct drm_device *, int engine);
  198. };
  199. struct nouveau_display_engine {
  200. void *priv;
  201. int (*early_init)(struct drm_device *);
  202. void (*late_takedown)(struct drm_device *);
  203. int (*create)(struct drm_device *);
  204. void (*destroy)(struct drm_device *);
  205. int (*init)(struct drm_device *);
  206. void (*fini)(struct drm_device *);
  207. struct drm_property *dithering_mode;
  208. struct drm_property *dithering_depth;
  209. struct drm_property *underscan_property;
  210. struct drm_property *underscan_hborder_property;
  211. struct drm_property *underscan_vborder_property;
  212. /* not really hue and saturation: */
  213. struct drm_property *vibrant_hue_property;
  214. struct drm_property *color_vibrance_property;
  215. };
  216. struct nouveau_pm_voltage_level {
  217. u32 voltage; /* microvolts */
  218. u8 vid;
  219. };
  220. struct nouveau_pm_voltage {
  221. bool supported;
  222. u8 version;
  223. u8 vid_mask;
  224. struct nouveau_pm_voltage_level *level;
  225. int nr_level;
  226. };
  227. /* Exclusive upper limits */
  228. #define NV_MEM_CL_DDR2_MAX 8
  229. #define NV_MEM_WR_DDR2_MAX 9
  230. #define NV_MEM_CL_DDR3_MAX 17
  231. #define NV_MEM_WR_DDR3_MAX 17
  232. #define NV_MEM_CL_GDDR3_MAX 16
  233. #define NV_MEM_WR_GDDR3_MAX 18
  234. #define NV_MEM_CL_GDDR5_MAX 21
  235. #define NV_MEM_WR_GDDR5_MAX 20
  236. struct nouveau_pm_memtiming {
  237. int id;
  238. u32 reg[9];
  239. u32 mr[4];
  240. u8 tCWL;
  241. u8 odt;
  242. u8 drive_strength;
  243. };
  244. struct nouveau_pm_tbl_header {
  245. u8 version;
  246. u8 header_len;
  247. u8 entry_cnt;
  248. u8 entry_len;
  249. };
  250. struct nouveau_pm_tbl_entry {
  251. u8 tWR;
  252. u8 tWTR;
  253. u8 tCL;
  254. u8 tRC;
  255. u8 empty_4;
  256. u8 tRFC; /* Byte 5 */
  257. u8 empty_6;
  258. u8 tRAS; /* Byte 7 */
  259. u8 empty_8;
  260. u8 tRP; /* Byte 9 */
  261. u8 tRCDRD;
  262. u8 tRCDWR;
  263. u8 tRRD;
  264. u8 tUNK_13;
  265. u8 RAM_FT1; /* 14, a bitmask of random RAM features */
  266. u8 empty_15;
  267. u8 tUNK_16;
  268. u8 empty_17;
  269. u8 tUNK_18;
  270. u8 tCWL;
  271. u8 tUNK_20, tUNK_21;
  272. };
  273. struct nouveau_pm_profile;
  274. struct nouveau_pm_profile_func {
  275. void (*destroy)(struct nouveau_pm_profile *);
  276. void (*init)(struct nouveau_pm_profile *);
  277. void (*fini)(struct nouveau_pm_profile *);
  278. struct nouveau_pm_level *(*select)(struct nouveau_pm_profile *);
  279. };
  280. struct nouveau_pm_profile {
  281. const struct nouveau_pm_profile_func *func;
  282. struct list_head head;
  283. char name[8];
  284. };
  285. #define NOUVEAU_PM_MAX_LEVEL 8
  286. struct nouveau_pm_level {
  287. struct nouveau_pm_profile profile;
  288. struct device_attribute dev_attr;
  289. char name[32];
  290. int id;
  291. struct nouveau_pm_memtiming timing;
  292. u32 memory;
  293. u16 memscript;
  294. u32 core;
  295. u32 shader;
  296. u32 rop;
  297. u32 copy;
  298. u32 daemon;
  299. u32 vdec;
  300. u32 dom6;
  301. u32 unka0; /* nva3:nvc0 */
  302. u32 hub01; /* nvc0- */
  303. u32 hub06; /* nvc0- */
  304. u32 hub07; /* nvc0- */
  305. u32 volt_min; /* microvolts */
  306. u32 volt_max;
  307. u8 fanspeed;
  308. };
  309. struct nouveau_pm_temp_sensor_constants {
  310. u16 offset_constant;
  311. s16 offset_mult;
  312. s16 offset_div;
  313. s16 slope_mult;
  314. s16 slope_div;
  315. };
  316. struct nouveau_pm_threshold_temp {
  317. s16 critical;
  318. s16 down_clock;
  319. s16 fan_boost;
  320. };
  321. struct nouveau_pm_fan {
  322. u32 percent;
  323. u32 min_duty;
  324. u32 max_duty;
  325. u32 pwm_freq;
  326. u32 pwm_divisor;
  327. };
  328. struct nouveau_pm_engine {
  329. struct nouveau_pm_voltage voltage;
  330. struct nouveau_pm_level perflvl[NOUVEAU_PM_MAX_LEVEL];
  331. int nr_perflvl;
  332. struct nouveau_pm_temp_sensor_constants sensor_constants;
  333. struct nouveau_pm_threshold_temp threshold_temp;
  334. struct nouveau_pm_fan fan;
  335. struct nouveau_pm_profile *profile_ac;
  336. struct nouveau_pm_profile *profile_dc;
  337. struct nouveau_pm_profile *profile;
  338. struct list_head profiles;
  339. struct nouveau_pm_level boot;
  340. struct nouveau_pm_level *cur;
  341. struct device *hwmon;
  342. struct notifier_block acpi_nb;
  343. int (*clocks_get)(struct drm_device *, struct nouveau_pm_level *);
  344. void *(*clocks_pre)(struct drm_device *, struct nouveau_pm_level *);
  345. int (*clocks_set)(struct drm_device *, void *);
  346. int (*voltage_get)(struct drm_device *);
  347. int (*voltage_set)(struct drm_device *, int voltage);
  348. int (*pwm_get)(struct drm_device *, int line, u32*, u32*);
  349. int (*pwm_set)(struct drm_device *, int line, u32, u32);
  350. int (*temp_get)(struct drm_device *);
  351. };
  352. struct nouveau_engine {
  353. struct nouveau_display_engine display;
  354. struct nouveau_pm_engine pm;
  355. };
  356. enum nouveau_card_type {
  357. NV_04 = 0x04,
  358. NV_10 = 0x10,
  359. NV_20 = 0x20,
  360. NV_30 = 0x30,
  361. NV_40 = 0x40,
  362. NV_50 = 0x50,
  363. NV_C0 = 0xc0,
  364. NV_D0 = 0xd0,
  365. NV_E0 = 0xe0,
  366. };
  367. struct drm_nouveau_private {
  368. struct drm_device *dev;
  369. bool noaccel;
  370. void *newpriv;
  371. /* the card type, takes NV_* as values */
  372. enum nouveau_card_type card_type;
  373. /* exact chipset, derived from NV_PMC_BOOT_0 */
  374. int chipset;
  375. int flags;
  376. u32 crystal;
  377. struct nouveau_exec_engine *eng[NVOBJ_ENGINE_NR];
  378. struct list_head classes;
  379. struct nouveau_bo *vga_ram;
  380. /* interrupt handling */
  381. void (*irq_handler[32])(struct drm_device *);
  382. bool msi_enabled;
  383. struct {
  384. struct drm_global_reference mem_global_ref;
  385. struct ttm_bo_global_ref bo_global_ref;
  386. struct ttm_bo_device bdev;
  387. atomic_t validate_sequence;
  388. int (*move)(struct nouveau_channel *,
  389. struct ttm_buffer_object *,
  390. struct ttm_mem_reg *, struct ttm_mem_reg *);
  391. } ttm;
  392. struct {
  393. spinlock_t lock;
  394. struct drm_mm heap;
  395. struct nouveau_bo *bo;
  396. } fence;
  397. struct {
  398. spinlock_t lock;
  399. struct nouveau_channel *ptr[NOUVEAU_MAX_CHANNEL_NR];
  400. } channels;
  401. struct nouveau_engine engine;
  402. struct nouveau_channel *channel;
  403. /* For PFIFO and PGRAPH. */
  404. spinlock_t context_switch_lock;
  405. /* VM/PRAMIN flush, legacy PRAMIN aperture */
  406. spinlock_t vm_lock;
  407. /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */
  408. struct nouveau_ramht *ramht;
  409. struct {
  410. enum {
  411. NOUVEAU_GART_NONE = 0,
  412. NOUVEAU_GART_AGP, /* AGP */
  413. NOUVEAU_GART_PDMA, /* paged dma object */
  414. NOUVEAU_GART_HW /* on-chip gart/vm */
  415. } type;
  416. uint64_t aper_base;
  417. uint64_t aper_size;
  418. uint64_t aper_free;
  419. struct ttm_backend_func *func;
  420. struct nouveau_gpuobj *sg_ctxdma;
  421. } gart_info;
  422. /* nv10-nv40 tiling regions */
  423. struct {
  424. struct nouveau_tile_reg reg[NOUVEAU_MAX_TILE_NR];
  425. spinlock_t lock;
  426. } tile;
  427. uint64_t fb_available_size;
  428. uint64_t fb_mappable_pages;
  429. uint64_t fb_aper_free;
  430. int fb_mtrr;
  431. /* G8x/G9x virtual address space */
  432. struct nouveau_vm *chan_vm;
  433. struct nvbios vbios;
  434. u8 *mxms;
  435. struct list_head i2c_ports;
  436. struct backlight_device *backlight;
  437. struct {
  438. struct dentry *channel_root;
  439. } debugfs;
  440. struct nouveau_fbdev *nfbdev;
  441. struct apertures_struct *apertures;
  442. };
  443. static inline struct drm_nouveau_private *
  444. nouveau_private(struct drm_device *dev)
  445. {
  446. return dev->dev_private;
  447. }
  448. static inline struct drm_nouveau_private *
  449. nouveau_bdev(struct ttm_bo_device *bd)
  450. {
  451. return container_of(bd, struct drm_nouveau_private, ttm.bdev);
  452. }
  453. /* nouveau_drv.c */
  454. extern int nouveau_modeset;
  455. extern int nouveau_duallink;
  456. extern int nouveau_uscript_lvds;
  457. extern int nouveau_uscript_tmds;
  458. extern int nouveau_vram_pushbuf;
  459. extern int nouveau_vram_notify;
  460. extern char *nouveau_vram_type;
  461. extern int nouveau_fbpercrtc;
  462. extern int nouveau_tv_disable;
  463. extern char *nouveau_tv_norm;
  464. extern int nouveau_reg_debug;
  465. extern int nouveau_ignorelid;
  466. extern int nouveau_nofbaccel;
  467. extern int nouveau_noaccel;
  468. extern int nouveau_force_post;
  469. extern int nouveau_override_conntype;
  470. extern char *nouveau_perflvl;
  471. extern int nouveau_perflvl_wr;
  472. extern int nouveau_msi;
  473. extern int nouveau_ctxfw;
  474. extern int nouveau_mxmdcb;
  475. extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
  476. extern int nouveau_pci_resume(struct pci_dev *pdev);
  477. /* nouveau_state.c */
  478. extern int nouveau_open(struct drm_device *, struct drm_file *);
  479. extern void nouveau_preclose(struct drm_device *dev, struct drm_file *);
  480. extern void nouveau_postclose(struct drm_device *, struct drm_file *);
  481. extern int nouveau_load(struct drm_device *, unsigned long flags);
  482. extern int nouveau_firstopen(struct drm_device *);
  483. extern void nouveau_lastclose(struct drm_device *);
  484. extern int nouveau_unload(struct drm_device *);
  485. extern bool nouveau_wait_for_idle(struct drm_device *);
  486. extern int nouveau_card_init(struct drm_device *);
  487. /* nouveau_mem.c */
  488. extern int nouveau_mem_vram_init(struct drm_device *);
  489. extern void nouveau_mem_vram_fini(struct drm_device *);
  490. extern int nouveau_mem_gart_init(struct drm_device *);
  491. extern void nouveau_mem_gart_fini(struct drm_device *);
  492. extern void nouveau_mem_close(struct drm_device *);
  493. extern bool nouveau_mem_flags_valid(struct drm_device *, u32 tile_flags);
  494. extern int nouveau_mem_timing_calc(struct drm_device *, u32 freq,
  495. struct nouveau_pm_memtiming *);
  496. extern void nouveau_mem_timing_read(struct drm_device *,
  497. struct nouveau_pm_memtiming *);
  498. extern int nouveau_mem_vbios_type(struct drm_device *);
  499. extern struct nouveau_tile_reg *nv10_mem_set_tiling(
  500. struct drm_device *dev, uint32_t addr, uint32_t size,
  501. uint32_t pitch, uint32_t flags);
  502. extern void nv10_mem_put_tile_region(struct drm_device *dev,
  503. struct nouveau_tile_reg *tile,
  504. struct nouveau_fence *fence);
  505. extern const struct ttm_mem_type_manager_func nouveau_vram_manager;
  506. extern const struct ttm_mem_type_manager_func nouveau_gart_manager;
  507. extern const struct ttm_mem_type_manager_func nv04_gart_manager;
  508. /* nouveau_notifier.c */
  509. extern int nouveau_notifier_init_channel(struct nouveau_channel *);
  510. extern void nouveau_notifier_takedown_channel(struct nouveau_channel *);
  511. extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle,
  512. int cout, uint32_t start, uint32_t end,
  513. uint32_t *offset);
  514. /* nouveau_channel.c */
  515. extern void nouveau_channel_cleanup(struct drm_device *, struct drm_file *);
  516. extern int nouveau_channel_alloc(struct drm_device *dev,
  517. struct nouveau_channel **chan,
  518. struct drm_file *file_priv,
  519. uint32_t fb_ctxdma, uint32_t tt_ctxdma);
  520. extern struct nouveau_channel *
  521. nouveau_channel_get_unlocked(struct nouveau_channel *);
  522. extern struct nouveau_channel *
  523. nouveau_channel_get(struct drm_file *, int id);
  524. extern void nouveau_channel_put_unlocked(struct nouveau_channel **);
  525. extern void nouveau_channel_put(struct nouveau_channel **);
  526. extern void nouveau_channel_ref(struct nouveau_channel *chan,
  527. struct nouveau_channel **pchan);
  528. extern int nouveau_channel_idle(struct nouveau_channel *chan);
  529. /* nouveau_gpuobj.c */
  530. #define NVOBJ_ENGINE_ADD(d, e, p) do { \
  531. struct drm_nouveau_private *dev_priv = (d)->dev_private; \
  532. dev_priv->eng[NVOBJ_ENGINE_##e] = (p); \
  533. } while (0)
  534. #define NVOBJ_ENGINE_DEL(d, e) do { \
  535. struct drm_nouveau_private *dev_priv = (d)->dev_private; \
  536. dev_priv->eng[NVOBJ_ENGINE_##e] = NULL; \
  537. } while (0)
  538. #define NVOBJ_CLASS(d, c, e) do { \
  539. int ret = nouveau_gpuobj_class_new((d), (c), NVOBJ_ENGINE_##e); \
  540. if (ret) \
  541. return ret; \
  542. } while (0)
  543. #define NVOBJ_MTHD(d, c, m, e) do { \
  544. int ret = nouveau_gpuobj_mthd_new((d), (c), (m), (e)); \
  545. if (ret) \
  546. return ret; \
  547. } while (0)
  548. extern int nouveau_gpuobj_class_new(struct drm_device *, u32 class, u32 eng);
  549. extern int nouveau_gpuobj_mthd_new(struct drm_device *, u32 class, u32 mthd,
  550. int (*exec)(struct nouveau_channel *,
  551. u32 class, u32 mthd, u32 data));
  552. extern int nouveau_gpuobj_mthd_call(struct nouveau_channel *, u32, u32, u32);
  553. extern int nouveau_gpuobj_mthd_call2(struct drm_device *, int, u32, u32, u32);
  554. extern int nouveau_gpuobj_channel_init(struct nouveau_channel *,
  555. uint32_t vram_h, uint32_t tt_h);
  556. extern void nouveau_gpuobj_channel_takedown(struct nouveau_channel *);
  557. extern int nouveau_gpuobj_dma_new(struct nouveau_channel *, int class,
  558. uint64_t offset, uint64_t size, int access,
  559. int target, struct nouveau_gpuobj **);
  560. extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, u32 handle, int class);
  561. extern int nv50_gpuobj_dma_new(struct nouveau_channel *, int class, u64 base,
  562. u64 size, int target, int access, u32 type,
  563. u32 comp, struct nouveau_gpuobj **pobj);
  564. extern void nv50_gpuobj_dma_init(struct nouveau_gpuobj *, u32 offset,
  565. int class, u64 base, u64 size, int target,
  566. int access, u32 type, u32 comp);
  567. int nouveau_gpuobj_map_vm(struct nouveau_gpuobj *gpuobj, struct nouveau_vm *vm,
  568. u32 flags, struct nouveau_vma *vma);
  569. void nouveau_gpuobj_unmap(struct nouveau_vma *vma);
  570. /* nouveau_irq.c */
  571. extern int nouveau_irq_init(struct drm_device *);
  572. extern void nouveau_irq_fini(struct drm_device *);
  573. extern irqreturn_t nouveau_irq_handler(DRM_IRQ_ARGS);
  574. extern void nouveau_irq_register(struct drm_device *, int status_bit,
  575. void (*)(struct drm_device *));
  576. extern void nouveau_irq_unregister(struct drm_device *, int status_bit);
  577. extern void nouveau_irq_preinstall(struct drm_device *);
  578. extern int nouveau_irq_postinstall(struct drm_device *);
  579. extern void nouveau_irq_uninstall(struct drm_device *);
  580. /* nouveau_sgdma.c */
  581. extern int nouveau_sgdma_init(struct drm_device *);
  582. extern void nouveau_sgdma_takedown(struct drm_device *);
  583. extern uint32_t nouveau_sgdma_get_physical(struct drm_device *,
  584. uint32_t offset);
  585. extern struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
  586. unsigned long size,
  587. uint32_t page_flags,
  588. struct page *dummy_read_page);
  589. /* nouveau_debugfs.c */
  590. #if defined(CONFIG_DRM_NOUVEAU_DEBUG)
  591. extern int nouveau_debugfs_init(struct drm_minor *);
  592. extern void nouveau_debugfs_takedown(struct drm_minor *);
  593. extern int nouveau_debugfs_channel_init(struct nouveau_channel *);
  594. extern void nouveau_debugfs_channel_fini(struct nouveau_channel *);
  595. #else
  596. static inline int
  597. nouveau_debugfs_init(struct drm_minor *minor)
  598. {
  599. return 0;
  600. }
  601. static inline void nouveau_debugfs_takedown(struct drm_minor *minor)
  602. {
  603. }
  604. static inline int
  605. nouveau_debugfs_channel_init(struct nouveau_channel *chan)
  606. {
  607. return 0;
  608. }
  609. static inline void
  610. nouveau_debugfs_channel_fini(struct nouveau_channel *chan)
  611. {
  612. }
  613. #endif
  614. /* nouveau_dma.c */
  615. extern void nouveau_dma_init(struct nouveau_channel *);
  616. extern int nouveau_dma_wait(struct nouveau_channel *, int slots, int size);
  617. /* nouveau_acpi.c */
  618. #define ROM_BIOS_PAGE 4096
  619. #if defined(CONFIG_ACPI)
  620. void nouveau_register_dsm_handler(void);
  621. void nouveau_unregister_dsm_handler(void);
  622. void nouveau_switcheroo_optimus_dsm(void);
  623. int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len);
  624. bool nouveau_acpi_rom_supported(struct pci_dev *pdev);
  625. int nouveau_acpi_edid(struct drm_device *, struct drm_connector *);
  626. #else
  627. static inline void nouveau_register_dsm_handler(void) {}
  628. static inline void nouveau_unregister_dsm_handler(void) {}
  629. static inline void nouveau_switcheroo_optimus_dsm(void) {}
  630. static inline bool nouveau_acpi_rom_supported(struct pci_dev *pdev) { return false; }
  631. static inline int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len) { return -EINVAL; }
  632. static inline int nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector) { return -EINVAL; }
  633. #endif
  634. /* nouveau_backlight.c */
  635. #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
  636. extern int nouveau_backlight_init(struct drm_device *);
  637. extern void nouveau_backlight_exit(struct drm_device *);
  638. #else
  639. static inline int nouveau_backlight_init(struct drm_device *dev)
  640. {
  641. return 0;
  642. }
  643. static inline void nouveau_backlight_exit(struct drm_device *dev) { }
  644. #endif
  645. /* nouveau_bios.c */
  646. extern int nouveau_bios_init(struct drm_device *);
  647. extern void nouveau_bios_takedown(struct drm_device *dev);
  648. extern int nouveau_run_vbios_init(struct drm_device *);
  649. extern struct dcb_connector_table_entry *
  650. nouveau_bios_connector_entry(struct drm_device *, int index);
  651. extern int nouveau_bios_run_display_table(struct drm_device *, u16 id, int clk,
  652. struct dcb_output *, int crtc);
  653. extern bool nouveau_bios_fp_mode(struct drm_device *, struct drm_display_mode *);
  654. extern uint8_t *nouveau_bios_embedded_edid(struct drm_device *);
  655. extern int nouveau_bios_parse_lvds_table(struct drm_device *, int pxclk,
  656. bool *dl, bool *if_is_24bit);
  657. extern int run_tmds_table(struct drm_device *, struct dcb_output *,
  658. int head, int pxclk);
  659. extern int call_lvds_script(struct drm_device *, struct dcb_output *, int head,
  660. enum LVDS_script, int pxclk);
  661. bool bios_encoder_match(struct dcb_output *, u32 hash);
  662. /* nouveau_mxm.c */
  663. int nouveau_mxm_init(struct drm_device *dev);
  664. void nouveau_mxm_fini(struct drm_device *dev);
  665. /* nouveau_ttm.c */
  666. int nouveau_ttm_global_init(struct drm_nouveau_private *);
  667. void nouveau_ttm_global_release(struct drm_nouveau_private *);
  668. int nouveau_ttm_mmap(struct file *, struct vm_area_struct *);
  669. /* nouveau_hdmi.c */
  670. void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *);
  671. /* nv04_graph.c */
  672. extern int nv04_graph_create(struct drm_device *);
  673. extern int nv04_graph_object_new(struct nouveau_channel *, int, u32, u16);
  674. extern int nv04_graph_mthd_page_flip(struct nouveau_channel *chan,
  675. u32 class, u32 mthd, u32 data);
  676. extern struct nouveau_bitfield nv04_graph_nsource[];
  677. /* nv10_graph.c */
  678. extern int nv10_graph_create(struct drm_device *);
  679. extern struct nouveau_channel *nv10_graph_channel(struct drm_device *);
  680. extern struct nouveau_bitfield nv10_graph_intr[];
  681. extern struct nouveau_bitfield nv10_graph_nstatus[];
  682. /* nv20_graph.c */
  683. extern int nv20_graph_create(struct drm_device *);
  684. /* nv40_graph.c */
  685. extern int nv40_graph_create(struct drm_device *);
  686. extern void nv40_grctx_init(struct drm_device *, u32 *size);
  687. extern void nv40_grctx_fill(struct drm_device *, struct nouveau_gpuobj *);
  688. /* nv50_graph.c */
  689. extern int nv50_graph_create(struct drm_device *);
  690. extern struct nouveau_enum nv50_data_error_names[];
  691. extern int nv50_graph_isr_chid(struct drm_device *dev, u64 inst);
  692. extern int nv50_grctx_init(struct drm_device *, u32 *, u32, u32 *, u32 *);
  693. extern void nv50_grctx_fill(struct drm_device *, struct nouveau_gpuobj *);
  694. /* nvc0_graph.c */
  695. extern int nvc0_graph_create(struct drm_device *);
  696. extern int nvc0_graph_isr_chid(struct drm_device *dev, u64 inst);
  697. /* nve0_graph.c */
  698. extern int nve0_graph_create(struct drm_device *);
  699. /* nv84_crypt.c */
  700. extern int nv84_crypt_create(struct drm_device *);
  701. /* nv98_crypt.c */
  702. extern int nv98_crypt_create(struct drm_device *dev);
  703. /* nva3_copy.c */
  704. extern int nva3_copy_create(struct drm_device *dev);
  705. /* nvc0_copy.c */
  706. extern int nvc0_copy_create(struct drm_device *dev, int engine);
  707. /* nv31_mpeg.c */
  708. extern int nv31_mpeg_create(struct drm_device *dev);
  709. /* nv50_mpeg.c */
  710. extern int nv50_mpeg_create(struct drm_device *dev);
  711. /* nv84_bsp.c */
  712. /* nv98_bsp.c */
  713. extern int nv84_bsp_create(struct drm_device *dev);
  714. /* nv84_vp.c */
  715. /* nv98_vp.c */
  716. extern int nv84_vp_create(struct drm_device *dev);
  717. /* nv98_ppp.c */
  718. extern int nv98_ppp_create(struct drm_device *dev);
  719. extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd,
  720. unsigned long arg);
  721. /* nvd0_display.c */
  722. extern int nvd0_display_create(struct drm_device *);
  723. extern void nvd0_display_destroy(struct drm_device *);
  724. extern int nvd0_display_init(struct drm_device *);
  725. extern void nvd0_display_fini(struct drm_device *);
  726. struct nouveau_bo *nvd0_display_crtc_sema(struct drm_device *, int crtc);
  727. void nvd0_display_flip_stop(struct drm_crtc *);
  728. int nvd0_display_flip_next(struct drm_crtc *, struct drm_framebuffer *,
  729. struct nouveau_channel *, u32 swap_interval);
  730. /* nouveau_display.c */
  731. int nouveau_display_create(struct drm_device *dev);
  732. void nouveau_display_destroy(struct drm_device *dev);
  733. int nouveau_display_init(struct drm_device *dev);
  734. void nouveau_display_fini(struct drm_device *dev);
  735. int nouveau_vblank_enable(struct drm_device *dev, int crtc);
  736. void nouveau_vblank_disable(struct drm_device *dev, int crtc);
  737. int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
  738. struct drm_pending_vblank_event *event);
  739. int nouveau_finish_page_flip(struct nouveau_channel *,
  740. struct nouveau_page_flip_state *);
  741. int nouveau_display_dumb_create(struct drm_file *, struct drm_device *,
  742. struct drm_mode_create_dumb *args);
  743. int nouveau_display_dumb_map_offset(struct drm_file *, struct drm_device *,
  744. uint32_t handle, uint64_t *offset);
  745. int nouveau_display_dumb_destroy(struct drm_file *, struct drm_device *,
  746. uint32_t handle);
  747. #ifndef ioread32_native
  748. #ifdef __BIG_ENDIAN
  749. #define ioread16_native ioread16be
  750. #define iowrite16_native iowrite16be
  751. #define ioread32_native ioread32be
  752. #define iowrite32_native iowrite32be
  753. #else /* def __BIG_ENDIAN */
  754. #define ioread16_native ioread16
  755. #define iowrite16_native iowrite16
  756. #define ioread32_native ioread32
  757. #define iowrite32_native iowrite32
  758. #endif /* def __BIG_ENDIAN else */
  759. #endif /* !ioread32_native */
  760. /* channel control reg access */
  761. static inline u32 nvchan_rd32(struct nouveau_channel *chan, unsigned reg)
  762. {
  763. return ioread32_native(chan->user + reg);
  764. }
  765. static inline void nvchan_wr32(struct nouveau_channel *chan,
  766. unsigned reg, u32 val)
  767. {
  768. iowrite32_native(val, chan->user + reg);
  769. }
  770. /* register access */
  771. #define nv_rd08 _nv_rd08
  772. #define nv_wr08 _nv_wr08
  773. #define nv_rd32 _nv_rd32
  774. #define nv_wr32 _nv_wr32
  775. #define nv_mask _nv_mask
  776. #define nv_wait(dev, reg, mask, val) \
  777. nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
  778. #define nv_wait_ne(dev, reg, mask, val) \
  779. nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
  780. #define nv_wait_cb(dev, func, data) \
  781. nouveau_wait_cb(dev, 2000000000ULL, (func), (data))
  782. /*
  783. * Logging
  784. * Argument d is (struct drm_device *).
  785. */
  786. #define NV_PRINTK(level, d, fmt, arg...) \
  787. printk(level "[" DRM_NAME "] " DRIVER_NAME " %s: " fmt, \
  788. pci_name(d->pdev), ##arg)
  789. #ifndef NV_DEBUG_NOTRACE
  790. #define NV_DEBUG(d, fmt, arg...) do { \
  791. if (drm_debug & DRM_UT_DRIVER) { \
  792. NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \
  793. __LINE__, ##arg); \
  794. } \
  795. } while (0)
  796. #define NV_DEBUG_KMS(d, fmt, arg...) do { \
  797. if (drm_debug & DRM_UT_KMS) { \
  798. NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \
  799. __LINE__, ##arg); \
  800. } \
  801. } while (0)
  802. #else
  803. #define NV_DEBUG(d, fmt, arg...) do { \
  804. if (drm_debug & DRM_UT_DRIVER) \
  805. NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \
  806. } while (0)
  807. #define NV_DEBUG_KMS(d, fmt, arg...) do { \
  808. if (drm_debug & DRM_UT_KMS) \
  809. NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \
  810. } while (0)
  811. #endif
  812. #define NV_ERROR(d, fmt, arg...) NV_PRINTK(KERN_ERR, d, fmt, ##arg)
  813. #define NV_INFO(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg)
  814. #define NV_TRACEWARN(d, fmt, arg...) NV_PRINTK(KERN_NOTICE, d, fmt, ##arg)
  815. #define NV_TRACE(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg)
  816. #define NV_WARN(d, fmt, arg...) NV_PRINTK(KERN_WARNING, d, fmt, ##arg)
  817. #define NV_WARNONCE(d, fmt, arg...) do { \
  818. static int _warned = 0; \
  819. if (!_warned) { \
  820. NV_WARN(d, fmt, ##arg); \
  821. _warned = 1; \
  822. } \
  823. } while(0)
  824. /* nouveau_reg_debug bitmask */
  825. enum {
  826. NOUVEAU_REG_DEBUG_MC = 0x1,
  827. NOUVEAU_REG_DEBUG_VIDEO = 0x2,
  828. NOUVEAU_REG_DEBUG_FB = 0x4,
  829. NOUVEAU_REG_DEBUG_EXTDEV = 0x8,
  830. NOUVEAU_REG_DEBUG_CRTC = 0x10,
  831. NOUVEAU_REG_DEBUG_RAMDAC = 0x20,
  832. NOUVEAU_REG_DEBUG_VGACRTC = 0x40,
  833. NOUVEAU_REG_DEBUG_RMVIO = 0x80,
  834. NOUVEAU_REG_DEBUG_VGAATTR = 0x100,
  835. NOUVEAU_REG_DEBUG_EVO = 0x200,
  836. NOUVEAU_REG_DEBUG_AUXCH = 0x400
  837. };
  838. #define NV_REG_DEBUG(type, dev, fmt, arg...) do { \
  839. if (nouveau_reg_debug & NOUVEAU_REG_DEBUG_##type) \
  840. NV_PRINTK(KERN_DEBUG, dev, "%s: " fmt, __func__, ##arg); \
  841. } while (0)
  842. static inline bool
  843. nv_two_heads(struct drm_device *dev)
  844. {
  845. struct drm_nouveau_private *dev_priv = dev->dev_private;
  846. const int impl = dev->pci_device & 0x0ff0;
  847. if (dev_priv->card_type >= NV_10 && impl != 0x0100 &&
  848. impl != 0x0150 && impl != 0x01a0 && impl != 0x0200)
  849. return true;
  850. return false;
  851. }
  852. static inline bool
  853. nv_gf4_disp_arch(struct drm_device *dev)
  854. {
  855. return nv_two_heads(dev) && (dev->pci_device & 0x0ff0) != 0x0110;
  856. }
  857. static inline bool
  858. nv_two_reg_pll(struct drm_device *dev)
  859. {
  860. struct drm_nouveau_private *dev_priv = dev->dev_private;
  861. const int impl = dev->pci_device & 0x0ff0;
  862. if (impl == 0x0310 || impl == 0x0340 || dev_priv->card_type >= NV_40)
  863. return true;
  864. return false;
  865. }
  866. static inline bool
  867. nv_match_device(struct drm_device *dev, unsigned device,
  868. unsigned sub_vendor, unsigned sub_device)
  869. {
  870. return dev->pdev->device == device &&
  871. dev->pdev->subsystem_vendor == sub_vendor &&
  872. dev->pdev->subsystem_device == sub_device;
  873. }
  874. static inline void *
  875. nv_engine(struct drm_device *dev, int engine)
  876. {
  877. struct drm_nouveau_private *dev_priv = dev->dev_private;
  878. return (void *)dev_priv->eng[engine];
  879. }
  880. /* returns 1 if device is one of the nv4x using the 0x4497 object class,
  881. * helpful to determine a number of other hardware features
  882. */
  883. static inline int
  884. nv44_graph_class(struct drm_device *dev)
  885. {
  886. struct drm_nouveau_private *dev_priv = dev->dev_private;
  887. if ((dev_priv->chipset & 0xf0) == 0x60)
  888. return 1;
  889. return !(0x0baf & (1 << (dev_priv->chipset & 0x0f)));
  890. }
  891. /* memory type/access flags, do not match hardware values */
  892. #define NV_MEM_ACCESS_RO 1
  893. #define NV_MEM_ACCESS_WO 2
  894. #define NV_MEM_ACCESS_RW (NV_MEM_ACCESS_RO | NV_MEM_ACCESS_WO)
  895. #define NV_MEM_ACCESS_SYS 4
  896. #define NV_MEM_ACCESS_VM 8
  897. #define NV_MEM_ACCESS_NOSNOOP 16
  898. #define NV_MEM_TARGET_VRAM 0
  899. #define NV_MEM_TARGET_PCI 1
  900. #define NV_MEM_TARGET_PCI_NOSNOOP 2
  901. #define NV_MEM_TARGET_VM 3
  902. #define NV_MEM_TARGET_GART 4
  903. #define NV_MEM_TYPE_VM 0x7f
  904. #define NV_MEM_COMP_VM 0x03
  905. /* FIFO methods */
  906. #define NV01_SUBCHAN_OBJECT 0x00000000
  907. #define NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH 0x00000010
  908. #define NV84_SUBCHAN_SEMAPHORE_ADDRESS_LOW 0x00000014
  909. #define NV84_SUBCHAN_SEMAPHORE_SEQUENCE 0x00000018
  910. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER 0x0000001c
  911. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_EQUAL 0x00000001
  912. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG 0x00000002
  913. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL 0x00000004
  914. #define NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD 0x00001000
  915. #define NV84_SUBCHAN_NOTIFY_INTR 0x00000020
  916. #define NV84_SUBCHAN_WRCACHE_FLUSH 0x00000024
  917. #define NV10_SUBCHAN_REF_CNT 0x00000050
  918. #define NVSW_SUBCHAN_PAGE_FLIP 0x00000054
  919. #define NV11_SUBCHAN_DMA_SEMAPHORE 0x00000060
  920. #define NV11_SUBCHAN_SEMAPHORE_OFFSET 0x00000064
  921. #define NV11_SUBCHAN_SEMAPHORE_ACQUIRE 0x00000068
  922. #define NV11_SUBCHAN_SEMAPHORE_RELEASE 0x0000006c
  923. #define NV40_SUBCHAN_YIELD 0x00000080
  924. /* NV_SW object class */
  925. #define NV_SW 0x0000506e
  926. #define NV_SW_DMA_VBLSEM 0x0000018c
  927. #define NV_SW_VBLSEM_OFFSET 0x00000400
  928. #define NV_SW_VBLSEM_RELEASE_VALUE 0x00000404
  929. #define NV_SW_VBLSEM_RELEASE 0x00000408
  930. #define NV_SW_PAGE_FLIP 0x00000500
  931. #endif /* __NOUVEAU_DRV_H__ */