diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-05-31 05:22:53 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-06-01 02:02:14 -0400 |
commit | 16584b204573ece64de80f20eb6202495aeb35c2 (patch) | |
tree | 655ffd124df38ea5883e146ece397bb270bcffdc /drivers/gpu/drm/drm_irq.c | |
parent | 3ed4351a83ca05d3cd886ade6900be1067aa7903 (diff) |
drm/doc: Polish irq helper documentation
Pull a (much shorter) overview into drm_irq.c, and instead put the
callback documentation into in-line comments in drm_drv.h.
v2: Move the include stanzas back to the split-up patch (Stefan).
Cc: Stefan Agner <stefan@agner.ch>
Reviewed-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170531092253.12833-1-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_irq.c')
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 28d736c3fcb4..3b04c25100ae 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -62,19 +62,39 @@ | |||
62 | #include "drm_internal.h" | 62 | #include "drm_internal.h" |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * DOC: irq helpers | ||
66 | * | ||
67 | * The DRM core provides very simple support helpers to enable IRQ handling on a | ||
68 | * device through the drm_irq_install() and drm_irq_uninstall() functions. This | ||
69 | * only supports devices with a single interrupt on the main device stored in | ||
70 | * &drm_device.dev and set as the device paramter in drm_dev_alloc(). | ||
71 | * | ||
72 | * These IRQ helpers are strictly optional. Drivers which roll their own only | ||
73 | * need to set &drm_device.irq_enabled to signal the DRM core that vblank | ||
74 | * interrupts are working. Since these helpers don't automatically clean up the | ||
75 | * requested interrupt like e.g. devm_request_irq() they're not really | ||
76 | * recommended. | ||
77 | */ | ||
78 | |||
79 | /** | ||
65 | * drm_irq_install - install IRQ handler | 80 | * drm_irq_install - install IRQ handler |
66 | * @dev: DRM device | 81 | * @dev: DRM device |
67 | * @irq: IRQ number to install the handler for | 82 | * @irq: IRQ number to install the handler for |
68 | * | 83 | * |
69 | * Initializes the IRQ related data. Installs the handler, calling the driver | 84 | * Initializes the IRQ related data. Installs the handler, calling the driver |
70 | * irq_preinstall() and irq_postinstall() functions before and after the | 85 | * &drm_driver.irq_preinstall and &drm_driver.irq_postinstall functions before |
71 | * installation. | 86 | * and after the installation. |
72 | * | 87 | * |
73 | * This is the simplified helper interface provided for drivers with no special | 88 | * This is the simplified helper interface provided for drivers with no special |
74 | * needs. Drivers which need to install interrupt handlers for multiple | 89 | * needs. Drivers which need to install interrupt handlers for multiple |
75 | * interrupts must instead set &drm_device.irq_enabled to signal the DRM core | 90 | * interrupts must instead set &drm_device.irq_enabled to signal the DRM core |
76 | * that vblank interrupts are available. | 91 | * that vblank interrupts are available. |
77 | * | 92 | * |
93 | * @irq must match the interrupt number that would be passed to request_irq(), | ||
94 | * if called directly instead of using this helper function. | ||
95 | * | ||
96 | * &drm_driver.irq_handler is called to handle the registered interrupt. | ||
97 | * | ||
78 | * Returns: | 98 | * Returns: |
79 | * Zero on success or a negative error code on failure. | 99 | * Zero on success or a negative error code on failure. |
80 | */ | 100 | */ |
@@ -136,9 +156,9 @@ EXPORT_SYMBOL(drm_irq_install); | |||
136 | * drm_irq_uninstall - uninstall the IRQ handler | 156 | * drm_irq_uninstall - uninstall the IRQ handler |
137 | * @dev: DRM device | 157 | * @dev: DRM device |
138 | * | 158 | * |
139 | * Calls the driver's irq_uninstall() function and unregisters the IRQ handler. | 159 | * Calls the driver's &drm_driver.irq_uninstall function and unregisters the IRQ |
140 | * This should only be called by drivers which used drm_irq_install() to set up | 160 | * handler. This should only be called by drivers which used drm_irq_install() |
141 | * their interrupt handler. Other drivers must only reset | 161 | * to set up their interrupt handler. Other drivers must only reset |
142 | * &drm_device.irq_enabled to false. | 162 | * &drm_device.irq_enabled to false. |
143 | * | 163 | * |
144 | * Note that for kernel modesetting drivers it is a bug if this function fails. | 164 | * Note that for kernel modesetting drivers it is a bug if this function fails. |