mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
drm: omapdrm: Handle CRTC error IRQs directly
Instead of going through a complicated registration mechanism, just expose the CRTC error IRQ function and call it directly from the main IRQ handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
728ae8dd69
commit
e0519af75d
3 changed files with 11 additions and 10 deletions
|
@ -37,7 +37,6 @@ struct omap_crtc {
|
||||||
struct videomode vm;
|
struct videomode vm;
|
||||||
|
|
||||||
struct omap_drm_irq vblank_irq;
|
struct omap_drm_irq vblank_irq;
|
||||||
struct omap_drm_irq error_irq;
|
|
||||||
|
|
||||||
bool ignore_digit_sync_lost;
|
bool ignore_digit_sync_lost;
|
||||||
|
|
||||||
|
@ -275,10 +274,9 @@ static void omap_crtc_complete_page_flip(struct drm_crtc *crtc)
|
||||||
spin_unlock_irqrestore(&dev->event_lock, flags);
|
spin_unlock_irqrestore(&dev->event_lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void omap_crtc_error_irq(struct omap_drm_irq *irq, uint32_t irqstatus)
|
void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus)
|
||||||
{
|
{
|
||||||
struct omap_crtc *omap_crtc =
|
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
|
||||||
container_of(irq, struct omap_crtc, error_irq);
|
|
||||||
|
|
||||||
if (omap_crtc->ignore_digit_sync_lost) {
|
if (omap_crtc->ignore_digit_sync_lost) {
|
||||||
irqstatus &= ~DISPC_IRQ_SYNC_LOST_DIGIT;
|
irqstatus &= ~DISPC_IRQ_SYNC_LOST_DIGIT;
|
||||||
|
@ -325,7 +323,6 @@ static void omap_crtc_destroy(struct drm_crtc *crtc)
|
||||||
DBG("%s", omap_crtc->name);
|
DBG("%s", omap_crtc->name);
|
||||||
|
|
||||||
WARN_ON(omap_crtc->vblank_irq.registered);
|
WARN_ON(omap_crtc->vblank_irq.registered);
|
||||||
omap_irq_unregister(crtc->dev, &omap_crtc->error_irq);
|
|
||||||
|
|
||||||
drm_crtc_cleanup(crtc);
|
drm_crtc_cleanup(crtc);
|
||||||
|
|
||||||
|
@ -549,11 +546,6 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
|
||||||
omap_crtc->vblank_irq.irqmask = pipe2vbl(crtc);
|
omap_crtc->vblank_irq.irqmask = pipe2vbl(crtc);
|
||||||
omap_crtc->vblank_irq.irq = omap_crtc_vblank_irq;
|
omap_crtc->vblank_irq.irq = omap_crtc_vblank_irq;
|
||||||
|
|
||||||
omap_crtc->error_irq.irqmask =
|
|
||||||
dispc_mgr_get_sync_lost_irq(channel);
|
|
||||||
omap_crtc->error_irq.irq = omap_crtc_error_irq;
|
|
||||||
omap_irq_register(dev, &omap_crtc->error_irq);
|
|
||||||
|
|
||||||
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
|
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
|
||||||
&omap_crtc_funcs, NULL);
|
&omap_crtc_funcs, NULL);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -155,6 +155,7 @@ void omap_crtc_pre_uninit(void);
|
||||||
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
|
struct drm_crtc *omap_crtc_init(struct drm_device *dev,
|
||||||
struct drm_plane *plane, enum omap_channel channel, int id);
|
struct drm_plane *plane, enum omap_channel channel, int id);
|
||||||
int omap_crtc_wait_pending(struct drm_crtc *crtc);
|
int omap_crtc_wait_pending(struct drm_crtc *crtc);
|
||||||
|
void omap_crtc_error_irq(struct drm_crtc *crtc, uint32_t irqstatus);
|
||||||
|
|
||||||
struct drm_plane *omap_plane_init(struct drm_device *dev,
|
struct drm_plane *omap_plane_init(struct drm_device *dev,
|
||||||
int id, enum drm_plane_type type,
|
int id, enum drm_plane_type type,
|
||||||
|
|
|
@ -241,9 +241,13 @@ static irqreturn_t omap_irq_handler(int irq, void *arg)
|
||||||
|
|
||||||
for (id = 0; id < priv->num_crtcs; id++) {
|
for (id = 0; id < priv->num_crtcs; id++) {
|
||||||
struct drm_crtc *crtc = priv->crtcs[id];
|
struct drm_crtc *crtc = priv->crtcs[id];
|
||||||
|
enum omap_channel channel = omap_crtc_channel(crtc);
|
||||||
|
|
||||||
if (irqstatus & pipe2vbl(crtc))
|
if (irqstatus & pipe2vbl(crtc))
|
||||||
drm_handle_vblank(dev, id);
|
drm_handle_vblank(dev, id);
|
||||||
|
|
||||||
|
if (irqstatus & dispc_mgr_get_sync_lost_irq(channel))
|
||||||
|
omap_crtc_error_irq(crtc, irqstatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
omap_irq_fifo_underflow(priv, irqstatus);
|
omap_irq_fifo_underflow(priv, irqstatus);
|
||||||
|
@ -279,6 +283,7 @@ int omap_drm_irq_install(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct omap_drm_private *priv = dev->dev_private;
|
struct omap_drm_private *priv = dev->dev_private;
|
||||||
struct omap_drm_irq *error_handler = &priv->error_handler;
|
struct omap_drm_irq *error_handler = &priv->error_handler;
|
||||||
|
unsigned int num_mgrs = dss_feat_get_num_mgrs();
|
||||||
unsigned int max_planes;
|
unsigned int max_planes;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -294,6 +299,9 @@ int omap_drm_irq_install(struct drm_device *dev)
|
||||||
priv->irq_mask |= omap_underflow_irqs[i];
|
priv->irq_mask |= omap_underflow_irqs[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < num_mgrs; ++i)
|
||||||
|
priv->irq_mask |= dispc_mgr_get_sync_lost_irq(i);
|
||||||
|
|
||||||
dispc_runtime_get();
|
dispc_runtime_get();
|
||||||
dispc_clear_irqstatus(0xffffffff);
|
dispc_clear_irqstatus(0xffffffff);
|
||||||
dispc_runtime_put();
|
dispc_runtime_put();
|
||||||
|
|
Loading…
Add table
Reference in a new issue