i915.rst 23 KB

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