diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-05-27 18:05:20 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2016-12-19 04:24:57 -0500 |
commit | 6b5538d4ecb7679d7dc6b45f2f4db3e6958d8fe5 (patch) | |
tree | fc9fb0bf8efddac911d3ba8c5f3b263a69827235 /drivers/gpu/drm/omapdrm/omap_irq.c | |
parent | e0519af75d6eabf1876cf6af0c60704f97ab82b3 (diff) |
drm: omapdrm: Handle OCP error IRQ directly
Instead of going through a complicated registration mechanism, just
call the OCP error IRQ handler directly from the main IRQ handler.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_irq.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_irq.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_irq.c b/drivers/gpu/drm/omapdrm/omap_irq.c index 58c5efb26766..e1925fa6d849 100644 --- a/drivers/gpu/drm/omapdrm/omap_irq.c +++ b/drivers/gpu/drm/omapdrm/omap_irq.c | |||
@@ -21,12 +21,6 @@ | |||
21 | 21 | ||
22 | static DEFINE_SPINLOCK(list_lock); | 22 | static DEFINE_SPINLOCK(list_lock); |
23 | 23 | ||
24 | static void omap_irq_error_handler(struct omap_drm_irq *irq, | ||
25 | uint32_t irqstatus) | ||
26 | { | ||
27 | DRM_ERROR("errors: %08x\n", irqstatus); | ||
28 | } | ||
29 | |||
30 | /* call with list_lock and dispc runtime held */ | 24 | /* call with list_lock and dispc runtime held */ |
31 | static void omap_irq_update(struct drm_device *dev) | 25 | static void omap_irq_update(struct drm_device *dev) |
32 | { | 26 | { |
@@ -224,6 +218,14 @@ static void omap_irq_fifo_underflow(struct omap_drm_private *priv, | |||
224 | pr_cont("(0x%08x)\n", irqstatus); | 218 | pr_cont("(0x%08x)\n", irqstatus); |
225 | } | 219 | } |
226 | 220 | ||
221 | static void omap_irq_ocp_error_handler(u32 irqstatus) | ||
222 | { | ||
223 | if (!(irqstatus & DISPC_IRQ_OCP_ERR)) | ||
224 | return; | ||
225 | |||
226 | DRM_ERROR("OCP error\n"); | ||
227 | } | ||
228 | |||
227 | static irqreturn_t omap_irq_handler(int irq, void *arg) | 229 | static irqreturn_t omap_irq_handler(int irq, void *arg) |
228 | { | 230 | { |
229 | struct drm_device *dev = (struct drm_device *) arg; | 231 | struct drm_device *dev = (struct drm_device *) arg; |
@@ -250,6 +252,7 @@ static irqreturn_t omap_irq_handler(int irq, void *arg) | |||
250 | omap_crtc_error_irq(crtc, irqstatus); | 252 | omap_crtc_error_irq(crtc, irqstatus); |
251 | } | 253 | } |
252 | 254 | ||
255 | omap_irq_ocp_error_handler(irqstatus); | ||
253 | omap_irq_fifo_underflow(priv, irqstatus); | 256 | omap_irq_fifo_underflow(priv, irqstatus); |
254 | 257 | ||
255 | spin_lock_irqsave(&list_lock, flags); | 258 | spin_lock_irqsave(&list_lock, flags); |
@@ -282,7 +285,6 @@ static const u32 omap_underflow_irqs[] = { | |||
282 | int omap_drm_irq_install(struct drm_device *dev) | 285 | int omap_drm_irq_install(struct drm_device *dev) |
283 | { | 286 | { |
284 | struct omap_drm_private *priv = dev->dev_private; | 287 | struct omap_drm_private *priv = dev->dev_private; |
285 | struct omap_drm_irq *error_handler = &priv->error_handler; | ||
286 | unsigned int num_mgrs = dss_feat_get_num_mgrs(); | 288 | unsigned int num_mgrs = dss_feat_get_num_mgrs(); |
287 | unsigned int max_planes; | 289 | unsigned int max_planes; |
288 | unsigned int i; | 290 | unsigned int i; |
@@ -290,7 +292,7 @@ int omap_drm_irq_install(struct drm_device *dev) | |||
290 | 292 | ||
291 | INIT_LIST_HEAD(&priv->irq_list); | 293 | INIT_LIST_HEAD(&priv->irq_list); |
292 | 294 | ||
293 | priv->irq_mask = 0; | 295 | priv->irq_mask = DISPC_IRQ_OCP_ERR; |
294 | 296 | ||
295 | max_planes = min(ARRAY_SIZE(priv->planes), | 297 | max_planes = min(ARRAY_SIZE(priv->planes), |
296 | ARRAY_SIZE(omap_underflow_irqs)); | 298 | ARRAY_SIZE(omap_underflow_irqs)); |
@@ -310,16 +312,6 @@ int omap_drm_irq_install(struct drm_device *dev) | |||
310 | if (ret < 0) | 312 | if (ret < 0) |
311 | return ret; | 313 | return ret; |
312 | 314 | ||
313 | error_handler->irq = omap_irq_error_handler; | ||
314 | error_handler->irqmask = DISPC_IRQ_OCP_ERR; | ||
315 | |||
316 | /* for now ignore DISPC_IRQ_SYNC_LOST_DIGIT.. really I think | ||
317 | * we just need to ignore it while enabling tv-out | ||
318 | */ | ||
319 | error_handler->irqmask &= ~DISPC_IRQ_SYNC_LOST_DIGIT; | ||
320 | |||
321 | omap_irq_register(dev, error_handler); | ||
322 | |||
323 | dev->irq_enabled = true; | 315 | dev->irq_enabled = true; |
324 | 316 | ||
325 | return 0; | 317 | return 0; |