|
@@ -149,60 +149,6 @@ Device Instance and Driver Handling
|
|
|
Driver Load
|
|
|
-----------
|
|
|
|
|
|
-IRQ Registration
|
|
|
-~~~~~~~~~~~~~~~~
|
|
|
-
|
|
|
-The DRM core tries to facilitate IRQ handler registration and
|
|
|
-unregistration by providing :c:func:`drm_irq_install()` and
|
|
|
-:c:func:`drm_irq_uninstall()` functions. Those functions only
|
|
|
-support a single interrupt per device, devices that use more than one
|
|
|
-IRQs need to be handled manually.
|
|
|
-
|
|
|
-Managed IRQ Registration
|
|
|
-''''''''''''''''''''''''
|
|
|
-
|
|
|
-:c:func:`drm_irq_install()` starts by calling the irq_preinstall
|
|
|
-driver operation. The operation is optional and must make sure that the
|
|
|
-interrupt will not get fired by clearing all pending interrupt flags or
|
|
|
-disabling the interrupt.
|
|
|
-
|
|
|
-The passed-in IRQ will then be requested by a call to
|
|
|
-:c:func:`request_irq()`. If the DRIVER_IRQ_SHARED driver feature
|
|
|
-flag is set, a shared (IRQF_SHARED) IRQ handler will be requested.
|
|
|
-
|
|
|
-The IRQ handler function must be provided as the mandatory irq_handler
|
|
|
-driver operation. It will get passed directly to
|
|
|
-:c:func:`request_irq()` and thus has the same prototype as all IRQ
|
|
|
-handlers. It will get called with a pointer to the DRM device as the
|
|
|
-second argument.
|
|
|
-
|
|
|
-Finally the function calls the optional irq_postinstall driver
|
|
|
-operation. The operation usually enables interrupts (excluding the
|
|
|
-vblank interrupt, which is enabled separately), but drivers may choose
|
|
|
-to enable/disable interrupts at a different time.
|
|
|
-
|
|
|
-:c:func:`drm_irq_uninstall()` is similarly used to uninstall an
|
|
|
-IRQ handler. It starts by waking up all processes waiting on a vblank
|
|
|
-interrupt to make sure they don't hang, and then calls the optional
|
|
|
-irq_uninstall driver operation. The operation must disable all hardware
|
|
|
-interrupts. Finally the function frees the IRQ by calling
|
|
|
-:c:func:`free_irq()`.
|
|
|
-
|
|
|
-Manual IRQ Registration
|
|
|
-'''''''''''''''''''''''
|
|
|
-
|
|
|
-Drivers that require multiple interrupt handlers can't use the managed
|
|
|
-IRQ registration functions. In that case IRQs must be registered and
|
|
|
-unregistered manually (usually with the :c:func:`request_irq()` and
|
|
|
-:c:func:`free_irq()` functions, or their :c:func:`devm_request_irq()` and
|
|
|
-:c:func:`devm_free_irq()` equivalents).
|
|
|
-
|
|
|
-When manually registering IRQs, drivers must not set the
|
|
|
-DRIVER_HAVE_IRQ driver feature flag, and must not provide the
|
|
|
-irq_handler driver operation. They must set the :c:type:`struct
|
|
|
-drm_device <drm_device>` irq_enabled field to 1 upon
|
|
|
-registration of the IRQs, and clear it to 0 after unregistering the
|
|
|
-IRQs.
|
|
|
|
|
|
IRQ Helper Library
|
|
|
~~~~~~~~~~~~~~~~~~
|