i915.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. ===========================
  2. drm/i915 Intel GFX Driver
  3. ===========================
  4. The drm/i915 driver supports all (with the exception of some very early
  5. models) integrated GFX chipsets with both Intel display and rendering
  6. blocks. This excludes a set of SoC platforms with an SGX rendering unit,
  7. those have basic support through the gma500 drm driver.
  8. Core Driver Infrastructure
  9. ==========================
  10. This section covers core driver infrastructure used by both the display
  11. and the GEM parts of the driver.
  12. Runtime Power Management
  13. ------------------------
  14. .. kernel-doc:: drivers/gpu/drm/i915/intel_runtime_pm.c
  15. :doc: runtime pm
  16. .. kernel-doc:: drivers/gpu/drm/i915/intel_runtime_pm.c
  17. :internal:
  18. .. kernel-doc:: drivers/gpu/drm/i915/intel_uncore.c
  19. :internal:
  20. Interrupt Handling
  21. ------------------
  22. .. kernel-doc:: drivers/gpu/drm/i915/i915_irq.c
  23. :doc: interrupt handling
  24. .. kernel-doc:: drivers/gpu/drm/i915/i915_irq.c
  25. :functions: intel_irq_init intel_irq_init_hw intel_hpd_init
  26. .. kernel-doc:: drivers/gpu/drm/i915/i915_irq.c
  27. :functions: intel_runtime_pm_disable_interrupts
  28. .. kernel-doc:: drivers/gpu/drm/i915/i915_irq.c
  29. :functions: intel_runtime_pm_enable_interrupts
  30. Intel GVT-g Guest Support(vGPU)
  31. -------------------------------
  32. .. kernel-doc:: drivers/gpu/drm/i915/i915_vgpu.c
  33. :doc: Intel GVT-g guest support
  34. .. kernel-doc:: drivers/gpu/drm/i915/i915_vgpu.c
  35. :internal:
  36. Intel GVT-g Host Support(vGPU device model)
  37. -------------------------------------------
  38. .. kernel-doc:: drivers/gpu/drm/i915/intel_gvt.c
  39. :doc: Intel GVT-g host support
  40. .. kernel-doc:: drivers/gpu/drm/i915/intel_gvt.c
  41. :internal:
  42. Workarounds
  43. -----------
  44. .. kernel-doc:: drivers/gpu/drm/i915/intel_workarounds.c
  45. :doc: Hardware workarounds
  46. Display Hardware Handling
  47. =========================
  48. This section covers everything related to the display hardware including
  49. the mode setting infrastructure, plane, sprite and cursor handling and
  50. display, output probing and related topics.
  51. Mode Setting Infrastructure
  52. ---------------------------
  53. The i915 driver is thus far the only DRM driver which doesn't use the
  54. common DRM helper code to implement mode setting sequences. Thus it has
  55. its own tailor-made infrastructure for executing a display configuration
  56. change.
  57. Frontbuffer Tracking
  58. --------------------
  59. .. kernel-doc:: drivers/gpu/drm/i915/intel_frontbuffer.c
  60. :doc: frontbuffer tracking
  61. .. kernel-doc:: drivers/gpu/drm/i915/intel_frontbuffer.h
  62. :internal:
  63. .. kernel-doc:: drivers/gpu/drm/i915/intel_frontbuffer.c
  64. :internal:
  65. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem.c
  66. :functions: i915_gem_track_fb
  67. Display FIFO Underrun Reporting
  68. -------------------------------
  69. .. kernel-doc:: drivers/gpu/drm/i915/intel_fifo_underrun.c
  70. :doc: fifo underrun handling
  71. .. kernel-doc:: drivers/gpu/drm/i915/intel_fifo_underrun.c
  72. :internal:
  73. Plane Configuration
  74. -------------------
  75. This section covers plane configuration and composition with the primary
  76. plane, sprites, cursors and overlays. This includes the infrastructure
  77. to do atomic vsync'ed updates of all this state and also tightly coupled
  78. topics like watermark setup and computation, framebuffer compression and
  79. panel self refresh.
  80. Atomic Plane Helpers
  81. --------------------
  82. .. kernel-doc:: drivers/gpu/drm/i915/intel_atomic_plane.c
  83. :doc: atomic plane helpers
  84. .. kernel-doc:: drivers/gpu/drm/i915/intel_atomic_plane.c
  85. :internal:
  86. Output Probing
  87. --------------
  88. This section covers output probing and related infrastructure like the
  89. hotplug interrupt storm detection and mitigation code. Note that the
  90. i915 driver still uses most of the common DRM helper code for output
  91. probing, so those sections fully apply.
  92. Hotplug
  93. -------
  94. .. kernel-doc:: drivers/gpu/drm/i915/intel_hotplug.c
  95. :doc: Hotplug
  96. .. kernel-doc:: drivers/gpu/drm/i915/intel_hotplug.c
  97. :internal:
  98. High Definition Audio
  99. ---------------------
  100. .. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c
  101. :doc: High Definition Audio over HDMI and Display Port
  102. .. kernel-doc:: drivers/gpu/drm/i915/intel_audio.c
  103. :internal:
  104. .. kernel-doc:: include/drm/i915_component.h
  105. :internal:
  106. Intel HDMI LPE Audio Support
  107. ----------------------------
  108. .. kernel-doc:: drivers/gpu/drm/i915/intel_lpe_audio.c
  109. :doc: LPE Audio integration for HDMI or DP playback
  110. .. kernel-doc:: drivers/gpu/drm/i915/intel_lpe_audio.c
  111. :internal:
  112. Panel Self Refresh PSR (PSR/SRD)
  113. --------------------------------
  114. .. kernel-doc:: drivers/gpu/drm/i915/intel_psr.c
  115. :doc: Panel Self Refresh (PSR/SRD)
  116. .. kernel-doc:: drivers/gpu/drm/i915/intel_psr.c
  117. :internal:
  118. Frame Buffer Compression (FBC)
  119. ------------------------------
  120. .. kernel-doc:: drivers/gpu/drm/i915/intel_fbc.c
  121. :doc: Frame Buffer Compression (FBC)
  122. .. kernel-doc:: drivers/gpu/drm/i915/intel_fbc.c
  123. :internal:
  124. Display Refresh Rate Switching (DRRS)
  125. -------------------------------------
  126. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  127. :doc: Display Refresh Rate Switching (DRRS)
  128. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  129. :functions: intel_dp_set_drrs_state
  130. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  131. :functions: intel_edp_drrs_enable
  132. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  133. :functions: intel_edp_drrs_disable
  134. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  135. :functions: intel_edp_drrs_invalidate
  136. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  137. :functions: intel_edp_drrs_flush
  138. .. kernel-doc:: drivers/gpu/drm/i915/intel_dp.c
  139. :functions: intel_dp_drrs_init
  140. DPIO
  141. ----
  142. .. kernel-doc:: drivers/gpu/drm/i915/intel_dpio_phy.c
  143. :doc: DPIO
  144. CSR firmware support for DMC
  145. ----------------------------
  146. .. kernel-doc:: drivers/gpu/drm/i915/intel_csr.c
  147. :doc: csr support for dmc
  148. .. kernel-doc:: drivers/gpu/drm/i915/intel_csr.c
  149. :internal:
  150. Video BIOS Table (VBT)
  151. ----------------------
  152. .. kernel-doc:: drivers/gpu/drm/i915/intel_bios.c
  153. :doc: Video BIOS Table (VBT)
  154. .. kernel-doc:: drivers/gpu/drm/i915/intel_bios.c
  155. :internal:
  156. .. kernel-doc:: drivers/gpu/drm/i915/intel_vbt_defs.h
  157. :internal:
  158. Display clocks
  159. --------------
  160. .. kernel-doc:: drivers/gpu/drm/i915/intel_cdclk.c
  161. :doc: CDCLK / RAWCLK
  162. .. kernel-doc:: drivers/gpu/drm/i915/intel_cdclk.c
  163. :internal:
  164. Display PLLs
  165. ------------
  166. .. kernel-doc:: drivers/gpu/drm/i915/intel_dpll_mgr.c
  167. :doc: Display PLLs
  168. .. kernel-doc:: drivers/gpu/drm/i915/intel_dpll_mgr.c
  169. :internal:
  170. .. kernel-doc:: drivers/gpu/drm/i915/intel_dpll_mgr.h
  171. :internal:
  172. Memory Management and Command Submission
  173. ========================================
  174. This sections covers all things related to the GEM implementation in the
  175. i915 driver.
  176. Intel GPU Basics
  177. ----------------
  178. An Intel GPU has multiple engines. There are several engine types.
  179. - RCS engine is for rendering 3D and performing compute, this is named
  180. `I915_EXEC_RENDER` in user space.
  181. - BCS is a blitting (copy) engine, this is named `I915_EXEC_BLT` in user
  182. space.
  183. - VCS is a video encode and decode engine, this is named `I915_EXEC_BSD`
  184. in user space
  185. - VECS is video enhancement engine, this is named `I915_EXEC_VEBOX` in user
  186. space.
  187. - The enumeration `I915_EXEC_DEFAULT` does not refer to specific engine;
  188. instead it is to be used by user space to specify a default rendering
  189. engine (for 3D) that may or may not be the same as RCS.
  190. The Intel GPU family is a family of integrated GPU's using Unified
  191. Memory Access. For having the GPU "do work", user space will feed the
  192. GPU batch buffers via one of the ioctls `DRM_IOCTL_I915_GEM_EXECBUFFER2`
  193. or `DRM_IOCTL_I915_GEM_EXECBUFFER2_WR`. Most such batchbuffers will
  194. instruct the GPU to perform work (for example rendering) and that work
  195. needs memory from which to read and memory to which to write. All memory
  196. is encapsulated within GEM buffer objects (usually created with the ioctl
  197. `DRM_IOCTL_I915_GEM_CREATE`). An ioctl providing a batchbuffer for the GPU
  198. to create will also list all GEM buffer objects that the batchbuffer reads
  199. and/or writes. For implementation details of memory management see
  200. `GEM BO Management Implementation Details`_.
  201. The i915 driver allows user space to create a context via the ioctl
  202. `DRM_IOCTL_I915_GEM_CONTEXT_CREATE` which is identified by a 32-bit
  203. integer. Such a context should be viewed by user-space as -loosely-
  204. analogous to the idea of a CPU process of an operating system. The i915
  205. driver guarantees that commands issued to a fixed context are to be
  206. executed so that writes of a previously issued command are seen by
  207. reads of following commands. Actions issued between different contexts
  208. (even if from the same file descriptor) are NOT given that guarantee
  209. and the only way to synchronize across contexts (even from the same
  210. file descriptor) is through the use of fences. At least as far back as
  211. Gen4, also have that a context carries with it a GPU HW context;
  212. the HW context is essentially (most of atleast) the state of a GPU.
  213. In addition to the ordering guarantees, the kernel will restore GPU
  214. state via HW context when commands are issued to a context, this saves
  215. user space the need to restore (most of atleast) the GPU state at the
  216. start of each batchbuffer. The non-deprecated ioctls to submit batchbuffer
  217. work can pass that ID (in the lower bits of drm_i915_gem_execbuffer2::rsvd1)
  218. to identify what context to use with the command.
  219. The GPU has its own memory management and address space. The kernel
  220. driver maintains the memory translation table for the GPU. For older
  221. GPUs (i.e. those before Gen8), there is a single global such translation
  222. table, a global Graphics Translation Table (GTT). For newer generation
  223. GPUs each context has its own translation table, called Per-Process
  224. Graphics Translation Table (PPGTT). Of important note, is that although
  225. PPGTT is named per-process it is actually per context. When user space
  226. submits a batchbuffer, the kernel walks the list of GEM buffer objects
  227. used by the batchbuffer and guarantees that not only is the memory of
  228. each such GEM buffer object resident but it is also present in the
  229. (PP)GTT. If the GEM buffer object is not yet placed in the (PP)GTT,
  230. then it is given an address. Two consequences of this are: the kernel
  231. needs to edit the batchbuffer submitted to write the correct value of
  232. the GPU address when a GEM BO is assigned a GPU address and the kernel
  233. might evict a different GEM BO from the (PP)GTT to make address room
  234. for another GEM BO. Consequently, the ioctls submitting a batchbuffer
  235. for execution also include a list of all locations within buffers that
  236. refer to GPU-addresses so that the kernel can edit the buffer correctly.
  237. This process is dubbed relocation.
  238. GEM BO Management Implementation Details
  239. ----------------------------------------
  240. .. kernel-doc:: drivers/gpu/drm/i915/i915_vma.h
  241. :doc: Virtual Memory Address
  242. Buffer Object Eviction
  243. ----------------------
  244. This section documents the interface functions for evicting buffer
  245. objects to make space available in the virtual gpu address spaces. Note
  246. that this is mostly orthogonal to shrinking buffer objects caches, which
  247. has the goal to make main memory (shared with the gpu through the
  248. unified memory architecture) available.
  249. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_evict.c
  250. :internal:
  251. Buffer Object Memory Shrinking
  252. ------------------------------
  253. This section documents the interface function for shrinking memory usage
  254. of buffer object caches. Shrinking is used to make main memory
  255. available. Note that this is mostly orthogonal to evicting buffer
  256. objects, which has the goal to make space in gpu virtual address spaces.
  257. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_shrinker.c
  258. :internal:
  259. Batchbuffer Parsing
  260. -------------------
  261. .. kernel-doc:: drivers/gpu/drm/i915/i915_cmd_parser.c
  262. :doc: batch buffer command parser
  263. .. kernel-doc:: drivers/gpu/drm/i915/i915_cmd_parser.c
  264. :internal:
  265. Batchbuffer Pools
  266. -----------------
  267. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_batch_pool.c
  268. :doc: batch pool
  269. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_batch_pool.c
  270. :internal:
  271. User Batchbuffer Execution
  272. --------------------------
  273. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_execbuffer.c
  274. :doc: User command execution
  275. Logical Rings, Logical Ring Contexts and Execlists
  276. --------------------------------------------------
  277. .. kernel-doc:: drivers/gpu/drm/i915/intel_lrc.c
  278. :doc: Logical Rings, Logical Ring Contexts and Execlists
  279. .. kernel-doc:: drivers/gpu/drm/i915/intel_lrc.c
  280. :internal:
  281. Global GTT views
  282. ----------------
  283. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_gtt.c
  284. :doc: Global GTT views
  285. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_gtt.c
  286. :internal:
  287. GTT Fences and Swizzling
  288. ------------------------
  289. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
  290. :internal:
  291. Global GTT Fence Handling
  292. ~~~~~~~~~~~~~~~~~~~~~~~~~
  293. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
  294. :doc: fence register handling
  295. Hardware Tiling and Swizzling Details
  296. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  297. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_fence_reg.c
  298. :doc: tiling swizzling details
  299. Object Tiling IOCTLs
  300. --------------------
  301. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_tiling.c
  302. :internal:
  303. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_tiling.c
  304. :doc: buffer object tiling
  305. WOPCM
  306. =====
  307. WOPCM Layout
  308. ------------
  309. .. kernel-doc:: drivers/gpu/drm/i915/intel_wopcm.c
  310. :doc: WOPCM Layout
  311. GuC
  312. ===
  313. GuC-specific firmware loader
  314. ----------------------------
  315. .. kernel-doc:: drivers/gpu/drm/i915/intel_guc_fw.c
  316. :internal:
  317. GuC-based command submission
  318. ----------------------------
  319. .. kernel-doc:: drivers/gpu/drm/i915/intel_guc_submission.c
  320. :doc: GuC-based command submission
  321. .. kernel-doc:: drivers/gpu/drm/i915/intel_guc_submission.c
  322. :internal:
  323. GuC Firmware Layout
  324. -------------------
  325. .. kernel-doc:: drivers/gpu/drm/i915/intel_guc_fwif.h
  326. :doc: GuC Firmware Layout
  327. GuC Address Space
  328. -----------------
  329. .. kernel-doc:: drivers/gpu/drm/i915/intel_guc.c
  330. :doc: GuC Address Space
  331. Tracing
  332. =======
  333. This sections covers all things related to the tracepoints implemented
  334. in the i915 driver.
  335. i915_ppgtt_create and i915_ppgtt_release
  336. ----------------------------------------
  337. .. kernel-doc:: drivers/gpu/drm/i915/i915_trace.h
  338. :doc: i915_ppgtt_create and i915_ppgtt_release tracepoints
  339. i915_context_create and i915_context_free
  340. -----------------------------------------
  341. .. kernel-doc:: drivers/gpu/drm/i915/i915_trace.h
  342. :doc: i915_context_create and i915_context_free tracepoints
  343. switch_mm
  344. ---------
  345. .. kernel-doc:: drivers/gpu/drm/i915/i915_trace.h
  346. :doc: switch_mm tracepoint
  347. Perf
  348. ====
  349. Overview
  350. --------
  351. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  352. :doc: i915 Perf Overview
  353. Comparison with Core Perf
  354. -------------------------
  355. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  356. :doc: i915 Perf History and Comparison with Core Perf
  357. i915 Driver Entry Points
  358. ------------------------
  359. This section covers the entrypoints exported outside of i915_perf.c to
  360. integrate with drm/i915 and to handle the `DRM_I915_PERF_OPEN` ioctl.
  361. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  362. :functions: i915_perf_init
  363. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  364. :functions: i915_perf_fini
  365. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  366. :functions: i915_perf_register
  367. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  368. :functions: i915_perf_unregister
  369. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  370. :functions: i915_perf_open_ioctl
  371. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  372. :functions: i915_perf_release
  373. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  374. :functions: i915_perf_add_config_ioctl
  375. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  376. :functions: i915_perf_remove_config_ioctl
  377. i915 Perf Stream
  378. ----------------
  379. This section covers the stream-semantics-agnostic structures and functions
  380. for representing an i915 perf stream FD and associated file operations.
  381. .. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
  382. :functions: i915_perf_stream
  383. .. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
  384. :functions: i915_perf_stream_ops
  385. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  386. :functions: read_properties_unlocked
  387. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  388. :functions: i915_perf_open_ioctl_locked
  389. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  390. :functions: i915_perf_destroy_locked
  391. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  392. :functions: i915_perf_read
  393. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  394. :functions: i915_perf_ioctl
  395. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  396. :functions: i915_perf_enable_locked
  397. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  398. :functions: i915_perf_disable_locked
  399. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  400. :functions: i915_perf_poll
  401. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  402. :functions: i915_perf_poll_locked
  403. i915 Perf Observation Architecture Stream
  404. -----------------------------------------
  405. .. kernel-doc:: drivers/gpu/drm/i915/i915_drv.h
  406. :functions: i915_oa_ops
  407. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  408. :functions: i915_oa_stream_init
  409. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  410. :functions: i915_oa_read
  411. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  412. :functions: i915_oa_stream_enable
  413. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  414. :functions: i915_oa_stream_disable
  415. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  416. :functions: i915_oa_wait_unlocked
  417. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  418. :functions: i915_oa_poll_wait
  419. All i915 Perf Internals
  420. -----------------------
  421. This section simply includes all currently documented i915 perf internals, in
  422. no particular order, but may include some more minor utilities or platform
  423. specific details than found in the more high-level sections.
  424. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  425. :internal:
  426. Style
  427. =====
  428. The drm/i915 driver codebase has some style rules in addition to (and, in some
  429. cases, deviating from) the kernel coding style.
  430. Register macro definition style
  431. -------------------------------
  432. The style guide for ``i915_reg.h``.
  433. .. kernel-doc:: drivers/gpu/drm/i915/i915_reg.h
  434. :doc: The i915 register macro definition style guide