Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'docs/docbook/drm' of git://github.com/mfwitten/linux into docs-move

+170 -142
+168 -140
Documentation/DocBook/drm.tmpl
··· 32 32 The Linux DRM layer contains code intended to support the needs 33 33 of complex graphics devices, usually containing programmable 34 34 pipelines well suited to 3D graphics acceleration. Graphics 35 - drivers in the kernel can make use of DRM functions to make 35 + drivers in the kernel may make use of DRM functions to make 36 36 tasks like memory management, interrupt handling and DMA easier, 37 37 and provide a uniform interface to applications. 38 38 </para> ··· 57 57 existing drivers. 58 58 </para> 59 59 <para> 60 - First, we'll go over some typical driver initialization 60 + First, we go over some typical driver initialization 61 61 requirements, like setting up command buffers, creating an 62 62 initial output configuration, and initializing core services. 63 - Subsequent sections will cover core internals in more detail, 63 + Subsequent sections cover core internals in more detail, 64 64 providing implementation notes and examples. 65 65 </para> 66 66 <para> ··· 74 74 </para> 75 75 <para> 76 76 The core of every DRM driver is struct drm_driver. Drivers 77 - will typically statically initialize a drm_driver structure, 77 + typically statically initialize a drm_driver structure, 78 78 then pass it to drm_init() at load time. 79 79 </para> 80 80 ··· 88 88 </para> 89 89 <programlisting> 90 90 static struct drm_driver driver = { 91 - /* don't use mtrr's here, the Xserver or user space app should 92 - * deal with them for intel hardware. 91 + /* Don't use MTRRs here; the Xserver or userspace app should 92 + * deal with them for Intel hardware. 93 93 */ 94 94 .driver_features = 95 95 DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | ··· 154 154 </programlisting> 155 155 <para> 156 156 In the example above, taken from the i915 DRM driver, the driver 157 - sets several flags indicating what core features it supports. 158 - We'll go over the individual callbacks in later sections. Since 157 + sets several flags indicating what core features it supports; 158 + we go over the individual callbacks in later sections. Since 159 159 flags indicate which features your driver supports to the DRM 160 160 core, you need to set most of them prior to calling drm_init(). Some, 161 161 like DRIVER_MODESET can be set later based on user supplied parameters, ··· 203 203 <term>DRIVER_HAVE_IRQ</term><term>DRIVER_IRQ_SHARED</term> 204 204 <listitem> 205 205 <para> 206 - DRIVER_HAVE_IRQ indicates whether the driver has a IRQ 207 - handler, DRIVER_IRQ_SHARED indicates whether the device &amp; 206 + DRIVER_HAVE_IRQ indicates whether the driver has an IRQ 207 + handler. DRIVER_IRQ_SHARED indicates whether the device &amp; 208 208 handler support shared IRQs (note that this is required of 209 209 PCI drivers). 210 210 </para> ··· 214 214 <term>DRIVER_DMA_QUEUE</term> 215 215 <listitem> 216 216 <para> 217 - If the driver queues DMA requests and completes them 218 - asynchronously, this flag should be set. Deprecated. 217 + Should be set if the driver queues DMA requests and completes them 218 + asynchronously. Deprecated. 219 219 </para> 220 220 </listitem> 221 221 </varlistentry> ··· 238 238 </variablelist> 239 239 <para> 240 240 In this specific case, the driver requires AGP and supports 241 - IRQs. DMA, as we'll see, is handled by device specific ioctls 241 + IRQs. DMA, as discussed later, is handled by device-specific ioctls 242 242 in this case. It also supports the kernel mode setting APIs, though 243 243 unlike in the actual i915 driver source, this example unconditionally 244 244 exports KMS capability. ··· 269 269 initial output configuration. 270 270 </para> 271 271 <para> 272 - Note that the tasks performed at driver load time must not 273 - conflict with DRM client requirements. For instance, if user 272 + If compatibility is a concern (e.g. with drivers converted over 273 + to the new interfaces from the old ones), care must be taken to 274 + prevent device initialization and control that is incompatible with 275 + currently active userspace drivers. For instance, if user 274 276 level mode setting drivers are in use, it would be problematic 275 277 to perform output discovery &amp; configuration at load time. 276 - Likewise, if pre-memory management aware user level drivers are 278 + Likewise, if user-level drivers unaware of memory management are 277 279 in use, memory management and command buffer setup may need to 278 - be omitted. These requirements are driver specific, and care 280 + be omitted. These requirements are driver-specific, and care 279 281 needs to be taken to keep both old and new applications and 280 282 libraries working. The i915 driver supports the "modeset" 281 283 module parameter to control whether advanced features are 282 - enabled at load time or in legacy fashion. If compatibility is 283 - a concern (e.g. with drivers converted over to the new interfaces 284 - from the old ones), care must be taken to prevent incompatible 285 - device initialization and control with the currently active 286 - userspace drivers. 284 + enabled at load time or in legacy fashion. 287 285 </para> 288 286 289 287 <sect2> 290 288 <title>Driver private &amp; performance counters</title> 291 289 <para> 292 290 The driver private hangs off the main drm_device structure and 293 - can be used for tracking various device specific bits of 291 + can be used for tracking various device-specific bits of 294 292 information, like register offsets, command buffer status, 295 293 register state for suspend/resume, etc. At load time, a 296 - driver can simply allocate one and set drm_device.dev_priv 297 - appropriately; at unload the driver can free it and set 298 - drm_device.dev_priv to NULL. 294 + driver may simply allocate one and set drm_device.dev_priv 295 + appropriately; it should be freed and drm_device.dev_priv set 296 + to NULL when the driver is unloaded. 299 297 </para> 300 298 <para> 301 - The DRM supports several counters which can be used for rough 299 + The DRM supports several counters which may be used for rough 302 300 performance characterization. Note that the DRM stat counter 303 301 system is not often used by applications, and supporting 304 302 additional counters is completely optional. ··· 305 307 These interfaces are deprecated and should not be used. If performance 306 308 monitoring is desired, the developer should investigate and 307 309 potentially enhance the kernel perf and tracing infrastructure to export 308 - GPU related performance information to performance monitoring 309 - tools and applications. 310 + GPU related performance information for consumption by performance 311 + monitoring tools and applications. 310 312 </para> 311 313 </sect2> 312 314 313 315 <sect2> 314 316 <title>Configuring the device</title> 315 317 <para> 316 - Obviously, device configuration will be device specific. 318 + Obviously, device configuration is device-specific. 317 319 However, there are several common operations: finding a 318 320 device's PCI resources, mapping them, and potentially setting 319 321 up an IRQ handler. ··· 321 323 <para> 322 324 Finding &amp; mapping resources is fairly straightforward. The 323 325 DRM wrapper functions, drm_get_resource_start() and 324 - drm_get_resource_len() can be used to find BARs on the given 326 + drm_get_resource_len(), may be used to find BARs on the given 325 327 drm_device struct. Once those values have been retrieved, the 326 328 driver load function can call drm_addmap() to create a new 327 - mapping for the BAR in question. Note you'll probably want a 329 + mapping for the BAR in question. Note that you probably want a 328 330 drm_local_map_t in your driver private structure to track any 329 331 mappings you create. 330 332 <!-- !Fdrivers/gpu/drm/drm_bufs.c drm_get_resource_* --> ··· 333 335 <para> 334 336 if compatibility with other operating systems isn't a concern 335 337 (DRM drivers can run under various BSD variants and OpenSolaris), 336 - native Linux calls can be used for the above, e.g. pci_resource_* 338 + native Linux calls may be used for the above, e.g. pci_resource_* 337 339 and iomap*/iounmap. See the Linux device driver book for more 338 340 info. 339 341 </para> 340 342 <para> 341 - Once you have a register map, you can use the DRM_READn() and 343 + Once you have a register map, you may use the DRM_READn() and 342 344 DRM_WRITEn() macros to access the registers on your device, or 343 - use driver specific versions to offset into your MMIO space 344 - relative to a driver specific base pointer (see I915_READ for 345 - example). 345 + use driver-specific versions to offset into your MMIO space 346 + relative to a driver-specific base pointer (see I915_READ for 347 + an example). 346 348 </para> 347 349 <para> 348 350 If your device supports interrupt generation, you may want to 349 - setup an interrupt handler at driver load time as well. This 351 + set up an interrupt handler when the driver is loaded. This 350 352 is done using the drm_irq_install() function. If your device 351 353 supports vertical blank interrupts, it should call 352 354 drm_vblank_init() to initialize the core vblank handling code before ··· 355 357 </para> 356 358 <!--!Fdrivers/char/drm/drm_irq.c drm_irq_install--> 357 359 <para> 358 - Once your interrupt handler is registered (it'll use your 360 + Once your interrupt handler is registered (it uses your 359 361 drm_driver.irq_handler as the actual interrupt handling 360 362 function), you can safely enable interrupts on your device, 361 363 assuming any other state your interrupt handler uses is also ··· 369 371 using the pci_map_rom() call, a convenience function that 370 372 takes care of mapping the actual ROM, whether it has been 371 373 shadowed into memory (typically at address 0xc0000) or exists 372 - on the PCI device in the ROM BAR. Note that once you've 373 - mapped the ROM and extracted any necessary information, be 374 - sure to unmap it; on many devices the ROM address decoder is 375 - shared with other BARs, so leaving it mapped can cause 374 + on the PCI device in the ROM BAR. Note that after the ROM 375 + has been mapped and any necessary information has been extracted, 376 + it should be unmapped; on many devices, the ROM address decoder is 377 + shared with other BARs, so leaving it mapped could cause 376 378 undesired behavior like hangs or memory corruption. 377 379 <!--!Fdrivers/pci/rom.c pci_map_rom--> 378 380 </para> ··· 387 389 should support a memory manager. 388 390 </para> 389 391 <para> 390 - If your driver supports memory management (it should!), you'll 392 + If your driver supports memory management (it should!), you 391 393 need to set that up at load time as well. How you initialize 392 - it depends on which memory manager you're using, TTM or GEM. 394 + it depends on which memory manager you're using: TTM or GEM. 393 395 </para> 394 396 <sect3> 395 397 <title>TTM initialization</title> ··· 399 401 and devices with dedicated video RAM (VRAM), i.e. most discrete 400 402 graphics devices. If your device has dedicated RAM, supporting 401 403 TTM is desirable. TTM also integrates tightly with your 402 - driver specific buffer execution function. See the radeon 404 + driver-specific buffer execution function. See the radeon 403 405 driver for examples. 404 406 </para> 405 407 <para> ··· 427 429 created by the memory manager at runtime. Your global TTM should 428 430 have a type of TTM_GLOBAL_TTM_MEM. The size field for the global 429 431 object should be sizeof(struct ttm_mem_global), and the init and 430 - release hooks should point at your driver specific init and 431 - release routines, which will probably eventually call 432 - ttm_mem_global_init and ttm_mem_global_release respectively. 432 + release hooks should point at your driver-specific init and 433 + release routines, which probably eventually call 434 + ttm_mem_global_init and ttm_mem_global_release, respectively. 433 435 </para> 434 436 <para> 435 437 Once your global TTM accounting structure is set up and initialized 436 - (done by calling ttm_global_item_ref on the global object you 437 - just created), you'll need to create a buffer object TTM to 438 + by calling ttm_global_item_ref() on it, 439 + you need to create a buffer object TTM to 438 440 provide a pool for buffer object allocation by clients and the 439 441 kernel itself. The type of this object should be TTM_GLOBAL_TTM_BO, 440 442 and its size should be sizeof(struct ttm_bo_global). Again, 441 - driver specific init and release functions can be provided, 442 - likely eventually calling ttm_bo_global_init and 443 - ttm_bo_global_release, respectively. Also like the previous 444 - object, ttm_global_item_ref is used to create an initial reference 443 + driver-specific init and release functions may be provided, 444 + likely eventually calling ttm_bo_global_init() and 445 + ttm_bo_global_release(), respectively. Also, like the previous 446 + object, ttm_global_item_ref() is used to create an initial reference 445 447 count for the TTM, which will call your initialization function. 446 448 </para> 447 449 </sect3> ··· 451 453 GEM is an alternative to TTM, designed specifically for UMA 452 454 devices. It has simpler initialization and execution requirements 453 455 than TTM, but has no VRAM management capability. Core GEM 454 - initialization is comprised of a basic drm_mm_init call to create 456 + is initialized by calling drm_mm_init() to create 455 457 a GTT DRM MM object, which provides an address space pool for 456 - object allocation. In a KMS configuration, the driver will 457 - need to allocate and initialize a command ring buffer following 458 - basic GEM initialization. Most UMA devices have a so-called 458 + object allocation. In a KMS configuration, the driver 459 + needs to allocate and initialize a command ring buffer following 460 + core GEM initialization. A UMA device usually has what is called a 459 461 "stolen" memory region, which provides space for the initial 460 462 framebuffer and large, contiguous memory regions required by the 461 - device. This space is not typically managed by GEM, and must 463 + device. This space is not typically managed by GEM, and it must 462 464 be initialized separately into its own DRM MM object. 463 465 </para> 464 466 <para> 465 - Initialization will be driver specific, and will depend on 466 - the architecture of the device. In the case of Intel 467 + Initialization is driver-specific. In the case of Intel 467 468 integrated graphics chips like 965GM, GEM initialization can 468 469 be done by calling the internal GEM init function, 469 470 i915_gem_do_init(). Since the 965GM is a UMA device 470 - (i.e. it doesn't have dedicated VRAM), GEM will manage 471 + (i.e. it doesn't have dedicated VRAM), GEM manages 471 472 making regular RAM available for GPU operations. Memory set 472 473 aside by the BIOS (called "stolen" memory by the i915 473 - driver) will be managed by the DRM memrange allocator; the 474 - rest of the aperture will be managed by GEM. 474 + driver) is managed by the DRM memrange allocator; the 475 + rest of the aperture is managed by GEM. 475 476 <programlisting> 476 477 /* Basic memrange allocator for stolen space (aka vram) */ 477 478 drm_memrange_init(&amp;dev_priv->vram, 0, prealloc_size); ··· 480 483 <!--!Edrivers/char/drm/drm_memrange.c--> 481 484 </para> 482 485 <para> 483 - Once the memory manager has been set up, we can allocate the 486 + Once the memory manager has been set up, we may allocate the 484 487 command buffer. In the i915 case, this is also done with a 485 488 GEM function, i915_gem_init_ringbuffer(). 486 489 </para> ··· 490 493 <sect2> 491 494 <title>Output configuration</title> 492 495 <para> 493 - The final initialization task is output configuration. This involves 494 - finding and initializing the CRTCs, encoders and connectors 495 - for your device, creating an initial configuration and 496 - registering a framebuffer console driver. 496 + The final initialization task is output configuration. This involves: 497 + <itemizedlist> 498 + <listitem> 499 + Finding and initializing the CRTCs, encoders, and connectors 500 + for the device. 501 + </listitem> 502 + <listitem> 503 + Creating an initial configuration. 504 + </listitem> 505 + <listitem> 506 + Registering a framebuffer console driver. 507 + </listitem> 508 + </itemizedlist> 497 509 </para> 498 510 <sect3> 499 511 <title>Output discovery and initialization</title> 500 512 <para> 501 - Several core functions exist to create CRTCs, encoders and 502 - connectors, namely drm_crtc_init(), drm_connector_init() and 513 + Several core functions exist to create CRTCs, encoders, and 514 + connectors, namely: drm_crtc_init(), drm_connector_init(), and 503 515 drm_encoder_init(), along with several "helper" functions to 504 516 perform common tasks. 505 517 </para> ··· 561 555 </programlisting> 562 556 <para> 563 557 In the example above (again, taken from the i915 driver), a 564 - CRT connector and encoder combination is created. A device 565 - specific i2c bus is also created, for fetching EDID data and 558 + CRT connector and encoder combination is created. A device-specific 559 + i2c bus is also created for fetching EDID data and 566 560 performing monitor detection. Once the process is complete, 567 - the new connector is registered with sysfs, to make its 561 + the new connector is registered with sysfs to make its 568 562 properties available to applications. 569 563 </para> 570 564 <sect4> ··· 573 567 Since many PC-class graphics devices have similar display output 574 568 designs, the DRM provides a set of helper functions to make 575 569 output management easier. The core helper routines handle 576 - encoder re-routing and disabling of unused functions following 577 - mode set. Using the helpers is optional, but recommended for 570 + encoder re-routing and the disabling of unused functions following 571 + mode setting. Using the helpers is optional, but recommended for 578 572 devices with PC-style architectures (i.e. a set of display planes 579 573 for feeding pixels to encoders which are in turn routed to 580 574 connectors). Devices with more complex requirements needing 581 - finer grained management can opt to use the core callbacks 575 + finer grained management may opt to use the core callbacks 582 576 directly. 583 577 </para> 584 578 <para> ··· 586 580 </para> 587 581 </sect4> 588 582 <para> 589 - For each encoder, CRTC and connector, several functions must 590 - be provided, depending on the object type. Encoder objects 591 - need to provide a DPMS (basically on/off) function, mode fixup 592 - (for converting requested modes into native hardware timings), 593 - and prepare, set and commit functions for use by the core DRM 594 - helper functions. Connector helpers need to provide mode fetch and 595 - validity functions as well as an encoder matching function for 596 - returning an ideal encoder for a given connector. The core 597 - connector functions include a DPMS callback, (deprecated) 598 - save/restore routines, detection, mode probing, property handling, 599 - and cleanup functions. 583 + Each encoder object needs to provide: 584 + <itemizedlist> 585 + <listitem> 586 + A DPMS (basically on/off) function. 587 + </listitem> 588 + <listitem> 589 + A mode-fixup function (for converting requested modes into 590 + native hardware timings). 591 + </listitem> 592 + <listitem> 593 + Functions (prepare, set, and commit) for use by the core DRM 594 + helper functions. 595 + </listitem> 596 + </itemizedlist> 597 + Connector helpers need to provide functions (mode-fetch, validity, 598 + and encoder-matching) for returning an ideal encoder for a given 599 + connector. The core connector functions include a DPMS callback, 600 + save/restore routines (deprecated), detection, mode probing, 601 + property handling, and cleanup functions. 600 602 </para> 601 603 <!--!Edrivers/char/drm/drm_crtc.h--> 602 604 <!--!Edrivers/char/drm/drm_crtc.c--> ··· 619 605 <title>VBlank event handling</title> 620 606 <para> 621 607 The DRM core exposes two vertical blank related ioctls: 622 - DRM_IOCTL_WAIT_VBLANK and DRM_IOCTL_MODESET_CTL. 608 + <variablelist> 609 + <varlistentry> 610 + <term>DRM_IOCTL_WAIT_VBLANK</term> 611 + <listitem> 612 + <para> 613 + This takes a struct drm_wait_vblank structure as its argument, 614 + and it is used to block or request a signal when a specified 615 + vblank event occurs. 616 + </para> 617 + </listitem> 618 + </varlistentry> 619 + <varlistentry> 620 + <term>DRM_IOCTL_MODESET_CTL</term> 621 + <listitem> 622 + <para> 623 + This should be called by application level drivers before and 624 + after mode setting, since on many devices the vertical blank 625 + counter is reset at that time. Internally, the DRM snapshots 626 + the last vblank count when the ioctl is called with the 627 + _DRM_PRE_MODESET command, so that the counter won't go backwards 628 + (which is dealt with when _DRM_POST_MODESET is used). 629 + </para> 630 + </listitem> 631 + </varlistentry> 632 + </variablelist> 623 633 <!--!Edrivers/char/drm/drm_irq.c--> 624 - </para> 625 - <para> 626 - DRM_IOCTL_WAIT_VBLANK takes a struct drm_wait_vblank structure 627 - as its argument, and is used to block or request a signal when a 628 - specified vblank event occurs. 629 - </para> 630 - <para> 631 - DRM_IOCTL_MODESET_CTL should be called by application level 632 - drivers before and after mode setting, since on many devices the 633 - vertical blank counter will be reset at that time. Internally, 634 - the DRM snapshots the last vblank count when the ioctl is called 635 - with the _DRM_PRE_MODESET command so that the counter won't go 636 - backwards (which is dealt with when _DRM_POST_MODESET is used). 637 634 </para> 638 635 <para> 639 636 To support the functions above, the DRM core provides several ··· 657 632 register. The enable and disable vblank callbacks should enable 658 633 and disable vertical blank interrupts, respectively. In the 659 634 absence of DRM clients waiting on vblank events, the core DRM 660 - code will use the disable_vblank() function to disable 661 - interrupts, which saves power. They'll be re-enabled again when 635 + code uses the disable_vblank() function to disable 636 + interrupts, which saves power. They are re-enabled again when 662 637 a client calls the vblank wait ioctl above. 663 638 </para> 664 639 <para> 665 - Devices that don't provide a count register can simply use an 640 + A device that doesn't provide a count register may simply use an 666 641 internal atomic counter incremented on every vertical blank 667 - interrupt, and can make their enable and disable vblank 668 - functions into no-ops. 642 + interrupt (and then treat the enable_vblank() and disable_vblank() 643 + callbacks as no-ops). 669 644 </para> 670 645 </sect1> 671 646 672 647 <sect1> 673 648 <title>Memory management</title> 674 649 <para> 675 - The memory manager lies at the heart of many DRM operations, and 676 - is also required to support advanced client features like OpenGL 677 - pbuffers. The DRM currently contains two memory managers, TTM 650 + The memory manager lies at the heart of many DRM operations; it 651 + is required to support advanced client features like OpenGL 652 + pbuffers. The DRM currently contains two memory managers: TTM 678 653 and GEM. 679 654 </para> 680 655 ··· 704 679 <para> 705 680 GEM-enabled drivers must provide gem_init_object() and 706 681 gem_free_object() callbacks to support the core memory 707 - allocation routines. They should also provide several driver 708 - specific ioctls to support command execution, pinning, buffer 682 + allocation routines. They should also provide several driver-specific 683 + ioctls to support command execution, pinning, buffer 709 684 read &amp; write, mapping, and domain ownership transfers. 710 685 </para> 711 686 <para> 712 - On a fundamental level, GEM involves several operations: memory 713 - allocation and freeing, command execution, and aperture management 714 - at command execution time. Buffer object allocation is relatively 687 + On a fundamental level, GEM involves several operations: 688 + <itemizedlist> 689 + <listitem>Memory allocation and freeing</listitem> 690 + <listitem>Command execution</listitem> 691 + <listitem>Aperture management at command execution time</listitem> 692 + </itemizedlist> 693 + Buffer object allocation is relatively 715 694 straightforward and largely provided by Linux's shmem layer, which 716 695 provides memory to back each object. When mapped into the GTT 717 696 or used in a command buffer, the backing pages for an object are 718 697 flushed to memory and marked write combined so as to be coherent 719 - with the GPU. Likewise, when the GPU finishes rendering to an object, 720 - if the CPU accesses it, it must be made coherent with the CPU's view 698 + with the GPU. Likewise, if the CPU accesses an object after the GPU 699 + has finished rendering to the object, then the object must be made 700 + coherent with the CPU's view 721 701 of memory, usually involving GPU cache flushing of various kinds. 722 - This core CPU&lt;-&gt;GPU coherency management is provided by the GEM 723 - set domain function, which evaluates an object's current domain and 702 + This core CPU&lt;-&gt;GPU coherency management is provided by a 703 + device-specific ioctl, which evaluates an object's current domain and 724 704 performs any necessary flushing or synchronization to put the object 725 705 into the desired coherency domain (note that the object may be busy, 726 - i.e. an active render target; in that case the set domain function 727 - will block the client and wait for rendering to complete before 706 + i.e. an active render target; in that case, setting the domain 707 + blocks the client and waits for rendering to complete before 728 708 performing any necessary flushing operations). 729 709 </para> 730 710 <para> 731 711 Perhaps the most important GEM function is providing a command 732 712 execution interface to clients. Client programs construct command 733 - buffers containing references to previously allocated memory objects 734 - and submit them to GEM. At that point, GEM will take care to bind 713 + buffers containing references to previously allocated memory objects, 714 + and then submit them to GEM. At that point, GEM takes care to bind 735 715 all the objects into the GTT, execute the buffer, and provide 736 716 necessary synchronization between clients accessing the same buffers. 737 717 This often involves evicting some objects from the GTT and re-binding 738 718 others (a fairly expensive operation), and providing relocation 739 719 support which hides fixed GTT offsets from clients. Clients must 740 720 take care not to submit command buffers that reference more objects 741 - than can fit in the GTT or GEM will reject them and no rendering 721 + than can fit in the GTT; otherwise, GEM will reject them and no rendering 742 722 will occur. Similarly, if several objects in the buffer require 743 723 fence registers to be allocated for correct rendering (e.g. 2D blits 744 724 on pre-965 chips), care must be taken not to require more fence ··· 759 729 <title>Output management</title> 760 730 <para> 761 731 At the core of the DRM output management code is a set of 762 - structures representing CRTCs, encoders and connectors. 732 + structures representing CRTCs, encoders, and connectors. 763 733 </para> 764 734 <para> 765 735 A CRTC is an abstraction representing a part of the chip that ··· 795 765 <sect1> 796 766 <title>Framebuffer management</title> 797 767 <para> 798 - In order to set a mode on a given CRTC, encoder and connector 799 - configuration, clients need to provide a framebuffer object which 800 - will provide a source of pixels for the CRTC to deliver to the encoder(s) 801 - and ultimately the connector(s) in the configuration. A framebuffer 802 - is fundamentally a driver specific memory object, made into an opaque 803 - handle by the DRM addfb function. Once an fb has been created this 804 - way it can be passed to the KMS mode setting routines for use in 805 - a configuration. 768 + Clients need to provide a framebuffer object which provides a source 769 + of pixels for a CRTC to deliver to the encoder(s) and ultimately the 770 + connector(s). A framebuffer is fundamentally a driver-specific memory 771 + object, made into an opaque handle by the DRM's addfb() function. 772 + Once a framebuffer has been created this way, it may be passed to the 773 + KMS mode setting routines for use in a completed configuration. 806 774 </para> 807 775 </sect1> 808 776 809 777 <sect1> 810 778 <title>Command submission &amp; fencing</title> 811 779 <para> 812 - This should cover a few device specific command submission 780 + This should cover a few device-specific command submission 813 781 implementations. 814 782 </para> 815 783 </sect1> ··· 817 789 <para> 818 790 The DRM core provides some suspend/resume code, but drivers 819 791 wanting full suspend/resume support should provide save() and 820 - restore() functions. These will be called at suspend, 792 + restore() functions. These are called at suspend, 821 793 hibernate, or resume time, and should perform any state save or 822 794 restore required by your device across suspend or hibernate 823 795 states. ··· 840 812 <para> 841 813 The DRM core exports several interfaces to applications, 842 814 generally intended to be used through corresponding libdrm 843 - wrapper functions. In addition, drivers export device specific 844 - interfaces for use by userspace drivers &amp; device aware 815 + wrapper functions. In addition, drivers export device-specific 816 + interfaces for use by userspace drivers &amp; device-aware 845 817 applications through ioctls and sysfs files. 846 818 </para> 847 819 <para> ··· 850 822 management, memory management, and output management. 851 823 </para> 852 824 <para> 853 - Cover generic ioctls and sysfs layout here. Only need high 854 - level info, since man pages will cover the rest. 825 + Cover generic ioctls and sysfs layout here. We only need high-level 826 + info, since man pages should cover the rest. 855 827 </para> 856 828 </chapter> 857 829
+2 -2
drivers/gpu/drm/i915/i915_drv.c
··· 789 789 }; 790 790 791 791 static struct drm_driver driver = { 792 - /* don't use mtrr's here, the Xserver or user space app should 793 - * deal with them for intel hardware. 792 + /* Don't use MTRRs here; the Xserver or userspace app should 793 + * deal with them for Intel hardware. 794 794 */ 795 795 .driver_features = 796 796 DRIVER_USE_AGP | DRIVER_REQUIRE_AGP | /* DRIVER_USE_MTRR |*/