i915.rst 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  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/gt/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/display/intel_frontbuffer.c
  60. :doc: frontbuffer tracking
  61. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_frontbuffer.h
  62. :internal:
  63. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_frontbuffer.c
  64. :internal:
  65. Display FIFO Underrun Reporting
  66. -------------------------------
  67. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_fifo_underrun.c
  68. :doc: fifo underrun handling
  69. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_fifo_underrun.c
  70. :internal:
  71. Plane Configuration
  72. -------------------
  73. This section covers plane configuration and composition with the primary
  74. plane, sprites, cursors and overlays. This includes the infrastructure
  75. to do atomic vsync'ed updates of all this state and also tightly coupled
  76. topics like watermark setup and computation, framebuffer compression and
  77. panel self refresh.
  78. Atomic Plane Helpers
  79. --------------------
  80. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_atomic_plane.c
  81. :doc: atomic plane helpers
  82. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_atomic_plane.c
  83. :internal:
  84. Asynchronous Page Flip
  85. ----------------------
  86. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_display.c
  87. :doc: asynchronous flip implementation
  88. Output Probing
  89. --------------
  90. This section covers output probing and related infrastructure like the
  91. hotplug interrupt storm detection and mitigation code. Note that the
  92. i915 driver still uses most of the common DRM helper code for output
  93. probing, so those sections fully apply.
  94. Hotplug
  95. -------
  96. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_hotplug.c
  97. :doc: Hotplug
  98. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_hotplug.c
  99. :internal:
  100. High Definition Audio
  101. ---------------------
  102. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_audio.c
  103. :doc: High Definition Audio over HDMI and Display Port
  104. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_audio.c
  105. :internal:
  106. .. kernel-doc:: include/drm/intel/i915_component.h
  107. :internal:
  108. Intel HDMI LPE Audio Support
  109. ----------------------------
  110. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_lpe_audio.c
  111. :doc: LPE Audio integration for HDMI or DP playback
  112. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_lpe_audio.c
  113. :internal:
  114. Panel Self Refresh PSR (PSR/SRD)
  115. --------------------------------
  116. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_psr.c
  117. :doc: Panel Self Refresh (PSR/SRD)
  118. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_psr.c
  119. :internal:
  120. Frame Buffer Compression (FBC)
  121. ------------------------------
  122. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_fbc.c
  123. :doc: Frame Buffer Compression (FBC)
  124. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_fbc.c
  125. :internal:
  126. Display Refresh Rate Switching (DRRS)
  127. -------------------------------------
  128. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
  129. :doc: Display Refresh Rate Switching (DRRS)
  130. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_drrs.c
  131. :internal:
  132. DPIO
  133. ----
  134. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpio_phy.c
  135. :doc: DPIO
  136. DMC Firmware Support
  137. --------------------
  138. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc.c
  139. :doc: DMC Firmware Support
  140. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc.c
  141. :internal:
  142. DMC wakelock support
  143. --------------------
  144. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dmc_wl.c
  145. :doc: DMC wakelock support
  146. Video BIOS Table (VBT)
  147. ----------------------
  148. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_bios.c
  149. :doc: Video BIOS Table (VBT)
  150. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_bios.c
  151. :internal:
  152. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_vbt_defs.h
  153. :internal:
  154. Display clocks
  155. --------------
  156. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_cdclk.c
  157. :doc: CDCLK / RAWCLK
  158. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_cdclk.c
  159. :internal:
  160. Display PLLs
  161. ------------
  162. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpll_mgr.c
  163. :doc: Display PLLs
  164. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpll_mgr.c
  165. :internal:
  166. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dpll_mgr.h
  167. :internal:
  168. Display State Buffer
  169. --------------------
  170. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dsb.c
  171. :doc: DSB
  172. .. kernel-doc:: drivers/gpu/drm/i915/display/intel_dsb.c
  173. :internal:
  174. GT Programming
  175. ==============
  176. Multicast/Replicated (MCR) Registers
  177. ------------------------------------
  178. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_gt_mcr.c
  179. :doc: GT Multicast/Replicated (MCR) Register Support
  180. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_gt_mcr.c
  181. :internal:
  182. Memory Management and Command Submission
  183. ========================================
  184. This sections covers all things related to the GEM implementation in the
  185. i915 driver.
  186. Intel GPU Basics
  187. ----------------
  188. An Intel GPU has multiple engines. There are several engine types:
  189. - Render Command Streamer (RCS). An engine for rendering 3D and
  190. performing compute.
  191. - Blitting Command Streamer (BCS). An engine for performing blitting and/or
  192. copying operations.
  193. - Video Command Streamer. An engine used for video encoding and decoding. Also
  194. sometimes called 'BSD' in hardware documentation.
  195. - Video Enhancement Command Streamer (VECS). An engine for video enhancement.
  196. Also sometimes called 'VEBOX' in hardware documentation.
  197. - Compute Command Streamer (CCS). An engine that has access to the media and
  198. GPGPU pipelines, but not the 3D pipeline.
  199. - Graphics Security Controller (GSCCS). A dedicated engine for internal
  200. communication with GSC controller on security related tasks like
  201. High-bandwidth Digital Content Protection (HDCP), Protected Xe Path (PXP),
  202. and HuC firmware authentication.
  203. The Intel GPU family is a family of integrated GPU's using Unified
  204. Memory Access. For having the GPU "do work", user space will feed the
  205. GPU batch buffers via one of the ioctls `DRM_IOCTL_I915_GEM_EXECBUFFER2`
  206. or `DRM_IOCTL_I915_GEM_EXECBUFFER2_WR`. Most such batchbuffers will
  207. instruct the GPU to perform work (for example rendering) and that work
  208. needs memory from which to read and memory to which to write. All memory
  209. is encapsulated within GEM buffer objects (usually created with the ioctl
  210. `DRM_IOCTL_I915_GEM_CREATE`). An ioctl providing a batchbuffer for the GPU
  211. to create will also list all GEM buffer objects that the batchbuffer reads
  212. and/or writes. For implementation details of memory management see
  213. `GEM BO Management Implementation Details`_.
  214. The i915 driver allows user space to create a context via the ioctl
  215. `DRM_IOCTL_I915_GEM_CONTEXT_CREATE` which is identified by a 32-bit
  216. integer. Such a context should be viewed by user-space as -loosely-
  217. analogous to the idea of a CPU process of an operating system. The i915
  218. driver guarantees that commands issued to a fixed context are to be
  219. executed so that writes of a previously issued command are seen by
  220. reads of following commands. Actions issued between different contexts
  221. (even if from the same file descriptor) are NOT given that guarantee
  222. and the only way to synchronize across contexts (even from the same
  223. file descriptor) is through the use of fences. At least as far back as
  224. Gen4, also have that a context carries with it a GPU HW context;
  225. the HW context is essentially (most of at least) the state of a GPU.
  226. In addition to the ordering guarantees, the kernel will restore GPU
  227. state via HW context when commands are issued to a context, this saves
  228. user space the need to restore (most of at least) the GPU state at the
  229. start of each batchbuffer. The non-deprecated ioctls to submit batchbuffer
  230. work can pass that ID (in the lower bits of drm_i915_gem_execbuffer2::rsvd1)
  231. to identify what context to use with the command.
  232. The GPU has its own memory management and address space. The kernel
  233. driver maintains the memory translation table for the GPU. For older
  234. GPUs (i.e. those before Gen8), there is a single global such translation
  235. table, a global Graphics Translation Table (GTT). For newer generation
  236. GPUs each context has its own translation table, called Per-Process
  237. Graphics Translation Table (PPGTT). Of important note, is that although
  238. PPGTT is named per-process it is actually per context. When user space
  239. submits a batchbuffer, the kernel walks the list of GEM buffer objects
  240. used by the batchbuffer and guarantees that not only is the memory of
  241. each such GEM buffer object resident but it is also present in the
  242. (PP)GTT. If the GEM buffer object is not yet placed in the (PP)GTT,
  243. then it is given an address. Two consequences of this are: the kernel
  244. needs to edit the batchbuffer submitted to write the correct value of
  245. the GPU address when a GEM BO is assigned a GPU address and the kernel
  246. might evict a different GEM BO from the (PP)GTT to make address room
  247. for another GEM BO. Consequently, the ioctls submitting a batchbuffer
  248. for execution also include a list of all locations within buffers that
  249. refer to GPU-addresses so that the kernel can edit the buffer correctly.
  250. This process is dubbed relocation.
  251. Locking Guidelines
  252. ------------------
  253. .. note::
  254. This is a description of how the locking should be after
  255. refactoring is done. Does not necessarily reflect what the locking
  256. looks like while WIP.
  257. #. All locking rules and interface contracts with cross-driver interfaces
  258. (dma-buf, dma_fence) need to be followed.
  259. #. No struct_mutex anywhere in the code
  260. #. dma_resv will be the outermost lock (when needed) and ww_acquire_ctx
  261. is to be hoisted at highest level and passed down within i915_gem_ctx
  262. in the call chain
  263. #. While holding lru/memory manager (buddy, drm_mm, whatever) locks
  264. system memory allocations are not allowed
  265. * Enforce this by priming lockdep (with fs_reclaim). If we
  266. allocate memory while holding these looks we get a rehash
  267. of the shrinker vs. struct_mutex saga, and that would be
  268. real bad.
  269. #. Do not nest different lru/memory manager locks within each other.
  270. Take them in turn to update memory allocations, relying on the object’s
  271. dma_resv ww_mutex to serialize against other operations.
  272. #. The suggestion for lru/memory managers locks is that they are small
  273. enough to be spinlocks.
  274. #. All features need to come with exhaustive kernel selftests and/or
  275. IGT tests when appropriate
  276. #. All LMEM uAPI paths need to be fully restartable (_interruptible()
  277. for all locks/waits/sleeps)
  278. * Error handling validation through signal injection.
  279. Still the best strategy we have for validating GEM uAPI
  280. corner cases.
  281. Must be excessively used in the IGT, and we need to check
  282. that we really have full path coverage of all error cases.
  283. * -EDEADLK handling with ww_mutex
  284. GEM BO Management Implementation Details
  285. ----------------------------------------
  286. .. kernel-doc:: drivers/gpu/drm/i915/i915_vma_types.h
  287. :doc: Virtual Memory Address
  288. Buffer Object Eviction
  289. ----------------------
  290. This section documents the interface functions for evicting buffer
  291. objects to make space available in the virtual gpu address spaces. Note
  292. that this is mostly orthogonal to shrinking buffer objects caches, which
  293. has the goal to make main memory (shared with the gpu through the
  294. unified memory architecture) available.
  295. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_evict.c
  296. :internal:
  297. Buffer Object Memory Shrinking
  298. ------------------------------
  299. This section documents the interface function for shrinking memory usage
  300. of buffer object caches. Shrinking is used to make main memory
  301. available. Note that this is mostly orthogonal to evicting buffer
  302. objects, which has the goal to make space in gpu virtual address spaces.
  303. .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
  304. :internal:
  305. Batchbuffer Parsing
  306. -------------------
  307. .. kernel-doc:: drivers/gpu/drm/i915/i915_cmd_parser.c
  308. :doc: batch buffer command parser
  309. .. kernel-doc:: drivers/gpu/drm/i915/i915_cmd_parser.c
  310. :internal:
  311. User Batchbuffer Execution
  312. --------------------------
  313. .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_context_types.h
  314. .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
  315. :doc: User command execution
  316. Scheduling
  317. ----------
  318. .. kernel-doc:: drivers/gpu/drm/i915/i915_scheduler_types.h
  319. :functions: i915_sched_engine
  320. Logical Rings, Logical Ring Contexts and Execlists
  321. --------------------------------------------------
  322. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_execlists_submission.c
  323. :doc: Logical Rings, Logical Ring Contexts and Execlists
  324. Global GTT views
  325. ----------------
  326. .. kernel-doc:: drivers/gpu/drm/i915/i915_vma_types.h
  327. :doc: Global GTT views
  328. .. kernel-doc:: drivers/gpu/drm/i915/i915_gem_gtt.c
  329. :internal:
  330. GTT Fences and Swizzling
  331. ------------------------
  332. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
  333. :internal:
  334. Global GTT Fence Handling
  335. ~~~~~~~~~~~~~~~~~~~~~~~~~
  336. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
  337. :doc: fence register handling
  338. Hardware Tiling and Swizzling Details
  339. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  340. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_ggtt_fencing.c
  341. :doc: tiling swizzling details
  342. Object Tiling IOCTLs
  343. --------------------
  344. .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_tiling.c
  345. :internal:
  346. .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_tiling.c
  347. :doc: buffer object tiling
  348. Protected Objects
  349. -----------------
  350. .. kernel-doc:: drivers/gpu/drm/i915/pxp/intel_pxp.c
  351. :doc: PXP
  352. .. kernel-doc:: drivers/gpu/drm/i915/pxp/intel_pxp_types.h
  353. Microcontrollers
  354. ================
  355. Starting from gen9, three microcontrollers are available on the HW: the
  356. graphics microcontroller (GuC), the HEVC/H.265 microcontroller (HuC) and the
  357. display microcontroller (DMC). The driver is responsible for loading the
  358. firmwares on the microcontrollers; the GuC and HuC firmwares are transferred
  359. to WOPCM using the DMA engine, while the DMC firmware is written through MMIO.
  360. WOPCM
  361. -----
  362. WOPCM Layout
  363. ~~~~~~~~~~~~
  364. .. kernel-doc:: drivers/gpu/drm/i915/gt/intel_wopcm.c
  365. :doc: WOPCM Layout
  366. GuC
  367. ---
  368. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
  369. :doc: GuC
  370. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.h
  371. GuC Firmware Layout
  372. ~~~~~~~~~~~~~~~~~~~
  373. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h
  374. :doc: Firmware Layout
  375. GuC Memory Management
  376. ~~~~~~~~~~~~~~~~~~~~~
  377. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
  378. :doc: GuC Memory Management
  379. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
  380. :functions: intel_guc_allocate_vma
  381. GuC-specific firmware loader
  382. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  383. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c
  384. :internal:
  385. GuC-based command submission
  386. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  387. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
  388. :doc: GuC-based command submission
  389. GuC ABI
  390. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  391. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/abi/guc_messages_abi.h
  392. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/abi/guc_communication_mmio_abi.h
  393. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h
  394. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/abi/guc_actions_abi.h
  395. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/abi/guc_klvs_abi.h
  396. HuC
  397. ---
  398. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
  399. :doc: HuC
  400. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
  401. :functions: intel_huc_auth
  402. HuC Memory Management
  403. ~~~~~~~~~~~~~~~~~~~~~
  404. .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
  405. :doc: HuC Memory Management
  406. HuC Firmware Layout
  407. ~~~~~~~~~~~~~~~~~~~
  408. The HuC FW layout is the same as the GuC one, see `GuC Firmware Layout`_
  409. DMC
  410. ---
  411. See `DMC Firmware Support`_
  412. Tracing
  413. =======
  414. This sections covers all things related to the tracepoints implemented
  415. in the i915 driver.
  416. i915_ppgtt_create and i915_ppgtt_release
  417. ----------------------------------------
  418. .. kernel-doc:: drivers/gpu/drm/i915/i915_trace.h
  419. :doc: i915_ppgtt_create and i915_ppgtt_release tracepoints
  420. i915_context_create and i915_context_free
  421. -----------------------------------------
  422. .. kernel-doc:: drivers/gpu/drm/i915/i915_trace.h
  423. :doc: i915_context_create and i915_context_free tracepoints
  424. Perf
  425. ====
  426. Overview
  427. --------
  428. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  429. :doc: i915 Perf Overview
  430. Comparison with Core Perf
  431. -------------------------
  432. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  433. :doc: i915 Perf History and Comparison with Core Perf
  434. i915 Driver Entry Points
  435. ------------------------
  436. This section covers the entrypoints exported outside of i915_perf.c to
  437. integrate with drm/i915 and to handle the `DRM_I915_PERF_OPEN` ioctl.
  438. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  439. :functions: i915_perf_init
  440. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  441. :functions: i915_perf_fini
  442. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  443. :functions: i915_perf_register
  444. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  445. :functions: i915_perf_unregister
  446. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  447. :functions: i915_perf_open_ioctl
  448. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  449. :functions: i915_perf_release
  450. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  451. :functions: i915_perf_add_config_ioctl
  452. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  453. :functions: i915_perf_remove_config_ioctl
  454. i915 Perf Stream
  455. ----------------
  456. This section covers the stream-semantics-agnostic structures and functions
  457. for representing an i915 perf stream FD and associated file operations.
  458. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
  459. :functions: i915_perf_stream
  460. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
  461. :functions: i915_perf_stream_ops
  462. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  463. :functions: read_properties_unlocked
  464. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  465. :functions: i915_perf_open_ioctl_locked
  466. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  467. :functions: i915_perf_destroy_locked
  468. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  469. :functions: i915_perf_read
  470. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  471. :functions: i915_perf_ioctl
  472. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  473. :functions: i915_perf_enable_locked
  474. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  475. :functions: i915_perf_disable_locked
  476. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  477. :functions: i915_perf_poll
  478. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  479. :functions: i915_perf_poll_locked
  480. i915 Perf Observation Architecture Stream
  481. -----------------------------------------
  482. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf_types.h
  483. :functions: i915_oa_ops
  484. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  485. :functions: i915_oa_stream_init
  486. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  487. :functions: i915_oa_read
  488. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  489. :functions: i915_oa_stream_enable
  490. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  491. :functions: i915_oa_stream_disable
  492. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  493. :functions: i915_oa_wait_unlocked
  494. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  495. :functions: i915_oa_poll_wait
  496. Other i915 Perf Internals
  497. -------------------------
  498. This section simply includes all other currently documented i915 perf internals,
  499. in no particular order, but may include some more minor utilities or platform
  500. specific details than found in the more high-level sections.
  501. .. kernel-doc:: drivers/gpu/drm/i915/i915_perf.c
  502. :internal:
  503. :no-identifiers:
  504. i915_perf_init
  505. i915_perf_fini
  506. i915_perf_register
  507. i915_perf_unregister
  508. i915_perf_open_ioctl
  509. i915_perf_release
  510. i915_perf_add_config_ioctl
  511. i915_perf_remove_config_ioctl
  512. read_properties_unlocked
  513. i915_perf_open_ioctl_locked
  514. i915_perf_destroy_locked
  515. i915_perf_read i915_perf_ioctl
  516. i915_perf_enable_locked
  517. i915_perf_disable_locked
  518. i915_perf_poll i915_perf_poll_locked
  519. i915_oa_stream_init i915_oa_read
  520. i915_oa_stream_enable
  521. i915_oa_stream_disable
  522. i915_oa_wait_unlocked
  523. i915_oa_poll_wait
  524. Style
  525. =====
  526. The drm/i915 driver codebase has some style rules in addition to (and, in some
  527. cases, deviating from) the kernel coding style.
  528. Register macro definition style
  529. -------------------------------
  530. The style guide for ``i915_reg.h``.
  531. .. kernel-doc:: drivers/gpu/drm/i915/i915_reg.h
  532. :doc: The i915 register macro definition style guide
  533. .. _i915-usage-stats:
  534. i915 DRM client usage stats implementation
  535. ==========================================
  536. The drm/i915 driver implements the DRM client usage stats specification as
  537. documented in :ref:`drm-client-usage-stats`.
  538. Example of the output showing the implemented key value pairs and entirety of
  539. the currently possible format options:
  540. ::
  541. pos: 0
  542. flags: 0100002
  543. mnt_id: 21
  544. drm-driver: i915
  545. drm-pdev: 0000:00:02.0
  546. drm-client-id: 7
  547. drm-engine-render: 9288864723 ns
  548. drm-engine-copy: 2035071108 ns
  549. drm-engine-video: 0 ns
  550. drm-engine-capacity-video: 2
  551. drm-engine-video-enhance: 0 ns
  552. Possible `drm-engine-` key names are: `render`, `copy`, `video` and
  553. `video-enhance`.