summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-09-11 15:54:06 +0200
committerLucas Stach <l.stach@pengutronix.de>2021-07-21 22:27:09 +0200
commitf2c47234fbe0eeaeeeca4d0b4361f36b4666ceb5 (patch)
tree4f7979705df4046bd950b412ed8f99f03dcac3ff
parentc3e3a072e258d3ec913b40af1af9d56c853945e0 (diff)
downloadlinux-f2c47234fbe0eeaeeeca4d0b4361f36b4666ceb5.tar.gz
linux-f2c47234fbe0eeaeeeca4d0b4361f36b4666ceb5.tar.xz
drm/exynos: add callback for tearing effect handler
The tearing effect interrupts are not handled by the MIPI DSI bridge driver, but the display controller driver. Allow platforms to register a callback for the tearing effect interrupt. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_dsi.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 3b2a3111c63f..3f5cabe07e09 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -243,6 +243,7 @@ struct exynos_dsi;
struct exynos_dsi_host_ops {
int (*attach)(struct device *dev, struct mipi_dsi_device *device);
int (*detach)(struct device *dev, struct mipi_dsi_device *device);
+ void (*te_handler)(struct device *dev);
};
enum exynos_reg_offset {
@@ -504,9 +505,17 @@ static int __exynos_dsi_host_detach(struct device *dev,
return 0;
}
+static void __exynos_dsi_te_handler(struct device *dev)
+{
+ struct exynos_dsi *dsi = dev_get_drvdata(dev);
+
+ exynos_drm_crtc_te_handler(dsi->encoder.crtc);
+}
+
static const struct exynos_dsi_host_ops exynos_dsi_host_ops = {
.attach = __exynos_dsi_host_attach,
.detach = __exynos_dsi_host_detach,
+ .te_handler = __exynos_dsi_te_handler,
};
static const struct exynos_dsi_driver_data exynos3_dsi_driver_data = {
@@ -1354,11 +1363,12 @@ static irqreturn_t exynos_dsi_irq(int irq, void *dev_id)
static irqreturn_t exynos_dsi_te_irq_handler(int irq, void *dev_id)
{
- struct exynos_dsi *dsi = (struct exynos_dsi *)dev_id;
- struct drm_encoder *encoder = &dsi->encoder;
+ struct exynos_dsi *dsi = dev_id;
+ const struct exynos_dsi_host_ops *ops = dsi->driver_data->host_ops;
- if (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE)
- exynos_drm_crtc_te_handler(encoder->crtc);
+ if (ops && ops->te_handler &&
+ (dsi->state & DSIM_STATE_VIDOUT_AVAILABLE))
+ ops->te_handler(dsi->dsi_host.dev);
return IRQ_HANDLED;
}