.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ |
---|
3 | 4 | * Author: Rob Clark <rob.clark@linaro.org> |
---|
4 | | - * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify it |
---|
6 | | - * under the terms of the GNU General Public License version 2 as published by |
---|
7 | | - * the Free Software Foundation. |
---|
8 | | - * |
---|
9 | | - * This program is distributed in the hope that it will be useful, but WITHOUT |
---|
10 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
11 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
12 | | - * more details. |
---|
13 | | - * |
---|
14 | | - * You should have received a copy of the GNU General Public License along with |
---|
15 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
---|
16 | 5 | */ |
---|
| 6 | + |
---|
| 7 | +#include <drm/drm_vblank.h> |
---|
17 | 8 | |
---|
18 | 9 | #include "omap_drv.h" |
---|
19 | 10 | |
---|
.. | .. |
---|
83 | 74 | kfree(wait); |
---|
84 | 75 | |
---|
85 | 76 | return ret == 0 ? -1 : 0; |
---|
| 77 | +} |
---|
| 78 | + |
---|
| 79 | +int omap_irq_enable_framedone(struct drm_crtc *crtc, bool enable) |
---|
| 80 | +{ |
---|
| 81 | + struct drm_device *dev = crtc->dev; |
---|
| 82 | + struct omap_drm_private *priv = dev->dev_private; |
---|
| 83 | + unsigned long flags; |
---|
| 84 | + enum omap_channel channel = omap_crtc_channel(crtc); |
---|
| 85 | + int framedone_irq = |
---|
| 86 | + priv->dispc_ops->mgr_get_framedone_irq(priv->dispc, channel); |
---|
| 87 | + |
---|
| 88 | + DBG("dev=%p, crtc=%u, enable=%d", dev, channel, enable); |
---|
| 89 | + |
---|
| 90 | + spin_lock_irqsave(&priv->wait_lock, flags); |
---|
| 91 | + if (enable) |
---|
| 92 | + priv->irq_mask |= framedone_irq; |
---|
| 93 | + else |
---|
| 94 | + priv->irq_mask &= ~framedone_irq; |
---|
| 95 | + omap_irq_update(dev); |
---|
| 96 | + spin_unlock_irqrestore(&priv->wait_lock, flags); |
---|
| 97 | + |
---|
| 98 | + return 0; |
---|
86 | 99 | } |
---|
87 | 100 | |
---|
88 | 101 | /** |
---|
.. | .. |
---|
206 | 219 | |
---|
207 | 220 | VERB("irqs: %08x", irqstatus); |
---|
208 | 221 | |
---|
209 | | - for (id = 0; id < priv->num_crtcs; id++) { |
---|
210 | | - struct drm_crtc *crtc = priv->crtcs[id]; |
---|
| 222 | + for (id = 0; id < priv->num_pipes; id++) { |
---|
| 223 | + struct drm_crtc *crtc = priv->pipes[id].crtc; |
---|
211 | 224 | enum omap_channel channel = omap_crtc_channel(crtc); |
---|
212 | 225 | |
---|
213 | 226 | if (irqstatus & priv->dispc_ops->mgr_get_vsync_irq(priv->dispc, channel)) { |
---|
.. | .. |
---|
217 | 230 | |
---|
218 | 231 | if (irqstatus & priv->dispc_ops->mgr_get_sync_lost_irq(priv->dispc, channel)) |
---|
219 | 232 | omap_crtc_error_irq(crtc, irqstatus); |
---|
| 233 | + |
---|
| 234 | + if (irqstatus & priv->dispc_ops->mgr_get_framedone_irq(priv->dispc, channel)) |
---|
| 235 | + omap_crtc_framedone_irq(crtc, irqstatus); |
---|
220 | 236 | } |
---|
221 | 237 | |
---|
222 | 238 | omap_irq_ocp_error_handler(dev, irqstatus); |
---|