blob: 8b8257891396e20b120b4bf254a4430d1c2cd00c [file] [log] [blame]
Jani Nikulaca00c2b2016-06-21 14:48:58 +03001DRM Internals
2=============
3
4This chapter documents DRM internals relevant to driver authors and
5developers working to add support for the latest features to existing
6drivers.
7
8First, we go over some typical driver initialization requirements, like
9setting up command buffers, creating an initial output configuration,
10and initializing core services. Subsequent sections cover core internals
11in more detail, providing implementation notes and examples.
12
13The DRM layer provides several services to graphics drivers, many of
14them driven by the application interfaces it provides through libdrm,
15the library that wraps most of the DRM ioctls. These include vblank
16event handling, memory management, output management, framebuffer
17management, command submission & fencing, suspend/resume support, and
18DMA services.
19
20Driver Initialization
21---------------------
22
23At the core of every DRM driver is a :c:type:`struct drm_driver
24<drm_driver>` structure. Drivers typically statically initialize
25a drm_driver structure, and then pass it to
26:c:func:`drm_dev_alloc()` to allocate a device instance. After the
27device instance is fully initialized it can be registered (which makes
28it accessible from userspace) using :c:func:`drm_dev_register()`.
29
30The :c:type:`struct drm_driver <drm_driver>` structure
31contains static information that describes the driver and features it
32supports, and pointers to methods that the DRM core will call to
33implement the DRM API. We will first go through the :c:type:`struct
34drm_driver <drm_driver>` static information fields, and will
35then describe individual operations in details as they get used in later
36sections.
37
38Driver Information
39~~~~~~~~~~~~~~~~~~
40
41Driver Features
42^^^^^^^^^^^^^^^
43
44Drivers inform the DRM core about their requirements and supported
45features by setting appropriate flags in the driver_features field.
46Since those flags influence the DRM core behaviour since registration
47time, most of them must be set to registering the :c:type:`struct
48drm_driver <drm_driver>` instance.
49
50u32 driver_features;
51
52DRIVER_USE_AGP
53 Driver uses AGP interface, the DRM core will manage AGP resources.
54
55DRIVER_REQUIRE_AGP
56 Driver needs AGP interface to function. AGP initialization failure
57 will become a fatal error.
58
59DRIVER_PCI_DMA
60 Driver is capable of PCI DMA, mapping of PCI DMA buffers to
61 userspace will be enabled. Deprecated.
62
63DRIVER_SG
64 Driver can perform scatter/gather DMA, allocation and mapping of
65 scatter/gather buffers will be enabled. Deprecated.
66
67DRIVER_HAVE_DMA
68 Driver supports DMA, the userspace DMA API will be supported.
69 Deprecated.
70
71DRIVER_HAVE_IRQ; DRIVER_IRQ_SHARED
72 DRIVER_HAVE_IRQ indicates whether the driver has an IRQ handler
73 managed by the DRM Core. The core will support simple IRQ handler
74 installation when the flag is set. The installation process is
75 described in ?.
76
77 DRIVER_IRQ_SHARED indicates whether the device & handler support
78 shared IRQs (note that this is required of PCI drivers).
79
80DRIVER_GEM
81 Driver use the GEM memory manager.
82
83DRIVER_MODESET
84 Driver supports mode setting interfaces (KMS).
85
86DRIVER_PRIME
87 Driver implements DRM PRIME buffer sharing.
88
89DRIVER_RENDER
90 Driver supports dedicated render nodes.
91
92DRIVER_ATOMIC
93 Driver supports atomic properties. In this case the driver must
94 implement appropriate obj->atomic_get_property() vfuncs for any
95 modeset objects with driver specific properties.
96
97Major, Minor and Patchlevel
98^^^^^^^^^^^^^^^^^^^^^^^^^^^
99
100int major; int minor; int patchlevel;
101The DRM core identifies driver versions by a major, minor and patch
102level triplet. The information is printed to the kernel log at
103initialization time and passed to userspace through the
104DRM_IOCTL_VERSION ioctl.
105
106The major and minor numbers are also used to verify the requested driver
107API version passed to DRM_IOCTL_SET_VERSION. When the driver API
108changes between minor versions, applications can call
109DRM_IOCTL_SET_VERSION to select a specific version of the API. If the
110requested major isn't equal to the driver major, or the requested minor
111is larger than the driver minor, the DRM_IOCTL_SET_VERSION call will
112return an error. Otherwise the driver's set_version() method will be
113called with the requested version.
114
115Name, Description and Date
116^^^^^^^^^^^^^^^^^^^^^^^^^^
117
118char \*name; char \*desc; char \*date;
119The driver name is printed to the kernel log at initialization time,
120used for IRQ registration and passed to userspace through
121DRM_IOCTL_VERSION.
122
123The driver description is a purely informative string passed to
124userspace through the DRM_IOCTL_VERSION ioctl and otherwise unused by
125the kernel.
126
127The driver date, formatted as YYYYMMDD, is meant to identify the date of
128the latest modification to the driver. However, as most drivers fail to
129update it, its value is mostly useless. The DRM core prints it to the
130kernel log at initialization time and passes it to userspace through the
131DRM_IOCTL_VERSION ioctl.
132
133Device Instance and Driver Handling
134~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135
136.. kernel-doc:: drivers/gpu/drm/drm_drv.c
137 :doc: driver instance overview
138
139.. kernel-doc:: drivers/gpu/drm/drm_drv.c
140 :export:
141
142Driver Load
143~~~~~~~~~~~
144
145IRQ Registration
146^^^^^^^^^^^^^^^^
147
148The DRM core tries to facilitate IRQ handler registration and
149unregistration by providing :c:func:`drm_irq_install()` and
150:c:func:`drm_irq_uninstall()` functions. Those functions only
151support a single interrupt per device, devices that use more than one
152IRQs need to be handled manually.
153
154Managed IRQ Registration
155''''''''''''''''''''''''
156
157:c:func:`drm_irq_install()` starts by calling the irq_preinstall
158driver operation. The operation is optional and must make sure that the
159interrupt will not get fired by clearing all pending interrupt flags or
160disabling the interrupt.
161
162The passed-in IRQ will then be requested by a call to
163:c:func:`request_irq()`. If the DRIVER_IRQ_SHARED driver feature
164flag is set, a shared (IRQF_SHARED) IRQ handler will be requested.
165
166The IRQ handler function must be provided as the mandatory irq_handler
167driver operation. It will get passed directly to
168:c:func:`request_irq()` and thus has the same prototype as all IRQ
169handlers. It will get called with a pointer to the DRM device as the
170second argument.
171
172Finally the function calls the optional irq_postinstall driver
173operation. The operation usually enables interrupts (excluding the
174vblank interrupt, which is enabled separately), but drivers may choose
175to enable/disable interrupts at a different time.
176
177:c:func:`drm_irq_uninstall()` is similarly used to uninstall an
178IRQ handler. It starts by waking up all processes waiting on a vblank
179interrupt to make sure they don't hang, and then calls the optional
180irq_uninstall driver operation. The operation must disable all hardware
181interrupts. Finally the function frees the IRQ by calling
182:c:func:`free_irq()`.
183
184Manual IRQ Registration
185'''''''''''''''''''''''
186
187Drivers that require multiple interrupt handlers can't use the managed
188IRQ registration functions. In that case IRQs must be registered and
189unregistered manually (usually with the :c:func:`request_irq()` and
190:c:func:`free_irq()` functions, or their devm_\* equivalent).
191
192When manually registering IRQs, drivers must not set the
193DRIVER_HAVE_IRQ driver feature flag, and must not provide the
194irq_handler driver operation. They must set the :c:type:`struct
195drm_device <drm_device>` irq_enabled field to 1 upon
196registration of the IRQs, and clear it to 0 after unregistering the
197IRQs.
198
199Memory Manager Initialization
200^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
201
202Every DRM driver requires a memory manager which must be initialized at
203load time. DRM currently contains two memory managers, the Translation
204Table Manager (TTM) and the Graphics Execution Manager (GEM). This
205document describes the use of the GEM memory manager only. See ? for
206details.
207
208Miscellaneous Device Configuration
209^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
211Another task that may be necessary for PCI devices during configuration
212is mapping the video BIOS. On many devices, the VBIOS describes device
213configuration, LCD panel timings (if any), and contains flags indicating
214device state. Mapping the BIOS can be done using the pci_map_rom()
215call, a convenience function that takes care of mapping the actual ROM,
216whether it has been shadowed into memory (typically at address 0xc0000)
217or exists on the PCI device in the ROM BAR. Note that after the ROM has
218been mapped and any necessary information has been extracted, it should
219be unmapped; on many devices, the ROM address decoder is shared with
220other BARs, so leaving it mapped could cause undesired behaviour like
221hangs or memory corruption.
222
223Bus-specific Device Registration and PCI Support
224~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225
226A number of functions are provided to help with device registration. The
227functions deal with PCI and platform devices respectively and are only
228provided for historical reasons. These are all deprecated and shouldn't
229be used in new drivers. Besides that there's a few helpers for pci
230drivers.
231
232.. kernel-doc:: drivers/gpu/drm/drm_pci.c
233 :export:
234
235.. kernel-doc:: drivers/gpu/drm/drm_platform.c
236 :export:
237
238Memory management
239-----------------
240
241Modern Linux systems require large amount of graphics memory to store
242frame buffers, textures, vertices and other graphics-related data. Given
243the very dynamic nature of many of that data, managing graphics memory
244efficiently is thus crucial for the graphics stack and plays a central
245role in the DRM infrastructure.
246
247The DRM core includes two memory managers, namely Translation Table Maps
248(TTM) and Graphics Execution Manager (GEM). TTM was the first DRM memory
249manager to be developed and tried to be a one-size-fits-them all
250solution. It provides a single userspace API to accommodate the need of
251all hardware, supporting both Unified Memory Architecture (UMA) devices
252and devices with dedicated video RAM (i.e. most discrete video cards).
253This resulted in a large, complex piece of code that turned out to be
254hard to use for driver development.
255
256GEM started as an Intel-sponsored project in reaction to TTM's
257complexity. Its design philosophy is completely different: instead of
258providing a solution to every graphics memory-related problems, GEM
259identified common code between drivers and created a support library to
260share it. GEM has simpler initialization and execution requirements than
261TTM, but has no video RAM management capabilities and is thus limited to
262UMA devices.
263
264The Translation Table Manager (TTM)
265~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266
267TTM design background and information belongs here.
268
269TTM initialization
270^^^^^^^^^^^^^^^^^^
271
272 **Warning**
273
274 This section is outdated.
275
276Drivers wishing to support TTM must fill out a drm_bo_driver
277structure. The structure contains several fields with function pointers
278for initializing the TTM, allocating and freeing memory, waiting for
279command completion and fence synchronization, and memory migration. See
280the radeon_ttm.c file for an example of usage.
281
282The ttm_global_reference structure is made up of several fields:
283
284::
285
286 struct ttm_global_reference {
287 enum ttm_global_types global_type;
288 size_t size;
289 void *object;
290 int (*init) (struct ttm_global_reference *);
291 void (*release) (struct ttm_global_reference *);
292 };
293
294
295There should be one global reference structure for your memory manager
296as a whole, and there will be others for each object created by the
297memory manager at runtime. Your global TTM should have a type of
298TTM_GLOBAL_TTM_MEM. The size field for the global object should be
299sizeof(struct ttm_mem_global), and the init and release hooks should
300point at your driver-specific init and release routines, which probably
301eventually call ttm_mem_global_init and ttm_mem_global_release,
302respectively.
303
304Once your global TTM accounting structure is set up and initialized by
305calling ttm_global_item_ref() on it, you need to create a buffer
306object TTM to provide a pool for buffer object allocation by clients and
307the kernel itself. The type of this object should be
308TTM_GLOBAL_TTM_BO, and its size should be sizeof(struct
309ttm_bo_global). Again, driver-specific init and release functions may
310be provided, likely eventually calling ttm_bo_global_init() and
311ttm_bo_global_release(), respectively. Also, like the previous
312object, ttm_global_item_ref() is used to create an initial reference
313count for the TTM, which will call your initialization function.
314
315The Graphics Execution Manager (GEM)
316~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317
318The GEM design approach has resulted in a memory manager that doesn't
319provide full coverage of all (or even all common) use cases in its
320userspace or kernel API. GEM exposes a set of standard memory-related
321operations to userspace and a set of helper functions to drivers, and
322let drivers implement hardware-specific operations with their own
323private API.
324
325The GEM userspace API is described in the `GEM - the Graphics Execution
326Manager <http://lwn.net/Articles/283798/>`__ article on LWN. While
327slightly outdated, the document provides a good overview of the GEM API
328principles. Buffer allocation and read and write operations, described
329as part of the common GEM API, are currently implemented using
330driver-specific ioctls.
331
332GEM is data-agnostic. It manages abstract buffer objects without knowing
333what individual buffers contain. APIs that require knowledge of buffer
334contents or purpose, such as buffer allocation or synchronization
335primitives, are thus outside of the scope of GEM and must be implemented
336using driver-specific ioctls.
337
338On a fundamental level, GEM involves several operations:
339
340- Memory allocation and freeing
341- Command execution
342- Aperture management at command execution time
343
344Buffer object allocation is relatively straightforward and largely
345provided by Linux's shmem layer, which provides memory to back each
346object.
347
348Device-specific operations, such as command execution, pinning, buffer
349read & write, mapping, and domain ownership transfers are left to
350driver-specific ioctls.
351
352GEM Initialization
353^^^^^^^^^^^^^^^^^^
354
355Drivers that use GEM must set the DRIVER_GEM bit in the struct
356:c:type:`struct drm_driver <drm_driver>` driver_features
357field. The DRM core will then automatically initialize the GEM core
358before calling the load operation. Behind the scene, this will create a
359DRM Memory Manager object which provides an address space pool for
360object allocation.
361
362In a KMS configuration, drivers need to allocate and initialize a
363command ring buffer following core GEM initialization if required by the
364hardware. UMA devices usually have what is called a "stolen" memory
365region, which provides space for the initial framebuffer and large,
366contiguous memory regions required by the device. This space is
367typically not managed by GEM, and must be initialized separately into
368its own DRM MM object.
369
370GEM Objects Creation
371^^^^^^^^^^^^^^^^^^^^
372
373GEM splits creation of GEM objects and allocation of the memory that
374backs them in two distinct operations.
375
376GEM objects are represented by an instance of struct :c:type:`struct
377drm_gem_object <drm_gem_object>`. Drivers usually need to
378extend GEM objects with private information and thus create a
379driver-specific GEM object structure type that embeds an instance of
380struct :c:type:`struct drm_gem_object <drm_gem_object>`.
381
382To create a GEM object, a driver allocates memory for an instance of its
383specific GEM object type and initializes the embedded struct
384:c:type:`struct drm_gem_object <drm_gem_object>` with a call
385to :c:func:`drm_gem_object_init()`. The function takes a pointer
386to the DRM device, a pointer to the GEM object and the buffer object
387size in bytes.
388
389GEM uses shmem to allocate anonymous pageable memory.
390:c:func:`drm_gem_object_init()` will create an shmfs file of the
391requested size and store it into the struct :c:type:`struct
392drm_gem_object <drm_gem_object>` filp field. The memory is
393used as either main storage for the object when the graphics hardware
394uses system memory directly or as a backing store otherwise.
395
396Drivers are responsible for the actual physical pages allocation by
397calling :c:func:`shmem_read_mapping_page_gfp()` for each page.
398Note that they can decide to allocate pages when initializing the GEM
399object, or to delay allocation until the memory is needed (for instance
400when a page fault occurs as a result of a userspace memory access or
401when the driver needs to start a DMA transfer involving the memory).
402
403Anonymous pageable memory allocation is not always desired, for instance
404when the hardware requires physically contiguous system memory as is
405often the case in embedded devices. Drivers can create GEM objects with
406no shmfs backing (called private GEM objects) by initializing them with
407a call to :c:func:`drm_gem_private_object_init()` instead of
408:c:func:`drm_gem_object_init()`. Storage for private GEM objects
409must be managed by drivers.
410
411GEM Objects Lifetime
412^^^^^^^^^^^^^^^^^^^^
413
414All GEM objects are reference-counted by the GEM core. References can be
415acquired and release by :c:func:`calling
416drm_gem_object_reference()` and
417:c:func:`drm_gem_object_unreference()` respectively. The caller
418must hold the :c:type:`struct drm_device <drm_device>`
419struct_mutex lock when calling
420:c:func:`drm_gem_object_reference()`. As a convenience, GEM
421provides :c:func:`drm_gem_object_unreference_unlocked()`
422functions that can be called without holding the lock.
423
424When the last reference to a GEM object is released the GEM core calls
425the :c:type:`struct drm_driver <drm_driver>` gem_free_object
426operation. That operation is mandatory for GEM-enabled drivers and must
427free the GEM object and all associated resources.
428
429void (\*gem_free_object) (struct drm_gem_object \*obj); Drivers are
430responsible for freeing all GEM object resources. This includes the
431resources created by the GEM core, which need to be released with
432:c:func:`drm_gem_object_release()`.
433
434GEM Objects Naming
435^^^^^^^^^^^^^^^^^^
436
437Communication between userspace and the kernel refers to GEM objects
438using local handles, global names or, more recently, file descriptors.
439All of those are 32-bit integer values; the usual Linux kernel limits
440apply to the file descriptors.
441
442GEM handles are local to a DRM file. Applications get a handle to a GEM
443object through a driver-specific ioctl, and can use that handle to refer
444to the GEM object in other standard or driver-specific ioctls. Closing a
445DRM file handle frees all its GEM handles and dereferences the
446associated GEM objects.
447
448To create a handle for a GEM object drivers call
449:c:func:`drm_gem_handle_create()`. The function takes a pointer
450to the DRM file and the GEM object and returns a locally unique handle.
451When the handle is no longer needed drivers delete it with a call to
452:c:func:`drm_gem_handle_delete()`. Finally the GEM object
453associated with a handle can be retrieved by a call to
454:c:func:`drm_gem_object_lookup()`.
455
456Handles don't take ownership of GEM objects, they only take a reference
457to the object that will be dropped when the handle is destroyed. To
458avoid leaking GEM objects, drivers must make sure they drop the
459reference(s) they own (such as the initial reference taken at object
460creation time) as appropriate, without any special consideration for the
461handle. For example, in the particular case of combined GEM object and
462handle creation in the implementation of the dumb_create operation,
463drivers must drop the initial reference to the GEM object before
464returning the handle.
465
466GEM names are similar in purpose to handles but are not local to DRM
467files. They can be passed between processes to reference a GEM object
468globally. Names can't be used directly to refer to objects in the DRM
469API, applications must convert handles to names and names to handles
470using the DRM_IOCTL_GEM_FLINK and DRM_IOCTL_GEM_OPEN ioctls
471respectively. The conversion is handled by the DRM core without any
472driver-specific support.
473
474GEM also supports buffer sharing with dma-buf file descriptors through
475PRIME. GEM-based drivers must use the provided helpers functions to
476implement the exporting and importing correctly. See ?. Since sharing
477file descriptors is inherently more secure than the easily guessable and
478global GEM names it is the preferred buffer sharing mechanism. Sharing
479buffers through GEM names is only supported for legacy userspace.
480Furthermore PRIME also allows cross-device buffer sharing since it is
481based on dma-bufs.
482
483GEM Objects Mapping
484^^^^^^^^^^^^^^^^^^^
485
486Because mapping operations are fairly heavyweight GEM favours
487read/write-like access to buffers, implemented through driver-specific
488ioctls, over mapping buffers to userspace. However, when random access
489to the buffer is needed (to perform software rendering for instance),
490direct access to the object can be more efficient.
491
492The mmap system call can't be used directly to map GEM objects, as they
493don't have their own file handle. Two alternative methods currently
494co-exist to map GEM objects to userspace. The first method uses a
495driver-specific ioctl to perform the mapping operation, calling
496:c:func:`do_mmap()` under the hood. This is often considered
497dubious, seems to be discouraged for new GEM-enabled drivers, and will
498thus not be described here.
499
500The second method uses the mmap system call on the DRM file handle. void
501\*mmap(void \*addr, size_t length, int prot, int flags, int fd, off_t
502offset); DRM identifies the GEM object to be mapped by a fake offset
503passed through the mmap offset argument. Prior to being mapped, a GEM
504object must thus be associated with a fake offset. To do so, drivers
505must call :c:func:`drm_gem_create_mmap_offset()` on the object.
506
507Once allocated, the fake offset value must be passed to the application
508in a driver-specific way and can then be used as the mmap offset
509argument.
510
511The GEM core provides a helper method :c:func:`drm_gem_mmap()` to
512handle object mapping. The method can be set directly as the mmap file
513operation handler. It will look up the GEM object based on the offset
514value and set the VMA operations to the :c:type:`struct drm_driver
515<drm_driver>` gem_vm_ops field. Note that
516:c:func:`drm_gem_mmap()` doesn't map memory to userspace, but
517relies on the driver-provided fault handler to map pages individually.
518
519To use :c:func:`drm_gem_mmap()`, drivers must fill the struct
520:c:type:`struct drm_driver <drm_driver>` gem_vm_ops field
521with a pointer to VM operations.
522
523struct vm_operations_struct \*gem_vm_ops struct
524vm_operations_struct { void (\*open)(struct vm_area_struct \* area);
525void (\*close)(struct vm_area_struct \* area); int (\*fault)(struct
526vm_area_struct \*vma, struct vm_fault \*vmf); };
527
528The open and close operations must update the GEM object reference
529count. Drivers can use the :c:func:`drm_gem_vm_open()` and
530:c:func:`drm_gem_vm_close()` helper functions directly as open
531and close handlers.
532
533The fault operation handler is responsible for mapping individual pages
534to userspace when a page fault occurs. Depending on the memory
535allocation scheme, drivers can allocate pages at fault time, or can
536decide to allocate memory for the GEM object at the time the object is
537created.
538
539Drivers that want to map the GEM object upfront instead of handling page
540faults can implement their own mmap file operation handler.
541
542Memory Coherency
543^^^^^^^^^^^^^^^^
544
545When mapped to the device or used in a command buffer, backing pages for
546an object are flushed to memory and marked write combined so as to be
547coherent with the GPU. Likewise, if the CPU accesses an object after the
548GPU has finished rendering to the object, then the object must be made
549coherent with the CPU's view of memory, usually involving GPU cache
550flushing of various kinds. This core CPU<->GPU coherency management is
551provided by a device-specific ioctl, which evaluates an object's current
552domain and performs any necessary flushing or synchronization to put the
553object into the desired coherency domain (note that the object may be
554busy, i.e. an active render target; in that case, setting the domain
555blocks the client and waits for rendering to complete before performing
556any necessary flushing operations).
557
558Command Execution
559^^^^^^^^^^^^^^^^^
560
561Perhaps the most important GEM function for GPU devices is providing a
562command execution interface to clients. Client programs construct
563command buffers containing references to previously allocated memory
564objects, and then submit them to GEM. At that point, GEM takes care to
565bind all the objects into the GTT, execute the buffer, and provide
566necessary synchronization between clients accessing the same buffers.
567This often involves evicting some objects from the GTT and re-binding
568others (a fairly expensive operation), and providing relocation support
569which hides fixed GTT offsets from clients. Clients must take care not
570to submit command buffers that reference more objects than can fit in
571the GTT; otherwise, GEM will reject them and no rendering will occur.
572Similarly, if several objects in the buffer require fence registers to
573be allocated for correct rendering (e.g. 2D blits on pre-965 chips),
574care must be taken not to require more fence registers than are
575available to the client. Such resource management should be abstracted
576from the client in libdrm.
577
578GEM Function Reference
579~~~~~~~~~~~~~~~~~~~~~~
580
581.. kernel-doc:: drivers/gpu/drm/drm_gem.c
582 :export:
583
584.. kernel-doc:: include/drm/drm_gem.h
585 :internal:
586
587VMA Offset Manager
588~~~~~~~~~~~~~~~~~~
589
590.. kernel-doc:: drivers/gpu/drm/drm_vma_manager.c
591 :doc: vma offset manager
592
593.. kernel-doc:: drivers/gpu/drm/drm_vma_manager.c
594 :export:
595
596.. kernel-doc:: include/drm/drm_vma_manager.h
597 :internal:
598
599PRIME Buffer Sharing
600~~~~~~~~~~~~~~~~~~~~
601
602PRIME is the cross device buffer sharing framework in drm, originally
603created for the OPTIMUS range of multi-gpu platforms. To userspace PRIME
604buffers are dma-buf based file descriptors.
605
606Overview and Driver Interface
607^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
608
609Similar to GEM global names, PRIME file descriptors are also used to
610share buffer objects across processes. They offer additional security:
611as file descriptors must be explicitly sent over UNIX domain sockets to
612be shared between applications, they can't be guessed like the globally
613unique GEM names.
614
615Drivers that support the PRIME API must set the DRIVER_PRIME bit in the
616struct :c:type:`struct drm_driver <drm_driver>`
617driver_features field, and implement the prime_handle_to_fd and
618prime_fd_to_handle operations.
619
620int (\*prime_handle_to_fd)(struct drm_device \*dev, struct drm_file
621\*file_priv, uint32_t handle, uint32_t flags, int \*prime_fd); int
622(\*prime_fd_to_handle)(struct drm_device \*dev, struct drm_file
623\*file_priv, int prime_fd, uint32_t \*handle); Those two operations
624convert a handle to a PRIME file descriptor and vice versa. Drivers must
625use the kernel dma-buf buffer sharing framework to manage the PRIME file
626descriptors. Similar to the mode setting API PRIME is agnostic to the
627underlying buffer object manager, as long as handles are 32bit unsigned
628integers.
629
630While non-GEM drivers must implement the operations themselves, GEM
631drivers must use the :c:func:`drm_gem_prime_handle_to_fd()` and
632:c:func:`drm_gem_prime_fd_to_handle()` helper functions. Those
633helpers rely on the driver gem_prime_export and gem_prime_import
634operations to create a dma-buf instance from a GEM object (dma-buf
635exporter role) and to create a GEM object from a dma-buf instance
636(dma-buf importer role).
637
638struct dma_buf \* (\*gem_prime_export)(struct drm_device \*dev,
639struct drm_gem_object \*obj, int flags); struct drm_gem_object \*
640(\*gem_prime_import)(struct drm_device \*dev, struct dma_buf
641\*dma_buf); These two operations are mandatory for GEM drivers that
642support PRIME.
643
644PRIME Helper Functions
645^^^^^^^^^^^^^^^^^^^^^^
646
647.. kernel-doc:: drivers/gpu/drm/drm_prime.c
648 :doc: PRIME Helpers
649
650PRIME Function References
651~~~~~~~~~~~~~~~~~~~~~~~~~
652
653.. kernel-doc:: drivers/gpu/drm/drm_prime.c
654 :export:
655
656DRM MM Range Allocator
657~~~~~~~~~~~~~~~~~~~~~~
658
659Overview
660^^^^^^^^
661
662.. kernel-doc:: drivers/gpu/drm/drm_mm.c
663 :doc: Overview
664
665LRU Scan/Eviction Support
666^^^^^^^^^^^^^^^^^^^^^^^^^
667
668.. kernel-doc:: drivers/gpu/drm/drm_mm.c
669 :doc: lru scan roaster
670
671DRM MM Range Allocator Function References
672~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
673
674.. kernel-doc:: drivers/gpu/drm/drm_mm.c
675 :export:
676
677.. kernel-doc:: include/drm/drm_mm.h
678 :internal:
679
680CMA Helper Functions Reference
681~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
682
683.. kernel-doc:: drivers/gpu/drm/drm_gem_cma_helper.c
684 :doc: cma helpers
685
686.. kernel-doc:: drivers/gpu/drm/drm_gem_cma_helper.c
687 :export:
688
689.. kernel-doc:: include/drm/drm_gem_cma_helper.h
690 :internal:
691
692Mode Setting
693------------
694
695Drivers must initialize the mode setting core by calling
696:c:func:`drm_mode_config_init()` on the DRM device. The function
697initializes the :c:type:`struct drm_device <drm_device>`
698mode_config field and never fails. Once done, mode configuration must
699be setup by initializing the following fields.
700
701- int min_width, min_height; int max_width, max_height;
702 Minimum and maximum width and height of the frame buffers in pixel
703 units.
704
705- struct drm_mode_config_funcs \*funcs;
706 Mode setting functions.
707
708Display Modes Function Reference
709~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
710
711.. kernel-doc:: include/drm/drm_modes.h
712 :internal:
713
714.. kernel-doc:: drivers/gpu/drm/drm_modes.c
715 :export:
716
717Atomic Mode Setting Function Reference
718~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
719
720.. kernel-doc:: drivers/gpu/drm/drm_atomic.c
721 :export:
722
723.. kernel-doc:: drivers/gpu/drm/drm_atomic.c
724 :internal:
725
726Frame Buffer Abstraction
727~~~~~~~~~~~~~~~~~~~~~~~~
728
729Frame buffers are abstract memory objects that provide a source of
730pixels to scanout to a CRTC. Applications explicitly request the
731creation of frame buffers through the DRM_IOCTL_MODE_ADDFB(2) ioctls
732and receive an opaque handle that can be passed to the KMS CRTC control,
733plane configuration and page flip functions.
734
735Frame buffers rely on the underneath memory manager for low-level memory
736operations. When creating a frame buffer applications pass a memory
737handle (or a list of memory handles for multi-planar formats) through
738the ``drm_mode_fb_cmd2`` argument. For drivers using GEM as their
739userspace buffer management interface this would be a GEM handle.
740Drivers are however free to use their own backing storage object
741handles, e.g. vmwgfx directly exposes special TTM handles to userspace
742and so expects TTM handles in the create ioctl and not GEM handles.
743
744The lifetime of a drm framebuffer is controlled with a reference count,
745drivers can grab additional references with
746:c:func:`drm_framebuffer_reference()`and drop them again with
747:c:func:`drm_framebuffer_unreference()`. For driver-private
748framebuffers for which the last reference is never dropped (e.g. for the
749fbdev framebuffer when the struct :c:type:`struct drm_framebuffer
750<drm_framebuffer>` is embedded into the fbdev helper struct)
751drivers can manually clean up a framebuffer at module unload time with
752:c:func:`drm_framebuffer_unregister_private()`.
753
754DRM Format Handling
755~~~~~~~~~~~~~~~~~~~
756
757.. kernel-doc:: include/drm/drm_fourcc.h
758 :internal:
759
760.. kernel-doc:: drivers/gpu/drm/drm_fourcc.c
761 :export:
762
763Dumb Buffer Objects
764~~~~~~~~~~~~~~~~~~~
765
766The KMS API doesn't standardize backing storage object creation and
767leaves it to driver-specific ioctls. Furthermore actually creating a
768buffer object even for GEM-based drivers is done through a
769driver-specific ioctl - GEM only has a common userspace interface for
770sharing and destroying objects. While not an issue for full-fledged
771graphics stacks that include device-specific userspace components (in
772libdrm for instance), this limit makes DRM-based early boot graphics
773unnecessarily complex.
774
775Dumb objects partly alleviate the problem by providing a standard API to
776create dumb buffers suitable for scanout, which can then be used to
777create KMS frame buffers.
778
779To support dumb objects drivers must implement the dumb_create,
780dumb_destroy and dumb_map_offset operations.
781
782- int (\*dumb_create)(struct drm_file \*file_priv, struct
783 drm_device \*dev, struct drm_mode_create_dumb \*args);
784 The dumb_create operation creates a driver object (GEM or TTM
785 handle) suitable for scanout based on the width, height and depth
786 from the struct :c:type:`struct drm_mode_create_dumb
787 <drm_mode_create_dumb>` argument. It fills the argument's
788 handle, pitch and size fields with a handle for the newly created
789 object and its line pitch and size in bytes.
790
791- int (\*dumb_destroy)(struct drm_file \*file_priv, struct
792 drm_device \*dev, uint32_t handle);
793 The dumb_destroy operation destroys a dumb object created by
794 dumb_create.
795
796- int (\*dumb_map_offset)(struct drm_file \*file_priv, struct
797 drm_device \*dev, uint32_t handle, uint64_t \*offset);
798 The dumb_map_offset operation associates an mmap fake offset with
799 the object given by the handle and returns it. Drivers must use the
800 :c:func:`drm_gem_create_mmap_offset()` function to associate
801 the fake offset as described in ?.
802
803Note that dumb objects may not be used for gpu acceleration, as has been
804attempted on some ARM embedded platforms. Such drivers really must have
805a hardware-specific ioctl to allocate suitable buffer objects.
806
807Output Polling
808~~~~~~~~~~~~~~
809
810void (\*output_poll_changed)(struct drm_device \*dev);
811This operation notifies the driver that the status of one or more
812connectors has changed. Drivers that use the fb helper can just call the
813:c:func:`drm_fb_helper_hotplug_event()` function to handle this
814operation.
815
816KMS Initialization and Cleanup
817------------------------------
818
819A KMS device is abstracted and exposed as a set of planes, CRTCs,
820encoders and connectors. KMS drivers must thus create and initialize all
821those objects at load time after initializing mode setting.
822
823CRTCs (:c:type:`struct drm_crtc <drm_crtc>`)
824~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
825
826A CRTC is an abstraction representing a part of the chip that contains a
827pointer to a scanout buffer. Therefore, the number of CRTCs available
828determines how many independent scanout buffers can be active at any
829given time. The CRTC structure contains several fields to support this:
830a pointer to some video memory (abstracted as a frame buffer object), a
831display mode, and an (x, y) offset into the video memory to support
832panning or configurations where one piece of video memory spans multiple
833CRTCs.
834
835CRTC Initialization
836^^^^^^^^^^^^^^^^^^^
837
838A KMS device must create and register at least one struct
839:c:type:`struct drm_crtc <drm_crtc>` instance. The instance is
840allocated and zeroed by the driver, possibly as part of a larger
841structure, and registered with a call to :c:func:`drm_crtc_init()`
842with a pointer to CRTC functions.
843
844Planes (:c:type:`struct drm_plane <drm_plane>`)
845~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
846
847A plane represents an image source that can be blended with or overlayed
848on top of a CRTC during the scanout process. Planes are associated with
849a frame buffer to crop a portion of the image memory (source) and
850optionally scale it to a destination size. The result is then blended
851with or overlayed on top of a CRTC.
852
853The DRM core recognizes three types of planes:
854
855- DRM_PLANE_TYPE_PRIMARY represents a "main" plane for a CRTC.
856 Primary planes are the planes operated upon by CRTC modesetting and
857 flipping operations described in the page_flip hook in
858 :c:type:`struct drm_crtc_funcs <drm_crtc_funcs>`.
859- DRM_PLANE_TYPE_CURSOR represents a "cursor" plane for a CRTC.
860 Cursor planes are the planes operated upon by the
861 DRM_IOCTL_MODE_CURSOR and DRM_IOCTL_MODE_CURSOR2 ioctls.
862- DRM_PLANE_TYPE_OVERLAY represents all non-primary, non-cursor
863 planes. Some drivers refer to these types of planes as "sprites"
864 internally.
865
866For compatibility with legacy userspace, only overlay planes are made
867available to userspace by default. Userspace clients may set the
868DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate
869that they wish to receive a universal plane list containing all plane
870types.
871
872Plane Initialization
873^^^^^^^^^^^^^^^^^^^^
874
875To create a plane, a KMS drivers allocates and zeroes an instances of
876:c:type:`struct drm_plane <drm_plane>` (possibly as part of a
877larger structure) and registers it with a call to
878:c:func:`drm_universal_plane_init()`. The function takes a
879bitmask of the CRTCs that can be associated with the plane, a pointer to
880the plane functions, a list of format supported formats, and the type of
881plane (primary, cursor, or overlay) being initialized.
882
883Cursor and overlay planes are optional. All drivers should provide one
884primary plane per CRTC (although this requirement may change in the
885future); drivers that do not wish to provide special handling for
886primary planes may make use of the helper functions described in ? to
887create and register a primary plane with standard capabilities.
888
889Encoders (:c:type:`struct drm_encoder <drm_encoder>`)
890~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
891
892An encoder takes pixel data from a CRTC and converts it to a format
893suitable for any attached connectors. On some devices, it may be
894possible to have a CRTC send data to more than one encoder. In that
895case, both encoders would receive data from the same scanout buffer,
896resulting in a "cloned" display configuration across the connectors
897attached to each encoder.
898
899Encoder Initialization
900^^^^^^^^^^^^^^^^^^^^^^
901
902As for CRTCs, a KMS driver must create, initialize and register at least
903one :c:type:`struct drm_encoder <drm_encoder>` instance. The
904instance is allocated and zeroed by the driver, possibly as part of a
905larger structure.
906
907Drivers must initialize the :c:type:`struct drm_encoder
908<drm_encoder>` possible_crtcs and possible_clones fields before
909registering the encoder. Both fields are bitmasks of respectively the
910CRTCs that the encoder can be connected to, and sibling encoders
911candidate for cloning.
912
913After being initialized, the encoder must be registered with a call to
914:c:func:`drm_encoder_init()`. The function takes a pointer to the
915encoder functions and an encoder type. Supported types are
916
917- DRM_MODE_ENCODER_DAC for VGA and analog on DVI-I/DVI-A
918- DRM_MODE_ENCODER_TMDS for DVI, HDMI and (embedded) DisplayPort
919- DRM_MODE_ENCODER_LVDS for display panels
920- DRM_MODE_ENCODER_TVDAC for TV output (Composite, S-Video,
921 Component, SCART)
922- DRM_MODE_ENCODER_VIRTUAL for virtual machine displays
923
924Encoders must be attached to a CRTC to be used. DRM drivers leave
925encoders unattached at initialization time. Applications (or the fbdev
926compatibility layer when implemented) are responsible for attaching the
927encoders they want to use to a CRTC.
928
929Connectors (:c:type:`struct drm_connector <drm_connector>`)
930~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
931
932A connector is the final destination for pixel data on a device, and
933usually connects directly to an external display device like a monitor
934or laptop panel. A connector can only be attached to one encoder at a
935time. The connector is also the structure where information about the
936attached display is kept, so it contains fields for display data, EDID
937data, DPMS & connection status, and information about modes supported on
938the attached displays.
939
940Connector Initialization
941^^^^^^^^^^^^^^^^^^^^^^^^
942
943Finally a KMS driver must create, initialize, register and attach at
944least one :c:type:`struct drm_connector <drm_connector>`
945instance. The instance is created as other KMS objects and initialized
946by setting the following fields.
947
948interlace_allowed
949 Whether the connector can handle interlaced modes.
950
951doublescan_allowed
952 Whether the connector can handle doublescan.
953
954display_info
955 Display information is filled from EDID information when a display
956 is detected. For non hot-pluggable displays such as flat panels in
957 embedded systems, the driver should initialize the
958 display_info.width_mm and display_info.height_mm fields with the
959 physical size of the display.
960
961polled
962 Connector polling mode, a combination of
963
964 DRM_CONNECTOR_POLL_HPD
965 The connector generates hotplug events and doesn't need to be
966 periodically polled. The CONNECT and DISCONNECT flags must not
967 be set together with the HPD flag.
968
969 DRM_CONNECTOR_POLL_CONNECT
970 Periodically poll the connector for connection.
971
972 DRM_CONNECTOR_POLL_DISCONNECT
973 Periodically poll the connector for disconnection.
974
975 Set to 0 for connectors that don't support connection status
976 discovery.
977
978The connector is then registered with a call to
979:c:func:`drm_connector_init()` with a pointer to the connector
980functions and a connector type, and exposed through sysfs with a call to
981:c:func:`drm_connector_register()`.
982
983Supported connector types are
984
985- DRM_MODE_CONNECTOR_VGA
986- DRM_MODE_CONNECTOR_DVII
987- DRM_MODE_CONNECTOR_DVID
988- DRM_MODE_CONNECTOR_DVIA
989- DRM_MODE_CONNECTOR_Composite
990- DRM_MODE_CONNECTOR_SVIDEO
991- DRM_MODE_CONNECTOR_LVDS
992- DRM_MODE_CONNECTOR_Component
993- DRM_MODE_CONNECTOR_9PinDIN
994- DRM_MODE_CONNECTOR_DisplayPort
995- DRM_MODE_CONNECTOR_HDMIA
996- DRM_MODE_CONNECTOR_HDMIB
997- DRM_MODE_CONNECTOR_TV
998- DRM_MODE_CONNECTOR_eDP
999- DRM_MODE_CONNECTOR_VIRTUAL
1000
1001Connectors must be attached to an encoder to be used. For devices that
1002map connectors to encoders 1:1, the connector should be attached at
1003initialization time with a call to
1004:c:func:`drm_mode_connector_attach_encoder()`. The driver must
1005also set the :c:type:`struct drm_connector <drm_connector>`
1006encoder field to point to the attached encoder.
1007
1008Finally, drivers must initialize the connectors state change detection
1009with a call to :c:func:`drm_kms_helper_poll_init()`. If at least
1010one connector is pollable but can't generate hotplug interrupts
1011(indicated by the DRM_CONNECTOR_POLL_CONNECT and
1012DRM_CONNECTOR_POLL_DISCONNECT connector flags), a delayed work will
1013automatically be queued to periodically poll for changes. Connectors
1014that can generate hotplug interrupts must be marked with the
1015DRM_CONNECTOR_POLL_HPD flag instead, and their interrupt handler must
1016call :c:func:`drm_helper_hpd_irq_event()`. The function will
1017queue a delayed work to check the state of all connectors, but no
1018periodic polling will be done.
1019
1020Connector Operations
1021^^^^^^^^^^^^^^^^^^^^
1022
1023 **Note**
1024
1025 Unless otherwise state, all operations are mandatory.
1026
1027DPMS
1028''''
1029
1030void (\*dpms)(struct drm_connector \*connector, int mode);
1031The DPMS operation sets the power state of a connector. The mode
1032argument is one of
1033
1034- DRM_MODE_DPMS_ON
1035
1036- DRM_MODE_DPMS_STANDBY
1037
1038- DRM_MODE_DPMS_SUSPEND
1039
1040- DRM_MODE_DPMS_OFF
1041
1042In all but DPMS_ON mode the encoder to which the connector is attached
1043should put the display in low-power mode by driving its signals
1044appropriately. If more than one connector is attached to the encoder
1045care should be taken not to change the power state of other displays as
1046a side effect. Low-power mode should be propagated to the encoders and
1047CRTCs when all related connectors are put in low-power mode.
1048
1049Modes
1050'''''
1051
1052int (\*fill_modes)(struct drm_connector \*connector, uint32_t
1053max_width, uint32_t max_height);
1054Fill the mode list with all supported modes for the connector. If the
1055``max_width`` and ``max_height`` arguments are non-zero, the
1056implementation must ignore all modes wider than ``max_width`` or higher
1057than ``max_height``.
1058
1059The connector must also fill in this operation its display_info
1060width_mm and height_mm fields with the connected display physical size
1061in millimeters. The fields should be set to 0 if the value isn't known
1062or is not applicable (for instance for projector devices).
1063
1064Connection Status
1065'''''''''''''''''
1066
1067The connection status is updated through polling or hotplug events when
1068supported (see ?). The status value is reported to userspace through
1069ioctls and must not be used inside the driver, as it only gets
1070initialized by a call to :c:func:`drm_mode_getconnector()` from
1071userspace.
1072
1073enum drm_connector_status (\*detect)(struct drm_connector
1074\*connector, bool force);
1075Check to see if anything is attached to the connector. The ``force``
1076parameter is set to false whilst polling or to true when checking the
1077connector due to user request. ``force`` can be used by the driver to
1078avoid expensive, destructive operations during automated probing.
1079
1080Return connector_status_connected if something is connected to the
1081connector, connector_status_disconnected if nothing is connected and
1082connector_status_unknown if the connection state isn't known.
1083
1084Drivers should only return connector_status_connected if the
1085connection status has really been probed as connected. Connectors that
1086can't detect the connection status, or failed connection status probes,
1087should return connector_status_unknown.
1088
1089Cleanup
1090~~~~~~~
1091
1092The DRM core manages its objects' lifetime. When an object is not needed
1093anymore the core calls its destroy function, which must clean up and
1094free every resource allocated for the object. Every
1095:c:func:`drm_\*_init()` call must be matched with a corresponding
1096:c:func:`drm_\*_cleanup()` call to cleanup CRTCs
1097(:c:func:`drm_crtc_cleanup()`), planes
1098(:c:func:`drm_plane_cleanup()`), encoders
1099(:c:func:`drm_encoder_cleanup()`) and connectors
1100(:c:func:`drm_connector_cleanup()`). Furthermore, connectors that
1101have been added to sysfs must be removed by a call to
1102:c:func:`drm_connector_unregister()` before calling
1103:c:func:`drm_connector_cleanup()`.
1104
1105Connectors state change detection must be cleanup up with a call to
1106:c:func:`drm_kms_helper_poll_fini()`.
1107
1108Output discovery and initialization example
1109~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1110
1111::
1112
1113 void intel_crt_init(struct drm_device *dev)
1114 {
1115 struct drm_connector *connector;
1116 struct intel_output *intel_output;
1117
1118 intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
1119 if (!intel_output)
1120 return;
1121
1122 connector = &intel_output->base;
1123 drm_connector_init(dev, &intel_output->base,
1124 &intel_crt_connector_funcs, DRM_MODE_CONNECTOR_VGA);
1125
1126 drm_encoder_init(dev, &intel_output->enc, &intel_crt_enc_funcs,
1127 DRM_MODE_ENCODER_DAC);
1128
1129 drm_mode_connector_attach_encoder(&intel_output->base,
1130 &intel_output->enc);
1131
1132 /* Set up the DDC bus. */
1133 intel_output->ddc_bus = intel_i2c_create(dev, GPIOA, "CRTDDC_A");
1134 if (!intel_output->ddc_bus) {
1135 dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
1136 "failed.\n");
1137 return;
1138 }
1139
1140 intel_output->type = INTEL_OUTPUT_ANALOG;
1141 connector->interlace_allowed = 0;
1142 connector->doublescan_allowed = 0;
1143
1144 drm_encoder_helper_add(&intel_output->enc, &intel_crt_helper_funcs);
1145 drm_connector_helper_add(connector, &intel_crt_connector_helper_funcs);
1146
1147 drm_connector_register(connector);
1148 }
1149
1150In the example above (taken from the i915 driver), a CRTC, connector and
1151encoder combination is created. A device-specific i2c bus is also
1152created for fetching EDID data and performing monitor detection. Once
1153the process is complete, the new connector is registered with sysfs to
1154make its properties available to applications.
1155
1156KMS API Functions
1157~~~~~~~~~~~~~~~~~
1158
1159.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
1160 :export:
1161
1162KMS Data Structures
1163~~~~~~~~~~~~~~~~~~~
1164
1165.. kernel-doc:: include/drm/drm_crtc.h
1166 :internal:
1167
1168KMS Locking
1169~~~~~~~~~~~
1170
1171.. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c
1172 :doc: kms locking
1173
1174.. kernel-doc:: include/drm/drm_modeset_lock.h
1175 :internal:
1176
1177.. kernel-doc:: drivers/gpu/drm/drm_modeset_lock.c
1178 :export:
1179
1180Mode Setting Helper Functions
1181-----------------------------
1182
1183The plane, CRTC, encoder and connector functions provided by the drivers
1184implement the DRM API. They're called by the DRM core and ioctl handlers
1185to handle device state changes and configuration request. As
1186implementing those functions often requires logic not specific to
1187drivers, mid-layer helper functions are available to avoid duplicating
1188boilerplate code.
1189
1190The DRM core contains one mid-layer implementation. The mid-layer
1191provides implementations of several plane, CRTC, encoder and connector
1192functions (called from the top of the mid-layer) that pre-process
1193requests and call lower-level functions provided by the driver (at the
1194bottom of the mid-layer). For instance, the
1195:c:func:`drm_crtc_helper_set_config()` function can be used to
1196fill the :c:type:`struct drm_crtc_funcs <drm_crtc_funcs>`
1197set_config field. When called, it will split the set_config operation
1198in smaller, simpler operations and call the driver to handle them.
1199
1200To use the mid-layer, drivers call
1201:c:func:`drm_crtc_helper_add()`,
1202:c:func:`drm_encoder_helper_add()` and
1203:c:func:`drm_connector_helper_add()` functions to install their
1204mid-layer bottom operations handlers, and fill the :c:type:`struct
1205drm_crtc_funcs <drm_crtc_funcs>`, :c:type:`struct
1206drm_encoder_funcs <drm_encoder_funcs>` and :c:type:`struct
1207drm_connector_funcs <drm_connector_funcs>` structures with
1208pointers to the mid-layer top API functions. Installing the mid-layer
1209bottom operation handlers is best done right after registering the
1210corresponding KMS object.
1211
1212The mid-layer is not split between CRTC, encoder and connector
1213operations. To use it, a driver must provide bottom functions for all of
1214the three KMS entities.
1215
1216Atomic Modeset Helper Functions Reference
1217~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1218
1219Overview
1220^^^^^^^^
1221
1222.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
1223 :doc: overview
1224
1225Implementing Asynchronous Atomic Commit
1226^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1227
1228.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
1229 :doc: implementing nonblocking commit
1230
1231Atomic State Reset and Initialization
1232^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1233
1234.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
1235 :doc: atomic state reset and initialization
1236
1237.. kernel-doc:: include/drm/drm_atomic_helper.h
1238 :internal:
1239
1240.. kernel-doc:: drivers/gpu/drm/drm_atomic_helper.c
1241 :export:
1242
1243Modeset Helper Reference for Common Vtables
1244~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1245
1246.. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
1247 :internal:
1248
1249.. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
1250 :doc: overview
1251
1252Legacy CRTC/Modeset Helper Functions Reference
1253~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1254
1255.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
1256 :export:
1257
1258.. kernel-doc:: drivers/gpu/drm/drm_crtc_helper.c
1259 :doc: overview
1260
1261Output Probing Helper Functions Reference
1262~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1263
1264.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
1265 :doc: output probing helper overview
1266
1267.. kernel-doc:: drivers/gpu/drm/drm_probe_helper.c
1268 :export:
1269
1270fbdev Helper Functions Reference
1271~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1272
1273.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
1274 :doc: fbdev helpers
1275
1276.. kernel-doc:: drivers/gpu/drm/drm_fb_helper.c
1277 :export:
1278
1279.. kernel-doc:: include/drm/drm_fb_helper.h
1280 :internal:
1281
1282Framebuffer CMA Helper Functions Reference
1283~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1284
1285.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
1286 :doc: framebuffer cma helper functions
1287
1288.. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
1289 :export:
1290
1291Display Port Helper Functions Reference
1292~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1293
1294.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
1295 :doc: dp helpers
1296
1297.. kernel-doc:: include/drm/drm_dp_helper.h
1298 :internal:
1299
1300.. kernel-doc:: drivers/gpu/drm/drm_dp_helper.c
1301 :export:
1302
1303Display Port Dual Mode Adaptor Helper Functions Reference
1304~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1305
1306.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
1307 :doc: dp dual mode helpers
1308
1309.. kernel-doc:: include/drm/drm_dp_dual_mode_helper.h
1310 :internal:
1311
1312.. kernel-doc:: drivers/gpu/drm/drm_dp_dual_mode_helper.c
1313 :export:
1314
1315Display Port MST Helper Functions Reference
1316~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1317
1318.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
1319 :doc: dp mst helper
1320
1321.. kernel-doc:: include/drm/drm_dp_mst_helper.h
1322 :internal:
1323
1324.. kernel-doc:: drivers/gpu/drm/drm_dp_mst_topology.c
1325 :export:
1326
1327MIPI DSI Helper Functions Reference
1328~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1329
1330.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
1331 :doc: dsi helpers
1332
1333.. kernel-doc:: include/drm/drm_mipi_dsi.h
1334 :internal:
1335
1336.. kernel-doc:: drivers/gpu/drm/drm_mipi_dsi.c
1337 :export:
1338
1339EDID Helper Functions Reference
1340~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1341
1342.. kernel-doc:: drivers/gpu/drm/drm_edid.c
1343 :export:
1344
1345Rectangle Utilities Reference
1346~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1347
1348.. kernel-doc:: include/drm/drm_rect.h
1349 :doc: rect utils
1350
1351.. kernel-doc:: include/drm/drm_rect.h
1352 :internal:
1353
1354.. kernel-doc:: drivers/gpu/drm/drm_rect.c
1355 :export:
1356
1357Flip-work Helper Reference
1358~~~~~~~~~~~~~~~~~~~~~~~~~~
1359
1360.. kernel-doc:: include/drm/drm_flip_work.h
1361 :doc: flip utils
1362
1363.. kernel-doc:: include/drm/drm_flip_work.h
1364 :internal:
1365
1366.. kernel-doc:: drivers/gpu/drm/drm_flip_work.c
1367 :export:
1368
1369HDMI Infoframes Helper Reference
1370~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1371
1372Strictly speaking this is not a DRM helper library but generally useable
1373by any driver interfacing with HDMI outputs like v4l or alsa drivers.
1374But it nicely fits into the overall topic of mode setting helper
1375libraries and hence is also included here.
1376
1377.. kernel-doc:: include/linux/hdmi.h
1378 :internal:
1379
1380.. kernel-doc:: drivers/video/hdmi.c
1381 :export:
1382
1383Plane Helper Reference
1384~~~~~~~~~~~~~~~~~~~~~~
1385
1386.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
1387 :export:
1388
1389.. kernel-doc:: drivers/gpu/drm/drm_plane_helper.c
1390 :doc: overview
1391
1392Tile group
1393~~~~~~~~~~
1394
1395.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
1396 :doc: Tile group
1397
1398Bridges
1399~~~~~~~
1400
1401Overview
1402^^^^^^^^
1403
1404.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
1405 :doc: overview
1406
1407Default bridge callback sequence
1408^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1409
1410.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
1411 :doc: bridge callbacks
1412
1413.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
1414 :export:
1415
1416Panel Helper Reference
1417~~~~~~~~~~~~~~~~~~~~~~
1418
1419.. kernel-doc:: include/drm/drm_panel.h
1420 :internal:
1421
1422.. kernel-doc:: drivers/gpu/drm/drm_panel.c
1423 :export:
1424
1425.. kernel-doc:: drivers/gpu/drm/drm_panel.c
1426 :doc: drm panel
1427
1428Simple KMS Helper Reference
1429~~~~~~~~~~~~~~~~~~~~~~~~~~~
1430
1431.. kernel-doc:: include/drm/drm_simple_kms_helper.h
1432 :internal:
1433
1434.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
1435 :export:
1436
1437.. kernel-doc:: drivers/gpu/drm/drm_simple_kms_helper.c
1438 :doc: overview
1439
1440KMS Properties
1441--------------
1442
1443Drivers may need to expose additional parameters to applications than
1444those described in the previous sections. KMS supports attaching
1445properties to CRTCs, connectors and planes and offers a userspace API to
1446list, get and set the property values.
1447
1448Properties are identified by a name that uniquely defines the property
1449purpose, and store an associated value. For all property types except
1450blob properties the value is a 64-bit unsigned integer.
1451
1452KMS differentiates between properties and property instances. Drivers
1453first create properties and then create and associate individual
1454instances of those properties to objects. A property can be instantiated
1455multiple times and associated with different objects. Values are stored
1456in property instances, and all other property information are stored in
1457the property and shared between all instances of the property.
1458
1459Every property is created with a type that influences how the KMS core
1460handles the property. Supported property types are
1461
1462DRM_MODE_PROP_RANGE
1463 Range properties report their minimum and maximum admissible values.
1464 The KMS core verifies that values set by application fit in that
1465 range.
1466
1467DRM_MODE_PROP_ENUM
1468 Enumerated properties take a numerical value that ranges from 0 to
1469 the number of enumerated values defined by the property minus one,
1470 and associate a free-formed string name to each value. Applications
1471 can retrieve the list of defined value-name pairs and use the
1472 numerical value to get and set property instance values.
1473
1474DRM_MODE_PROP_BITMASK
1475 Bitmask properties are enumeration properties that additionally
1476 restrict all enumerated values to the 0..63 range. Bitmask property
1477 instance values combine one or more of the enumerated bits defined
1478 by the property.
1479
1480DRM_MODE_PROP_BLOB
1481 Blob properties store a binary blob without any format restriction.
1482 The binary blobs are created as KMS standalone objects, and blob
1483 property instance values store the ID of their associated blob
1484 object.
1485
1486 Blob properties are only used for the connector EDID property and
1487 cannot be created by drivers.
1488
1489To create a property drivers call one of the following functions
1490depending on the property type. All property creation functions take
1491property flags and name, as well as type-specific arguments.
1492
1493- struct drm_property \*drm_property_create_range(struct
1494 drm_device \*dev, int flags, const char \*name, uint64_t min,
1495 uint64_t max);
1496 Create a range property with the given minimum and maximum values.
1497
1498- struct drm_property \*drm_property_create_enum(struct drm_device
1499 \*dev, int flags, const char \*name, const struct
1500 drm_prop_enum_list \*props, int num_values);
1501 Create an enumerated property. The ``props`` argument points to an
1502 array of ``num_values`` value-name pairs.
1503
1504- struct drm_property \*drm_property_create_bitmask(struct
1505 drm_device \*dev, int flags, const char \*name, const struct
1506 drm_prop_enum_list \*props, int num_values);
1507 Create a bitmask property. The ``props`` argument points to an array
1508 of ``num_values`` value-name pairs.
1509
1510Properties can additionally be created as immutable, in which case they
1511will be read-only for applications but can be modified by the driver. To
1512create an immutable property drivers must set the
1513DRM_MODE_PROP_IMMUTABLE flag at property creation time.
1514
1515When no array of value-name pairs is readily available at property
1516creation time for enumerated or range properties, drivers can create the
1517property using the :c:func:`drm_property_create()` function and
1518manually add enumeration value-name pairs by calling the
1519:c:func:`drm_property_add_enum()` function. Care must be taken to
1520properly specify the property type through the ``flags`` argument.
1521
1522After creating properties drivers can attach property instances to CRTC,
1523connector and plane objects by calling the
1524:c:func:`drm_object_attach_property()`. The function takes a
1525pointer to the target object, a pointer to the previously created
1526property and an initial instance value.
1527
1528Existing KMS Properties
1529~~~~~~~~~~~~~~~~~~~~~~~
1530
1531The following table gives description of drm properties exposed by
1532various modules/drivers.
1533
1534+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1535| Owner Module/Drivers | Group | Property Name | Type | Property Values | Object attached | Description/Restrictions |
1536+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1537| DRM | Generic | “rotation” | BITMASK | { 0, "rotate-0" }, { 1, "rotate-90" }, { 2, "rotate-180" }, { 3, "rotate-270" }, { 4, "reflect-x" }, { 5, "reflect-y" } | CRTC, Plane | rotate-(degrees) rotates the image by the specified amount in degrees in counter clockwise direction. reflect-x and reflect-y reflects the image along the specified axis prior to rotation |
1538+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1539| “scaling mode” | ENUM | { "None", "Full", "Center", "Full aspect" } | Connector | Supported by: amdgpu, gma500, i915, nouveau and radeon. |
1540+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1541| Connector | “EDID” | BLOB \| IMMUTABLE | 0 | Connector | Contains id of edid blob ptr object. |
1542+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1543| “DPMS” | ENUM | { “On”, “Standby”, “Suspend”, “Off” } | Connector | Contains DPMS operation mode value. |
1544+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1545| “PATH” | BLOB \| IMMUTABLE | 0 | Connector | Contains topology path to a connector. |
1546+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1547| “TILE” | BLOB \| IMMUTABLE | 0 | Connector | Contains tiling information for a connector. |
1548+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1549| “CRTC_ID” | OBJECT | DRM_MODE_OBJECT_CRTC | Connector | CRTC that connector is attached to (atomic) |
1550+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1551| Plane | “type” | ENUM \| IMMUTABLE | { "Overlay", "Primary", "Cursor" } | Plane | Plane type |
1552+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1553| “SRC_X” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout source x coordinate in 16.16 fixed point (atomic) |
1554+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1555| “SRC_Y” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout source y coordinate in 16.16 fixed point (atomic) |
1556+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1557| “SRC_W” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout source width in 16.16 fixed point (atomic) |
1558+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1559| “SRC_H” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout source height in 16.16 fixed point (atomic) |
1560+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1561| “CRTC_X” | SIGNED_RANGE | Min=INT_MIN, Max=INT_MAX | Plane | Scanout CRTC (destination) x coordinate (atomic) |
1562+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1563| “CRTC_Y” | SIGNED_RANGE | Min=INT_MIN, Max=INT_MAX | Plane | Scanout CRTC (destination) y coordinate (atomic) |
1564+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1565| “CRTC_W” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout CRTC (destination) width (atomic) |
1566+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1567| “CRTC_H” | RANGE | Min=0, Max=UINT_MAX | Plane | Scanout CRTC (destination) height (atomic) |
1568+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1569| “FB_ID” | OBJECT | DRM_MODE_OBJECT_FB | Plane | Scanout framebuffer (atomic) |
1570+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1571| “CRTC_ID” | OBJECT | DRM_MODE_OBJECT_CRTC | Plane | CRTC that plane is attached to (atomic) |
1572+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1573| DVI-I | “subconnector” | ENUM | { “Unknown”, “DVI-D”, “DVI-A” } | Connector | TBD |
1574+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1575| “select subconnector” | ENUM | { “Automatic”, “DVI-D”, “DVI-A” } | Connector | TBD |
1576+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1577| TV | “subconnector” | ENUM | { "Unknown", "Composite", "SVIDEO", "Component", "SCART" } | Connector | TBD |
1578+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1579| “select subconnector” | ENUM | { "Automatic", "Composite", "SVIDEO", "Component", "SCART" } | Connector | TBD |
1580+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1581| “mode” | ENUM | { "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc. | Connector | TBD |
1582+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1583| “left margin” | RANGE | Min=0, Max=100 | Connector | TBD |
1584+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1585| “right margin” | RANGE | Min=0, Max=100 | Connector | TBD |
1586+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1587| “top margin” | RANGE | Min=0, Max=100 | Connector | TBD |
1588+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1589| “bottom margin” | RANGE | Min=0, Max=100 | Connector | TBD |
1590+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1591| “brightness” | RANGE | Min=0, Max=100 | Connector | TBD |
1592+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1593| “contrast” | RANGE | Min=0, Max=100 | Connector | TBD |
1594+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1595| “flicker reduction” | RANGE | Min=0, Max=100 | Connector | TBD |
1596+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1597| “overscan” | RANGE | Min=0, Max=100 | Connector | TBD |
1598+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1599| “saturation” | RANGE | Min=0, Max=100 | Connector | TBD |
1600+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1601| “hue” | RANGE | Min=0, Max=100 | Connector | TBD |
1602+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1603| Virtual GPU | “suggested X” | RANGE | Min=0, Max=0xffffffff | Connector | property to suggest an X offset for a connector |
1604+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1605| “suggested Y” | RANGE | Min=0, Max=0xffffffff | Connector | property to suggest an Y offset for a connector |
1606+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1607| Optional | "aspect ratio" | ENUM | { "None", "4:3", "16:9" } | Connector | TDB |
1608+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1609| “dirty” | ENUM \| IMMUTABLE | { "Off", "On", "Annotate" } | Connector | TBD |
1610+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1611| “DEGAMMA_LUT” | BLOB | 0 | CRTC | DRM property to set the degamma lookup table (LUT) mapping pixel data from the framebuffer before it is given to the transformation matrix. The data is an interpreted as an array of struct drm_color_lut elements. Hardware might choose not to use the full precision of the LUT elements nor use all the elements of the LUT (for example the hardware might choose to interpolate between LUT[0] and LUT[4]). |
1612+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1613| “DEGAMMA_LUT_SIZE” | RANGE \| IMMUTABLE | Min=0, Max=UINT_MAX | CRTC | DRM property to gives the size of the lookup table to be set on the DEGAMMA_LUT property (the size depends on the underlying hardware). |
1614+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1615| “CTM” | BLOB | 0 | CRTC | DRM property to set the current transformation matrix (CTM) apply to pixel data after the lookup through the degamma LUT and before the lookup through the gamma LUT. The data is an interpreted as a struct drm_color_ctm. |
1616+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1617| “GAMMA_LUT” | BLOB | 0 | CRTC | DRM property to set the gamma lookup table (LUT) mapping pixel data after to the transformation matrix to data sent to the connector. The data is an interpreted as an array of struct drm_color_lut elements. Hardware might choose not to use the full precision of the LUT elements nor use all the elements of the LUT (for example the hardware might choose to interpolate between LUT[0] and LUT[4]). |
1618+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1619| “GAMMA_LUT_SIZE” | RANGE \| IMMUTABLE | Min=0, Max=UINT_MAX | CRTC | DRM property to gives the size of the lookup table to be set on the GAMMA_LUT property (the size depends on the underlying hardware). |
1620+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1621| i915 | Generic | "Broadcast RGB" | ENUM | { "Automatic", "Full", "Limited 16:235" } | Connector | When this property is set to Limited 16:235 and CTM is set, the hardware will be programmed with the result of the multiplication of CTM by the limited range matrix to ensure the pixels normaly in the range 0..1.0 are remapped to the range 16/255..235/255. |
1622+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1623| “audio” | ENUM | { "force-dvi", "off", "auto", "on" } | Connector | TBD |
1624+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1625| SDVO-TV | “mode” | ENUM | { "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc. | Connector | TBD |
1626+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1627| "left_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1628+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1629| "right_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1630+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1631| "top_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1632+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1633| "bottom_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1634+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1635| “hpos” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1636+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1637| “vpos” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1638+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1639| “contrast” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1640+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1641| “saturation” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1642+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1643| “hue” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1644+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1645| “sharpness” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1646+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1647| “flicker_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1648+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1649| “flicker_filter_adaptive” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1650+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1651| “flicker_filter_2d” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1652+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1653| “tv_chroma_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1654+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1655| “tv_luma_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1656+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1657| “dot_crawl” | RANGE | Min=0, Max=1 | Connector | TBD |
1658+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1659| SDVO-TV/LVDS | “brightness” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1660+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1661| CDV gma-500 | Generic | "Broadcast RGB" | ENUM | { “Full”, “Limited 16:235” } | Connector | TBD |
1662+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1663| "Broadcast RGB" | ENUM | { “off”, “auto”, “on” } | Connector | TBD |
1664+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1665| Poulsbo | Generic | “backlight” | RANGE | Min=0, Max=100 | Connector | TBD |
1666+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1667| SDVO-TV | “mode” | ENUM | { "NTSC_M", "NTSC_J", "NTSC_443", "PAL_B" } etc. | Connector | TBD |
1668+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1669| "left_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1670+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1671| "right_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1672+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1673| "top_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1674+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1675| "bottom_margin" | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1676+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1677| “hpos” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1678+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1679| “vpos” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1680+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1681| “contrast” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1682+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1683| “saturation” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1684+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1685| “hue” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1686+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1687| “sharpness” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1688+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1689| “flicker_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1690+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1691| “flicker_filter_adaptive” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1692+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1693| “flicker_filter_2d” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1694+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1695| “tv_chroma_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1696+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1697| “tv_luma_filter” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1698+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1699| “dot_crawl” | RANGE | Min=0, Max=1 | Connector | TBD |
1700+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1701| SDVO-TV/LVDS | “brightness” | RANGE | Min=0, Max= SDVO dependent | Connector | TBD |
1702+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1703| armada | CRTC | "CSC_YUV" | ENUM | { "Auto" , "CCIR601", "CCIR709" } | CRTC | TBD |
1704+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1705| "CSC_RGB" | ENUM | { "Auto", "Computer system", "Studio" } | CRTC | TBD |
1706+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1707| Overlay | "colorkey" | RANGE | Min=0, Max=0xffffff | Plane | TBD |
1708+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1709| "colorkey_min" | RANGE | Min=0, Max=0xffffff | Plane | TBD |
1710+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1711| "colorkey_max" | RANGE | Min=0, Max=0xffffff | Plane | TBD |
1712+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1713| "colorkey_val" | RANGE | Min=0, Max=0xffffff | Plane | TBD |
1714+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1715| "colorkey_alpha" | RANGE | Min=0, Max=0xffffff | Plane | TBD |
1716+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1717| "colorkey_mode" | ENUM | { "disabled", "Y component", "U component" , "V component", "RGB", “R component", "G component", "B component" } | Plane | TBD |
1718+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1719| "brightness" | RANGE | Min=0, Max=256 + 255 | Plane | TBD |
1720+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1721| "contrast" | RANGE | Min=0, Max=0x7fff | Plane | TBD |
1722+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1723| "saturation" | RANGE | Min=0, Max=0x7fff | Plane | TBD |
1724+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1725| exynos | CRTC | “mode” | ENUM | { "normal", "blank" } | CRTC | TBD |
1726+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1727| Overlay | “zpos” | RANGE | Min=0, Max=MAX_PLANE-1 | Plane | TBD |
1728+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1729| i2c/ch7006_drv | Generic | “scale” | RANGE | Min=0, Max=2 | Connector | TBD |
1730+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1731| TV | “mode” | ENUM | { "PAL", "PAL-M","PAL-N"}, ”PAL-Nc" , "PAL-60", "NTSC-M", "NTSC-J" } | Connector | TBD |
1732+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1733| nouveau | NV10 Overlay | "colorkey" | RANGE | Min=0, Max=0x01ffffff | Plane | TBD |
1734+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1735| “contrast” | RANGE | Min=0, Max=8192-1 | Plane | TBD |
1736+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1737| “brightness” | RANGE | Min=0, Max=1024 | Plane | TBD |
1738+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1739| “hue” | RANGE | Min=0, Max=359 | Plane | TBD |
1740+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1741| “saturation” | RANGE | Min=0, Max=8192-1 | Plane | TBD |
1742+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1743| “iturbt_709” | RANGE | Min=0, Max=1 | Plane | TBD |
1744+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1745| Nv04 Overlay | “colorkey” | RANGE | Min=0, Max=0x01ffffff | Plane | TBD |
1746+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1747| “brightness” | RANGE | Min=0, Max=1024 | Plane | TBD |
1748+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1749| Display | “dithering mode” | ENUM | { "auto", "off", "on" } | Connector | TBD |
1750+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1751| “dithering depth” | ENUM | { "auto", "off", "on", "static 2x2", "dynamic 2x2", "temporal" } | Connector | TBD |
1752+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1753| “underscan” | ENUM | { "auto", "6 bpc", "8 bpc" } | Connector | TBD |
1754+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1755| “underscan hborder” | RANGE | Min=0, Max=128 | Connector | TBD |
1756+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1757| “underscan vborder” | RANGE | Min=0, Max=128 | Connector | TBD |
1758+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1759| “vibrant hue” | RANGE | Min=0, Max=180 | Connector | TBD |
1760+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1761| “color vibrance” | RANGE | Min=0, Max=200 | Connector | TBD |
1762+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1763| omap | Generic | “zorder” | RANGE | Min=0, Max=3 | CRTC, Plane | TBD |
1764+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1765| qxl | Generic | “hotplug_mode_update" | RANGE | Min=0, Max=1 | Connector | TBD |
1766+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1767| radeon | DVI-I | “coherent” | RANGE | Min=0, Max=1 | Connector | TBD |
1768+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1769| DAC enable load detect | “load detection” | RANGE | Min=0, Max=1 | Connector | TBD |
1770+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1771| TV Standard | "tv standard" | ENUM | { "ntsc", "pal", "pal-m", "pal-60", "ntsc-j" , "scart-pal", "pal-cn", "secam" } | Connector | TBD |
1772+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1773| legacy TMDS PLL detect | "tmds_pll" | ENUM | { "driver", "bios" } | - | TBD |
1774+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1775| Underscan | "underscan" | ENUM | { "off", "on", "auto" } | Connector | TBD |
1776+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1777| "underscan hborder" | RANGE | Min=0, Max=128 | Connector | TBD |
1778+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1779| "underscan vborder" | RANGE | Min=0, Max=128 | Connector | TBD |
1780+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1781| Audio | “audio” | ENUM | { "off", "on", "auto" } | Connector | TBD |
1782+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1783| FMT Dithering | “dither” | ENUM | { "off", "on" } | Connector | TBD |
1784+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1785| rcar-du | Generic | "alpha" | RANGE | Min=0, Max=255 | Plane | TBD |
1786+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1787| "colorkey" | RANGE | Min=0, Max=0x01ffffff | Plane | TBD |
1788+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1789| "zpos" | RANGE | Min=1, Max=7 | Plane | TBD |
1790+-------------------------------+----------------------+--------------------------------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1791
1792Vertical Blanking
1793-----------------
1794
1795Vertical blanking plays a major role in graphics rendering. To achieve
1796tear-free display, users must synchronize page flips and/or rendering to
1797vertical blanking. The DRM API offers ioctls to perform page flips
1798synchronized to vertical blanking and wait for vertical blanking.
1799
1800The DRM core handles most of the vertical blanking management logic,
1801which involves filtering out spurious interrupts, keeping race-free
1802blanking counters, coping with counter wrap-around and resets and
1803keeping use counts. It relies on the driver to generate vertical
1804blanking interrupts and optionally provide a hardware vertical blanking
1805counter. Drivers must implement the following operations.
1806
1807- int (\*enable_vblank) (struct drm_device \*dev, int crtc); void
1808 (\*disable_vblank) (struct drm_device \*dev, int crtc);
1809 Enable or disable vertical blanking interrupts for the given CRTC.
1810
1811- u32 (\*get_vblank_counter) (struct drm_device \*dev, int crtc);
1812 Retrieve the value of the vertical blanking counter for the given
1813 CRTC. If the hardware maintains a vertical blanking counter its value
1814 should be returned. Otherwise drivers can use the
1815 :c:func:`drm_vblank_count()` helper function to handle this
1816 operation.
1817
1818Drivers must initialize the vertical blanking handling core with a call
1819to :c:func:`drm_vblank_init()` in their load operation.
1820
1821Vertical blanking interrupts can be enabled by the DRM core or by
1822drivers themselves (for instance to handle page flipping operations).
1823The DRM core maintains a vertical blanking use count to ensure that the
1824interrupts are not disabled while a user still needs them. To increment
1825the use count, drivers call :c:func:`drm_vblank_get()`. Upon
1826return vertical blanking interrupts are guaranteed to be enabled.
1827
1828To decrement the use count drivers call
1829:c:func:`drm_vblank_put()`. Only when the use count drops to zero
1830will the DRM core disable the vertical blanking interrupts after a delay
1831by scheduling a timer. The delay is accessible through the
1832vblankoffdelay module parameter or the ``drm_vblank_offdelay`` global
1833variable and expressed in milliseconds. Its default value is 5000 ms.
1834Zero means never disable, and a negative value means disable
1835immediately. Drivers may override the behaviour by setting the
1836:c:type:`struct drm_device <drm_device>`
1837vblank_disable_immediate flag, which when set causes vblank interrupts
1838to be disabled immediately regardless of the drm_vblank_offdelay
1839value. The flag should only be set if there's a properly working
1840hardware vblank counter present.
1841
1842When a vertical blanking interrupt occurs drivers only need to call the
1843:c:func:`drm_handle_vblank()` function to account for the
1844interrupt.
1845
1846Resources allocated by :c:func:`drm_vblank_init()` must be freed
1847with a call to :c:func:`drm_vblank_cleanup()` in the driver unload
1848operation handler.
1849
1850Vertical Blanking and Interrupt Handling Functions Reference
1851~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1852
1853.. kernel-doc:: drivers/gpu/drm/drm_irq.c
1854 :export:
1855
1856.. kernel-doc:: include/drm/drmP.h
1857 :functions: drm_crtc_vblank_waitqueue
1858
1859Open/Close, File Operations and IOCTLs
1860--------------------------------------
1861
1862Open and Close
1863~~~~~~~~~~~~~~
1864
1865int (\*firstopen) (struct drm_device \*); void (\*lastclose) (struct
1866drm_device \*); int (\*open) (struct drm_device \*, struct drm_file
1867\*); void (\*preclose) (struct drm_device \*, struct drm_file \*);
1868void (\*postclose) (struct drm_device \*, struct drm_file \*);
1869 Open and close handlers. None of those methods are mandatory.
1870
1871The firstopen method is called by the DRM core for legacy UMS (User Mode
1872Setting) drivers only when an application opens a device that has no
1873other opened file handle. UMS drivers can implement it to acquire device
1874resources. KMS drivers can't use the method and must acquire resources
1875in the load method instead.
1876
1877Similarly the lastclose method is called when the last application
1878holding a file handle opened on the device closes it, for both UMS and
1879KMS drivers. Additionally, the method is also called at module unload
1880time or, for hot-pluggable devices, when the device is unplugged. The
1881firstopen and lastclose calls can thus be unbalanced.
1882
1883The open method is called every time the device is opened by an
1884application. Drivers can allocate per-file private data in this method
1885and store them in the struct :c:type:`struct drm_file
1886<drm_file>` driver_priv field. Note that the open method is
1887called before firstopen.
1888
1889The close operation is split into preclose and postclose methods.
1890Drivers must stop and cleanup all per-file operations in the preclose
1891method. For instance pending vertical blanking and page flip events must
1892be cancelled. No per-file operation is allowed on the file handle after
1893returning from the preclose method.
1894
1895Finally the postclose method is called as the last step of the close
1896operation, right before calling the lastclose method if no other open
1897file handle exists for the device. Drivers that have allocated per-file
1898private data in the open method should free it here.
1899
1900The lastclose method should restore CRTC and plane properties to default
1901value, so that a subsequent open of the device will not inherit state
1902from the previous user. It can also be used to execute delayed power
1903switching state changes, e.g. in conjunction with the vga_switcheroo
1904infrastructure (see ?). Beyond that KMS drivers should not do any
1905further cleanup. Only legacy UMS drivers might need to clean up device
1906state so that the vga console or an independent fbdev driver could take
1907over.
1908
1909File Operations
1910~~~~~~~~~~~~~~~
1911
1912.. kernel-doc:: drivers/gpu/drm/drm_fops.c
1913 :doc: file operations
1914
1915.. kernel-doc:: drivers/gpu/drm/drm_fops.c
1916 :export:
1917
1918IOCTLs
1919~~~~~~
1920
1921struct drm_ioctl_desc \*ioctls; int num_ioctls;
1922 Driver-specific ioctls descriptors table.
1923
1924Driver-specific ioctls numbers start at DRM_COMMAND_BASE. The ioctls
1925descriptors table is indexed by the ioctl number offset from the base
1926value. Drivers can use the DRM_IOCTL_DEF_DRV() macro to initialize
1927the table entries.
1928
1929::
1930
1931 DRM_IOCTL_DEF_DRV(ioctl, func, flags)
1932
1933``ioctl`` is the ioctl name. Drivers must define the DRM_##ioctl and
1934DRM_IOCTL_##ioctl macros to the ioctl number offset from
1935DRM_COMMAND_BASE and the ioctl number respectively. The first macro is
1936private to the device while the second must be exposed to userspace in a
1937public header.
1938
1939``func`` is a pointer to the ioctl handler function compatible with the
1940``drm_ioctl_t`` type.
1941
1942::
1943
1944 typedef int drm_ioctl_t(struct drm_device *dev, void *data,
1945 struct drm_file *file_priv);
1946
1947``flags`` is a bitmask combination of the following values. It restricts
1948how the ioctl is allowed to be called.
1949
1950- DRM_AUTH - Only authenticated callers allowed
1951
1952- DRM_MASTER - The ioctl can only be called on the master file handle
1953
1954- DRM_ROOT_ONLY - Only callers with the SYSADMIN capability allowed
1955
1956- DRM_CONTROL_ALLOW - The ioctl can only be called on a control
1957 device
1958
1959- DRM_UNLOCKED - The ioctl handler will be called without locking the
1960 DRM global mutex. This is the enforced default for kms drivers (i.e.
1961 using the DRIVER_MODESET flag) and hence shouldn't be used any more
1962 for new drivers.
1963
1964.. kernel-doc:: drivers/gpu/drm/drm_ioctl.c
1965 :export:
1966
1967Legacy Support Code
1968-------------------
1969
1970The section very briefly covers some of the old legacy support code
1971which is only used by old DRM drivers which have done a so-called
1972shadow-attach to the underlying device instead of registering as a real
1973driver. This also includes some of the old generic buffer management and
1974command submission code. Do not use any of this in new and modern
1975drivers.
1976
1977Legacy Suspend/Resume
1978~~~~~~~~~~~~~~~~~~~~~
1979
1980The DRM core provides some suspend/resume code, but drivers wanting full
1981suspend/resume support should provide save() and restore() functions.
1982These are called at suspend, hibernate, or resume time, and should
1983perform any state save or restore required by your device across suspend
1984or hibernate states.
1985
1986int (\*suspend) (struct drm_device \*, pm_message_t state); int
1987(\*resume) (struct drm_device \*);
1988Those are legacy suspend and resume methods which *only* work with the
1989legacy shadow-attach driver registration functions. New driver should
1990use the power management interface provided by their bus type (usually
1991through the :c:type:`struct device_driver <device_driver>`
1992dev_pm_ops) and set these methods to NULL.
1993
1994Legacy DMA Services
1995~~~~~~~~~~~~~~~~~~~
1996
1997This should cover how DMA mapping etc. is supported by the core. These
1998functions are deprecated and should not be used.