nouveau_drv.h 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098
  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_NR 16
  114. #define NVOBJ_ENGINE_DISPLAY (NVOBJ_ENGINE_NR + 0) /*XXX*/
  115. struct nouveau_page_flip_state {
  116. struct list_head head;
  117. struct drm_pending_vblank_event *event;
  118. int crtc, bpp, pitch, x, y;
  119. uint64_t offset;
  120. };
  121. enum nouveau_channel_mutex_class {
  122. NOUVEAU_UCHANNEL_MUTEX,
  123. NOUVEAU_KCHANNEL_MUTEX
  124. };
  125. struct nouveau_channel {
  126. struct drm_device *dev;
  127. struct list_head list;
  128. int id;
  129. /* references to the channel data structure */
  130. struct kref ref;
  131. /* users of the hardware channel resources, the hardware
  132. * context will be kicked off when it reaches zero. */
  133. atomic_t users;
  134. struct mutex mutex;
  135. /* owner of this fifo */
  136. struct drm_file *file_priv;
  137. /* mapping of the fifo itself */
  138. struct drm_local_map *map;
  139. /* mapping of the regs controlling the fifo */
  140. void __iomem *user;
  141. uint32_t user_get;
  142. uint32_t user_get_hi;
  143. uint32_t user_put;
  144. /* DMA push buffer */
  145. struct nouveau_gpuobj *pushbuf;
  146. struct nouveau_bo *pushbuf_bo;
  147. struct nouveau_vma pushbuf_vma;
  148. uint64_t pushbuf_base;
  149. /* Notifier memory */
  150. struct nouveau_bo *notifier_bo;
  151. struct nouveau_vma notifier_vma;
  152. struct drm_mm notifier_heap;
  153. /* PFIFO context */
  154. struct nouveau_gpuobj *engptr;
  155. struct nouveau_gpuobj *ramfc;
  156. /* Execution engine contexts */
  157. void *engctx[NVOBJ_ENGINE_NR];
  158. void *fence;
  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. void *func;
  394. spinlock_t lock;
  395. struct drm_mm heap;
  396. struct nouveau_bo *bo;
  397. } fence;
  398. struct {
  399. spinlock_t lock;
  400. struct nouveau_channel *ptr[NOUVEAU_MAX_CHANNEL_NR];
  401. } channels;
  402. struct nouveau_engine engine;
  403. struct nouveau_channel *channel;
  404. /* For PFIFO and PGRAPH. */
  405. spinlock_t context_switch_lock;
  406. /* VM/PRAMIN flush, legacy PRAMIN aperture */
  407. spinlock_t vm_lock;
  408. /* RAMIN configuration, RAMFC, RAMHT and RAMRO offsets */
  409. struct nouveau_ramht *ramht;
  410. struct {
  411. enum {
  412. NOUVEAU_GART_NONE = 0,
  413. NOUVEAU_GART_AGP, /* AGP */
  414. NOUVEAU_GART_PDMA, /* paged dma object */
  415. NOUVEAU_GART_HW /* on-chip gart/vm */
  416. } type;
  417. uint64_t aper_base;
  418. uint64_t aper_size;
  419. uint64_t aper_free;
  420. struct ttm_backend_func *func;
  421. struct nouveau_gpuobj *sg_ctxdma;
  422. } gart_info;
  423. /* nv10-nv40 tiling regions */
  424. struct {
  425. struct nouveau_tile_reg reg[NOUVEAU_MAX_TILE_NR];
  426. spinlock_t lock;
  427. } tile;
  428. uint64_t fb_available_size;
  429. uint64_t fb_mappable_pages;
  430. uint64_t fb_aper_free;
  431. int fb_mtrr;
  432. /* G8x/G9x virtual address space */
  433. struct nouveau_vm *chan_vm;
  434. struct nvbios vbios;
  435. u8 *mxms;
  436. struct list_head i2c_ports;
  437. struct backlight_device *backlight;
  438. struct {
  439. struct dentry *channel_root;
  440. } debugfs;
  441. struct nouveau_fbdev *nfbdev;
  442. struct apertures_struct *apertures;
  443. };
  444. static inline struct drm_nouveau_private *
  445. nouveau_private(struct drm_device *dev)
  446. {
  447. return dev->dev_private;
  448. }
  449. static inline struct drm_nouveau_private *
  450. nouveau_bdev(struct ttm_bo_device *bd)
  451. {
  452. return container_of(bd, struct drm_nouveau_private, ttm.bdev);
  453. }
  454. /* nouveau_drv.c */
  455. extern int nouveau_modeset;
  456. extern int nouveau_duallink;
  457. extern int nouveau_uscript_lvds;
  458. extern int nouveau_uscript_tmds;
  459. extern int nouveau_vram_pushbuf;
  460. extern int nouveau_vram_notify;
  461. extern char *nouveau_vram_type;
  462. extern int nouveau_fbpercrtc;
  463. extern int nouveau_tv_disable;
  464. extern char *nouveau_tv_norm;
  465. extern int nouveau_reg_debug;
  466. extern int nouveau_ignorelid;
  467. extern int nouveau_nofbaccel;
  468. extern int nouveau_noaccel;
  469. extern int nouveau_force_post;
  470. extern int nouveau_override_conntype;
  471. extern char *nouveau_perflvl;
  472. extern int nouveau_perflvl_wr;
  473. extern int nouveau_msi;
  474. extern int nouveau_ctxfw;
  475. extern int nouveau_mxmdcb;
  476. extern int nouveau_pci_suspend(struct pci_dev *pdev, pm_message_t pm_state);
  477. extern int nouveau_pci_resume(struct pci_dev *pdev);
  478. /* nouveau_state.c */
  479. extern int nouveau_open(struct drm_device *, struct drm_file *);
  480. extern void nouveau_preclose(struct drm_device *dev, struct drm_file *);
  481. extern void nouveau_postclose(struct drm_device *, struct drm_file *);
  482. extern int nouveau_load(struct drm_device *, unsigned long flags);
  483. extern int nouveau_firstopen(struct drm_device *);
  484. extern void nouveau_lastclose(struct drm_device *);
  485. extern int nouveau_unload(struct drm_device *);
  486. extern bool nouveau_wait_for_idle(struct drm_device *);
  487. extern int nouveau_card_init(struct drm_device *);
  488. /* nouveau_mem.c */
  489. extern int nouveau_mem_vram_init(struct drm_device *);
  490. extern void nouveau_mem_vram_fini(struct drm_device *);
  491. extern int nouveau_mem_gart_init(struct drm_device *);
  492. extern void nouveau_mem_gart_fini(struct drm_device *);
  493. extern void nouveau_mem_close(struct drm_device *);
  494. extern bool nouveau_mem_flags_valid(struct drm_device *, u32 tile_flags);
  495. extern int nouveau_mem_timing_calc(struct drm_device *, u32 freq,
  496. struct nouveau_pm_memtiming *);
  497. extern void nouveau_mem_timing_read(struct drm_device *,
  498. struct nouveau_pm_memtiming *);
  499. extern int nouveau_mem_vbios_type(struct drm_device *);
  500. extern struct nouveau_tile_reg *nv10_mem_set_tiling(
  501. struct drm_device *dev, uint32_t addr, uint32_t size,
  502. uint32_t pitch, uint32_t flags);
  503. extern void nv10_mem_put_tile_region(struct drm_device *dev,
  504. struct nouveau_tile_reg *tile,
  505. struct nouveau_fence *fence);
  506. extern const struct ttm_mem_type_manager_func nouveau_vram_manager;
  507. extern const struct ttm_mem_type_manager_func nouveau_gart_manager;
  508. extern const struct ttm_mem_type_manager_func nv04_gart_manager;
  509. /* nouveau_notifier.c */
  510. extern int nouveau_notifier_init_channel(struct nouveau_channel *);
  511. extern void nouveau_notifier_takedown_channel(struct nouveau_channel *);
  512. extern int nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle,
  513. int cout, uint32_t start, uint32_t end,
  514. uint32_t *offset);
  515. /* nouveau_channel.c */
  516. extern void nouveau_channel_cleanup(struct drm_device *, struct drm_file *);
  517. extern int nouveau_channel_alloc(struct drm_device *dev,
  518. struct nouveau_channel **chan,
  519. struct drm_file *file_priv,
  520. uint32_t fb_ctxdma, uint32_t tt_ctxdma);
  521. extern struct nouveau_channel *
  522. nouveau_channel_get_unlocked(struct nouveau_channel *);
  523. extern struct nouveau_channel *
  524. nouveau_channel_get(struct drm_file *, int id);
  525. extern void nouveau_channel_put_unlocked(struct nouveau_channel **);
  526. extern void nouveau_channel_put(struct nouveau_channel **);
  527. extern void nouveau_channel_ref(struct nouveau_channel *chan,
  528. struct nouveau_channel **pchan);
  529. extern int nouveau_channel_idle(struct nouveau_channel *chan);
  530. /* nouveau_gpuobj.c */
  531. #define NVOBJ_ENGINE_ADD(d, e, p) do { \
  532. struct drm_nouveau_private *dev_priv = (d)->dev_private; \
  533. dev_priv->eng[NVOBJ_ENGINE_##e] = (p); \
  534. } while (0)
  535. #define NVOBJ_ENGINE_DEL(d, e) do { \
  536. struct drm_nouveau_private *dev_priv = (d)->dev_private; \
  537. dev_priv->eng[NVOBJ_ENGINE_##e] = NULL; \
  538. } while (0)
  539. #define NVOBJ_CLASS(d, c, e) do { \
  540. int ret = nouveau_gpuobj_class_new((d), (c), NVOBJ_ENGINE_##e); \
  541. if (ret) \
  542. return ret; \
  543. } while (0)
  544. #define NVOBJ_MTHD(d, c, m, e) do { \
  545. int ret = nouveau_gpuobj_mthd_new((d), (c), (m), (e)); \
  546. if (ret) \
  547. return ret; \
  548. } while (0)
  549. extern int nouveau_gpuobj_class_new(struct drm_device *, u32 class, u32 eng);
  550. extern int nouveau_gpuobj_mthd_new(struct drm_device *, u32 class, u32 mthd,
  551. int (*exec)(struct nouveau_channel *,
  552. u32 class, u32 mthd, u32 data));
  553. extern int nouveau_gpuobj_mthd_call(struct nouveau_channel *, u32, u32, u32);
  554. extern int nouveau_gpuobj_mthd_call2(struct drm_device *, int, u32, u32, u32);
  555. extern int nouveau_gpuobj_channel_init(struct nouveau_channel *,
  556. uint32_t vram_h, uint32_t tt_h);
  557. extern void nouveau_gpuobj_channel_takedown(struct nouveau_channel *);
  558. extern int nouveau_gpuobj_dma_new(struct nouveau_channel *, int class,
  559. uint64_t offset, uint64_t size, int access,
  560. int target, struct nouveau_gpuobj **);
  561. extern int nouveau_gpuobj_gr_new(struct nouveau_channel *, u32 handle, int class);
  562. extern int nv50_gpuobj_dma_new(struct nouveau_channel *, int class, u64 base,
  563. u64 size, int target, int access, u32 type,
  564. u32 comp, struct nouveau_gpuobj **pobj);
  565. extern void nv50_gpuobj_dma_init(struct nouveau_gpuobj *, u32 offset,
  566. int class, u64 base, u64 size, int target,
  567. int access, u32 type, u32 comp);
  568. int nouveau_gpuobj_map_vm(struct nouveau_gpuobj *gpuobj, struct nouveau_vm *vm,
  569. u32 flags, struct nouveau_vma *vma);
  570. void nouveau_gpuobj_unmap(struct nouveau_vma *vma);
  571. /* nouveau_irq.c */
  572. extern int nouveau_irq_init(struct drm_device *);
  573. extern void nouveau_irq_fini(struct drm_device *);
  574. extern irqreturn_t nouveau_irq_handler(DRM_IRQ_ARGS);
  575. extern void nouveau_irq_register(struct drm_device *, int status_bit,
  576. void (*)(struct drm_device *));
  577. extern void nouveau_irq_unregister(struct drm_device *, int status_bit);
  578. extern void nouveau_irq_preinstall(struct drm_device *);
  579. extern int nouveau_irq_postinstall(struct drm_device *);
  580. extern void nouveau_irq_uninstall(struct drm_device *);
  581. /* nouveau_sgdma.c */
  582. extern int nouveau_sgdma_init(struct drm_device *);
  583. extern void nouveau_sgdma_takedown(struct drm_device *);
  584. extern uint32_t nouveau_sgdma_get_physical(struct drm_device *,
  585. uint32_t offset);
  586. extern struct ttm_tt *nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev,
  587. unsigned long size,
  588. uint32_t page_flags,
  589. struct page *dummy_read_page);
  590. /* nouveau_debugfs.c */
  591. #if defined(CONFIG_DRM_NOUVEAU_DEBUG)
  592. extern int nouveau_debugfs_init(struct drm_minor *);
  593. extern void nouveau_debugfs_takedown(struct drm_minor *);
  594. extern int nouveau_debugfs_channel_init(struct nouveau_channel *);
  595. extern void nouveau_debugfs_channel_fini(struct nouveau_channel *);
  596. #else
  597. static inline int
  598. nouveau_debugfs_init(struct drm_minor *minor)
  599. {
  600. return 0;
  601. }
  602. static inline void nouveau_debugfs_takedown(struct drm_minor *minor)
  603. {
  604. }
  605. static inline int
  606. nouveau_debugfs_channel_init(struct nouveau_channel *chan)
  607. {
  608. return 0;
  609. }
  610. static inline void
  611. nouveau_debugfs_channel_fini(struct nouveau_channel *chan)
  612. {
  613. }
  614. #endif
  615. /* nouveau_dma.c */
  616. extern void nouveau_dma_init(struct nouveau_channel *);
  617. extern int nouveau_dma_wait(struct nouveau_channel *, int slots, int size);
  618. /* nouveau_acpi.c */
  619. #define ROM_BIOS_PAGE 4096
  620. #if defined(CONFIG_ACPI)
  621. void nouveau_register_dsm_handler(void);
  622. void nouveau_unregister_dsm_handler(void);
  623. void nouveau_switcheroo_optimus_dsm(void);
  624. int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len);
  625. bool nouveau_acpi_rom_supported(struct pci_dev *pdev);
  626. int nouveau_acpi_edid(struct drm_device *, struct drm_connector *);
  627. #else
  628. static inline void nouveau_register_dsm_handler(void) {}
  629. static inline void nouveau_unregister_dsm_handler(void) {}
  630. static inline void nouveau_switcheroo_optimus_dsm(void) {}
  631. static inline bool nouveau_acpi_rom_supported(struct pci_dev *pdev) { return false; }
  632. static inline int nouveau_acpi_get_bios_chunk(uint8_t *bios, int offset, int len) { return -EINVAL; }
  633. static inline int nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector) { return -EINVAL; }
  634. #endif
  635. /* nouveau_backlight.c */
  636. #ifdef CONFIG_DRM_NOUVEAU_BACKLIGHT
  637. extern int nouveau_backlight_init(struct drm_device *);
  638. extern void nouveau_backlight_exit(struct drm_device *);
  639. #else
  640. static inline int nouveau_backlight_init(struct drm_device *dev)
  641. {
  642. return 0;
  643. }
  644. static inline void nouveau_backlight_exit(struct drm_device *dev) { }
  645. #endif
  646. /* nouveau_bios.c */
  647. extern int nouveau_bios_init(struct drm_device *);
  648. extern void nouveau_bios_takedown(struct drm_device *dev);
  649. extern int nouveau_run_vbios_init(struct drm_device *);
  650. extern struct dcb_connector_table_entry *
  651. nouveau_bios_connector_entry(struct drm_device *, int index);
  652. extern int nouveau_bios_run_display_table(struct drm_device *, u16 id, int clk,
  653. struct dcb_output *, int crtc);
  654. extern bool nouveau_bios_fp_mode(struct drm_device *, struct drm_display_mode *);
  655. extern uint8_t *nouveau_bios_embedded_edid(struct drm_device *);
  656. extern int nouveau_bios_parse_lvds_table(struct drm_device *, int pxclk,
  657. bool *dl, bool *if_is_24bit);
  658. extern int run_tmds_table(struct drm_device *, struct dcb_output *,
  659. int head, int pxclk);
  660. extern int call_lvds_script(struct drm_device *, struct dcb_output *, int head,
  661. enum LVDS_script, int pxclk);
  662. bool bios_encoder_match(struct dcb_output *, u32 hash);
  663. /* nouveau_mxm.c */
  664. int nouveau_mxm_init(struct drm_device *dev);
  665. void nouveau_mxm_fini(struct drm_device *dev);
  666. /* nouveau_ttm.c */
  667. int nouveau_ttm_global_init(struct drm_nouveau_private *);
  668. void nouveau_ttm_global_release(struct drm_nouveau_private *);
  669. int nouveau_ttm_mmap(struct file *, struct vm_area_struct *);
  670. /* nouveau_hdmi.c */
  671. void nouveau_hdmi_mode_set(struct drm_encoder *, struct drm_display_mode *);
  672. /* nv04_graph.c */
  673. extern int nv04_graph_create(struct drm_device *);
  674. extern int nv04_graph_object_new(struct nouveau_channel *, int, u32, u16);
  675. extern int nv04_graph_mthd_page_flip(struct nouveau_channel *chan,
  676. u32 class, u32 mthd, u32 data);
  677. extern struct nouveau_bitfield nv04_graph_nsource[];
  678. /* nv10_graph.c */
  679. extern int nv10_graph_create(struct drm_device *);
  680. extern struct nouveau_channel *nv10_graph_channel(struct drm_device *);
  681. extern struct nouveau_bitfield nv10_graph_intr[];
  682. extern struct nouveau_bitfield nv10_graph_nstatus[];
  683. /* nv20_graph.c */
  684. extern int nv20_graph_create(struct drm_device *);
  685. /* nv40_graph.c */
  686. extern int nv40_graph_create(struct drm_device *);
  687. extern void nv40_grctx_init(struct drm_device *, u32 *size);
  688. extern void nv40_grctx_fill(struct drm_device *, struct nouveau_gpuobj *);
  689. /* nv50_graph.c */
  690. extern int nv50_graph_create(struct drm_device *);
  691. extern struct nouveau_enum nv50_data_error_names[];
  692. extern int nv50_graph_isr_chid(struct drm_device *dev, u64 inst);
  693. extern int nv50_grctx_init(struct drm_device *, u32 *, u32, u32 *, u32 *);
  694. extern void nv50_grctx_fill(struct drm_device *, struct nouveau_gpuobj *);
  695. /* nvc0_graph.c */
  696. extern int nvc0_graph_create(struct drm_device *);
  697. extern int nvc0_graph_isr_chid(struct drm_device *dev, u64 inst);
  698. /* nve0_graph.c */
  699. extern int nve0_graph_create(struct drm_device *);
  700. /* nv84_crypt.c */
  701. extern int nv84_crypt_create(struct drm_device *);
  702. /* nv98_crypt.c */
  703. extern int nv98_crypt_create(struct drm_device *dev);
  704. /* nva3_copy.c */
  705. extern int nva3_copy_create(struct drm_device *dev);
  706. /* nvc0_copy.c */
  707. extern int nvc0_copy_create(struct drm_device *dev, int engine);
  708. /* nv31_mpeg.c */
  709. extern int nv31_mpeg_create(struct drm_device *dev);
  710. /* nv50_mpeg.c */
  711. extern int nv50_mpeg_create(struct drm_device *dev);
  712. /* nv84_bsp.c */
  713. /* nv98_bsp.c */
  714. extern int nv84_bsp_create(struct drm_device *dev);
  715. /* nv84_vp.c */
  716. /* nv98_vp.c */
  717. extern int nv84_vp_create(struct drm_device *dev);
  718. /* nv98_ppp.c */
  719. extern int nv98_ppp_create(struct drm_device *dev);
  720. extern long nouveau_compat_ioctl(struct file *file, unsigned int cmd,
  721. unsigned long arg);
  722. /* nvd0_display.c */
  723. extern int nvd0_display_create(struct drm_device *);
  724. extern void nvd0_display_destroy(struct drm_device *);
  725. extern int nvd0_display_init(struct drm_device *);
  726. extern void nvd0_display_fini(struct drm_device *);
  727. struct nouveau_bo *nvd0_display_crtc_sema(struct drm_device *, int crtc);
  728. void nvd0_display_flip_stop(struct drm_crtc *);
  729. int nvd0_display_flip_next(struct drm_crtc *, struct drm_framebuffer *,
  730. struct nouveau_channel *, u32 swap_interval);
  731. /* nouveau_display.c */
  732. int nouveau_display_create(struct drm_device *dev);
  733. void nouveau_display_destroy(struct drm_device *dev);
  734. int nouveau_display_init(struct drm_device *dev);
  735. void nouveau_display_fini(struct drm_device *dev);
  736. int nouveau_vblank_enable(struct drm_device *dev, int crtc);
  737. void nouveau_vblank_disable(struct drm_device *dev, int crtc);
  738. int nouveau_crtc_page_flip(struct drm_crtc *crtc, struct drm_framebuffer *fb,
  739. struct drm_pending_vblank_event *event);
  740. int nouveau_finish_page_flip(struct nouveau_channel *,
  741. struct nouveau_page_flip_state *);
  742. int nouveau_display_dumb_create(struct drm_file *, struct drm_device *,
  743. struct drm_mode_create_dumb *args);
  744. int nouveau_display_dumb_map_offset(struct drm_file *, struct drm_device *,
  745. uint32_t handle, uint64_t *offset);
  746. int nouveau_display_dumb_destroy(struct drm_file *, struct drm_device *,
  747. uint32_t handle);
  748. #ifndef ioread32_native
  749. #ifdef __BIG_ENDIAN
  750. #define ioread16_native ioread16be
  751. #define iowrite16_native iowrite16be
  752. #define ioread32_native ioread32be
  753. #define iowrite32_native iowrite32be
  754. #else /* def __BIG_ENDIAN */
  755. #define ioread16_native ioread16
  756. #define iowrite16_native iowrite16
  757. #define ioread32_native ioread32
  758. #define iowrite32_native iowrite32
  759. #endif /* def __BIG_ENDIAN else */
  760. #endif /* !ioread32_native */
  761. /* channel control reg access */
  762. static inline u32 nvchan_rd32(struct nouveau_channel *chan, unsigned reg)
  763. {
  764. return ioread32_native(chan->user + reg);
  765. }
  766. static inline void nvchan_wr32(struct nouveau_channel *chan,
  767. unsigned reg, u32 val)
  768. {
  769. iowrite32_native(val, chan->user + reg);
  770. }
  771. /* register access */
  772. #define nv_rd08 _nv_rd08
  773. #define nv_wr08 _nv_wr08
  774. #define nv_rd32 _nv_rd32
  775. #define nv_wr32 _nv_wr32
  776. #define nv_mask _nv_mask
  777. #define nv_wait(dev, reg, mask, val) \
  778. nouveau_wait_eq(dev, 2000000000ULL, (reg), (mask), (val))
  779. #define nv_wait_ne(dev, reg, mask, val) \
  780. nouveau_wait_ne(dev, 2000000000ULL, (reg), (mask), (val))
  781. #define nv_wait_cb(dev, func, data) \
  782. nouveau_wait_cb(dev, 2000000000ULL, (func), (data))
  783. /*
  784. * Logging
  785. * Argument d is (struct drm_device *).
  786. */
  787. #define NV_PRINTK(level, d, fmt, arg...) \
  788. printk(level "[" DRM_NAME "] " DRIVER_NAME " %s: " fmt, \
  789. pci_name(d->pdev), ##arg)
  790. #ifndef NV_DEBUG_NOTRACE
  791. #define NV_DEBUG(d, fmt, arg...) do { \
  792. if (drm_debug & DRM_UT_DRIVER) { \
  793. NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \
  794. __LINE__, ##arg); \
  795. } \
  796. } while (0)
  797. #define NV_DEBUG_KMS(d, fmt, arg...) do { \
  798. if (drm_debug & DRM_UT_KMS) { \
  799. NV_PRINTK(KERN_DEBUG, d, "%s:%d - " fmt, __func__, \
  800. __LINE__, ##arg); \
  801. } \
  802. } while (0)
  803. #else
  804. #define NV_DEBUG(d, fmt, arg...) do { \
  805. if (drm_debug & DRM_UT_DRIVER) \
  806. NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \
  807. } while (0)
  808. #define NV_DEBUG_KMS(d, fmt, arg...) do { \
  809. if (drm_debug & DRM_UT_KMS) \
  810. NV_PRINTK(KERN_DEBUG, d, fmt, ##arg); \
  811. } while (0)
  812. #endif
  813. #define NV_ERROR(d, fmt, arg...) NV_PRINTK(KERN_ERR, d, fmt, ##arg)
  814. #define NV_INFO(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg)
  815. #define NV_TRACEWARN(d, fmt, arg...) NV_PRINTK(KERN_NOTICE, d, fmt, ##arg)
  816. #define NV_TRACE(d, fmt, arg...) NV_PRINTK(KERN_INFO, d, fmt, ##arg)
  817. #define NV_WARN(d, fmt, arg...) NV_PRINTK(KERN_WARNING, d, fmt, ##arg)
  818. #define NV_WARNONCE(d, fmt, arg...) do { \
  819. static int _warned = 0; \
  820. if (!_warned) { \
  821. NV_WARN(d, fmt, ##arg); \
  822. _warned = 1; \
  823. } \
  824. } while(0)
  825. /* nouveau_reg_debug bitmask */
  826. enum {
  827. NOUVEAU_REG_DEBUG_MC = 0x1,
  828. NOUVEAU_REG_DEBUG_VIDEO = 0x2,
  829. NOUVEAU_REG_DEBUG_FB = 0x4,
  830. NOUVEAU_REG_DEBUG_EXTDEV = 0x8,
  831. NOUVEAU_REG_DEBUG_CRTC = 0x10,
  832. NOUVEAU_REG_DEBUG_RAMDAC = 0x20,
  833. NOUVEAU_REG_DEBUG_VGACRTC = 0x40,
  834. NOUVEAU_REG_DEBUG_RMVIO = 0x80,
  835. NOUVEAU_REG_DEBUG_VGAATTR = 0x100,
  836. NOUVEAU_REG_DEBUG_EVO = 0x200,
  837. NOUVEAU_REG_DEBUG_AUXCH = 0x400
  838. };
  839. #define NV_REG_DEBUG(type, dev, fmt, arg...) do { \
  840. if (nouveau_reg_debug & NOUVEAU_REG_DEBUG_##type) \
  841. NV_PRINTK(KERN_DEBUG, dev, "%s: " fmt, __func__, ##arg); \
  842. } while (0)
  843. static inline bool
  844. nv_two_heads(struct drm_device *dev)
  845. {
  846. struct drm_nouveau_private *dev_priv = dev->dev_private;
  847. const int impl = dev->pci_device & 0x0ff0;
  848. if (dev_priv->card_type >= NV_10 && impl != 0x0100 &&
  849. impl != 0x0150 && impl != 0x01a0 && impl != 0x0200)
  850. return true;
  851. return false;
  852. }
  853. static inline bool
  854. nv_gf4_disp_arch(struct drm_device *dev)
  855. {
  856. return nv_two_heads(dev) && (dev->pci_device & 0x0ff0) != 0x0110;
  857. }
  858. static inline bool
  859. nv_two_reg_pll(struct drm_device *dev)
  860. {
  861. struct drm_nouveau_private *dev_priv = dev->dev_private;
  862. const int impl = dev->pci_device & 0x0ff0;
  863. if (impl == 0x0310 || impl == 0x0340 || dev_priv->card_type >= NV_40)
  864. return true;
  865. return false;
  866. }
  867. static inline bool
  868. nv_match_device(struct drm_device *dev, unsigned device,
  869. unsigned sub_vendor, unsigned sub_device)
  870. {
  871. return dev->pdev->device == device &&
  872. dev->pdev->subsystem_vendor == sub_vendor &&
  873. dev->pdev->subsystem_device == sub_device;
  874. }
  875. static inline void *
  876. nv_engine(struct drm_device *dev, int engine)
  877. {
  878. struct drm_nouveau_private *dev_priv = dev->dev_private;
  879. return (void *)dev_priv->eng[engine];
  880. }
  881. /* returns 1 if device is one of the nv4x using the 0x4497 object class,
  882. * helpful to determine a number of other hardware features
  883. */
  884. static inline int
  885. nv44_graph_class(struct drm_device *dev)
  886. {
  887. struct drm_nouveau_private *dev_priv = dev->dev_private;
  888. if ((dev_priv->chipset & 0xf0) == 0x60)
  889. return 1;
  890. return !(0x0baf & (1 << (dev_priv->chipset & 0x0f)));
  891. }
  892. /* memory type/access flags, do not match hardware values */
  893. #define NV_MEM_ACCESS_RO 1
  894. #define NV_MEM_ACCESS_WO 2
  895. #define NV_MEM_ACCESS_RW (NV_MEM_ACCESS_RO | NV_MEM_ACCESS_WO)
  896. #define NV_MEM_ACCESS_SYS 4
  897. #define NV_MEM_ACCESS_VM 8
  898. #define NV_MEM_ACCESS_NOSNOOP 16
  899. #define NV_MEM_TARGET_VRAM 0
  900. #define NV_MEM_TARGET_PCI 1
  901. #define NV_MEM_TARGET_PCI_NOSNOOP 2
  902. #define NV_MEM_TARGET_VM 3
  903. #define NV_MEM_TARGET_GART 4
  904. #define NV_MEM_TYPE_VM 0x7f
  905. #define NV_MEM_COMP_VM 0x03
  906. /* FIFO methods */
  907. #define NV01_SUBCHAN_OBJECT 0x00000000
  908. #define NV84_SUBCHAN_SEMAPHORE_ADDRESS_HIGH 0x00000010
  909. #define NV84_SUBCHAN_SEMAPHORE_ADDRESS_LOW 0x00000014
  910. #define NV84_SUBCHAN_SEMAPHORE_SEQUENCE 0x00000018
  911. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER 0x0000001c
  912. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_EQUAL 0x00000001
  913. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_WRITE_LONG 0x00000002
  914. #define NV84_SUBCHAN_SEMAPHORE_TRIGGER_ACQUIRE_GEQUAL 0x00000004
  915. #define NVC0_SUBCHAN_SEMAPHORE_TRIGGER_YIELD 0x00001000
  916. #define NV84_SUBCHAN_NOTIFY_INTR 0x00000020
  917. #define NV84_SUBCHAN_WRCACHE_FLUSH 0x00000024
  918. #define NV10_SUBCHAN_REF_CNT 0x00000050
  919. #define NVSW_SUBCHAN_PAGE_FLIP 0x00000054
  920. #define NV11_SUBCHAN_DMA_SEMAPHORE 0x00000060
  921. #define NV11_SUBCHAN_SEMAPHORE_OFFSET 0x00000064
  922. #define NV11_SUBCHAN_SEMAPHORE_ACQUIRE 0x00000068
  923. #define NV11_SUBCHAN_SEMAPHORE_RELEASE 0x0000006c
  924. #define NV40_SUBCHAN_YIELD 0x00000080
  925. /* NV_SW object class */
  926. #define NV_SW 0x0000506e
  927. #define NV_SW_DMA_VBLSEM 0x0000018c
  928. #define NV_SW_VBLSEM_OFFSET 0x00000400
  929. #define NV_SW_VBLSEM_RELEASE_VALUE 0x00000404
  930. #define NV_SW_VBLSEM_RELEASE 0x00000408
  931. #define NV_SW_PAGE_FLIP 0x00000500
  932. #endif /* __NOUVEAU_DRV_H__ */