From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: <dri-devel@lists.freedesktop.org>
Cc: tomi.valkeinen@ti.com
Subject: [PATCH v6 01/84] Revert "drm/omap: dss: Remove unused omap_dss_device operations"
Date: Tue, 15 Dec 2020 12:45:34 +0200 [thread overview]
Message-ID: <20201215104657.802264-2-tomi.valkeinen@ti.com> (raw)
In-Reply-To: <20201215104657.802264-1-tomi.valkeinen@ti.com>
From: Sebastian Reichel <sebastian.reichel@collabora.com>
This reverts commit e086558ae923 ("drm/omap: dss: Remove unused
omap_dss_device operations")
This is still needed by DSI. E.g. unloading modules without this will
cause a crash.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/gpu/drm/omapdrm/dss/base.c | 26 +++++++++++++++
drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ++++
drivers/gpu/drm/omapdrm/omap_encoder.c | 44 +++++++++++++++++++++++---
3 files changed, 71 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index cf50430e6363..3d2aa9d4ab6b 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -234,6 +234,18 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
}
EXPORT_SYMBOL_GPL(omapdss_device_disconnect);
+void omapdss_device_pre_enable(struct omap_dss_device *dssdev)
+{
+ if (!dssdev)
+ return;
+
+ omapdss_device_pre_enable(dssdev->next);
+
+ if (dssdev->ops && dssdev->ops->pre_enable)
+ dssdev->ops->pre_enable(dssdev);
+}
+EXPORT_SYMBOL_GPL(omapdss_device_pre_enable);
+
void omapdss_device_enable(struct omap_dss_device *dssdev)
{
if (!dssdev)
@@ -260,6 +272,20 @@ void omapdss_device_disable(struct omap_dss_device *dssdev)
}
EXPORT_SYMBOL_GPL(omapdss_device_disable);
+void omapdss_device_post_disable(struct omap_dss_device *dssdev)
+{
+ if (!dssdev)
+ return;
+
+ if (dssdev->ops && dssdev->ops->post_disable)
+ dssdev->ops->post_disable(dssdev);
+
+ omapdss_device_post_disable(dssdev->next);
+
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+}
+EXPORT_SYMBOL_GPL(omapdss_device_post_disable);
+
/* -----------------------------------------------------------------------------
* Components Handling
*/
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index a48a9a254e33..28c2cffc362e 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -342,11 +342,15 @@ struct omap_dss_device_ops {
void (*disconnect)(struct omap_dss_device *dssdev,
struct omap_dss_device *dst);
+ void (*pre_enable)(struct omap_dss_device *dssdev);
void (*enable)(struct omap_dss_device *dssdev);
void (*disable)(struct omap_dss_device *dssdev);
+ void (*post_disable)(struct omap_dss_device *dssdev);
int (*check_timings)(struct omap_dss_device *dssdev,
struct drm_display_mode *mode);
+ void (*set_timings)(struct omap_dss_device *dssdev,
+ const struct drm_display_mode *mode);
int (*get_modes)(struct omap_dss_device *dssdev,
struct drm_connector *connector);
@@ -445,8 +449,10 @@ int omapdss_device_connect(struct dss_device *dss,
struct omap_dss_device *dst);
void omapdss_device_disconnect(struct omap_dss_device *src,
struct omap_dss_device *dst);
+void omapdss_device_pre_enable(struct omap_dss_device *dssdev);
void omapdss_device_enable(struct omap_dss_device *dssdev);
void omapdss_device_disable(struct omap_dss_device *dssdev);
+void omapdss_device_post_disable(struct omap_dss_device *dssdev);
int omap_dss_get_num_overlay_managers(void);
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index 57e92a4d5937..a2b08d32baad 100644
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
@@ -113,8 +113,13 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
bus_flags = connector->display_info.bus_flags;
omap_encoder_update_videomode_flags(&vm, bus_flags);
- /* Set timings for the dss manager. */
+ /* Set timings for all devices in the display pipeline. */
dss_mgr_set_timings(output, &vm);
+
+ for (dssdev = output; dssdev; dssdev = dssdev->next) {
+ if (dssdev->ops && dssdev->ops->set_timings)
+ dssdev->ops->set_timings(dssdev, adjusted_mode);
+ }
}
static void omap_encoder_disable(struct drm_encoder *encoder)
@@ -127,10 +132,26 @@ static void omap_encoder_disable(struct drm_encoder *encoder)
/*
* Disable the chain of external devices, starting at the one at the
- * internal encoder's output. This is used for DSI outputs only, as
- * dssdev->next is NULL for all other outputs.
+ * internal encoder's output.
*/
omapdss_device_disable(dssdev->next);
+
+ /*
+ * Disable the internal encoder. This will disable the DSS output. The
+ * DSI is treated as an exception as DSI pipelines still use the legacy
+ * flow where the pipeline output controls the encoder.
+ */
+ if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
+ if (dssdev->ops && dssdev->ops->disable)
+ dssdev->ops->disable(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
+ }
+
+ /*
+ * Perform the post-disable operations on the chain of external devices
+ * to complete the display pipeline disable.
+ */
+ omapdss_device_post_disable(dssdev->next);
}
static void omap_encoder_enable(struct drm_encoder *encoder)
@@ -141,10 +162,23 @@ static void omap_encoder_enable(struct drm_encoder *encoder)
dev_dbg(dev->dev, "enable(%s)\n", dssdev->name);
+ /* Prepare the chain of external devices for pipeline enable. */
+ omapdss_device_pre_enable(dssdev->next);
+
+ /*
+ * Enable the internal encoder. This will enable the DSS output. The
+ * DSI is treated as an exception as DSI pipelines still use the legacy
+ * flow where the pipeline output controls the encoder.
+ */
+ if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
+ if (dssdev->ops && dssdev->ops->enable)
+ dssdev->ops->enable(dssdev);
+ dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
+ }
+
/*
* Enable the chain of external devices, starting at the one at the
- * internal encoder's output. This is used for DSI outputs only, as
- * dssdev->next is NULL for all other outputs.
+ * internal encoder's output.
*/
omapdss_device_enable(dssdev->next);
}
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-12-15 10:47 UTC|newest]
Thread overview: 85+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-15 10:45 [PATCH v6 00/84] Convert DSI code to use drm_mipi_dsi and drm_panel Tomi Valkeinen
2020-12-15 10:45 ` Tomi Valkeinen [this message]
2020-12-15 10:45 ` [PATCH v6 02/84] drm/omap: drop unused dsi.configure_pins Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 03/84] drm/omap: dsi: use MIPI_DSI_FMT_* instead of OMAP_DSS_DSI_FMT_* Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 04/84] drm/omap: constify write buffers Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 05/84] drm/omap: dsi: add generic transfer function Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 06/84] drm/omap: panel-dsi-cm: convert to transfer API Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 07/84] drm/omap: dsi: unexport specific data transfer functions Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 08/84] drm/omap: dsi: drop virtual channel logic Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 09/84] drm/omap: dsi: simplify write function Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 10/84] drm/omap: dsi: simplify read functions Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 11/84] drm/omap: dsi: switch dsi_vc_send_long/short to mipi_dsi_msg Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 12/84] drm/omap: dsi: introduce mipi_dsi_host Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 13/84] drm/omap: panel-dsi-cm: use DSI helpers Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 14/84] drm/omap: dsi: request VC via mipi_dsi_attach Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 15/84] drm/omap: panel-dsi-cm: drop hardcoded VC Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 16/84] drm/omap: panel-dsi-cm: use common MIPI DCS 1.3 defines Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 17/84] drm/omap: dsi: drop unused memory_read() Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 18/84] drm/omap: dsi: drop unused get_te() Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 19/84] drm/omap: dsi: drop unused enable_te() Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 20/84] drm/omap: dsi: drop useless sync() Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 21/84] drm/omap: dsi: use pixel-format and mode from attach Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 22/84] drm/omap: panel-dsi-cm: use bulk regulator API Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 23/84] drm/omap: dsi: lp/hs switching support for transfer() Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 24/84] drm/omap: dsi: move TE GPIO handling into core Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 25/84] drm/omap: dsi: drop custom enable_te() API Tomi Valkeinen
2020-12-15 10:45 ` [PATCH v6 26/84] drm/omap: dsi: do bus locking in host driver Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 27/84] drm/omap: dsi: untangle ulps ops from enable/disable Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 28/84] drm/omap: dsi: do ULPS in host driver Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 29/84] drm/omap: dsi: move panel refresh function to host Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 30/84] drm/omap: dsi: Reverse direction of the DSS device enable/disable operations Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 31/84] drm/omap: dsi: drop custom panel capability support Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 32/84] drm/omap: dsi: convert to drm_panel Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 33/84] drm/omap: drop omapdss-boot-init Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 34/84] drm/omap: dsi: implement check timings Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 35/84] drm/omap: panel-dsi-cm: use DEVICE_ATTR_RO Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 36/84] drm/omap: panel-dsi-cm: support unbinding Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 37/84] drm/omap: panel-dsi-cm: fix remove() Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 38/84] drm/omap: remove global dss_device variable Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 39/84] drm/panel: Move OMAP's DSI command mode panel driver Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 40/84] drm/omap: dsi: Register a drm_bridge Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 41/84] drm/omap: remove legacy DSS device operations Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 42/84] drm/omap: remove unused omap_connector Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 43/84] drm/omap: simplify omap_display_id Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 44/84] drm/omap: drop unused DSS next pointer Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 45/84] drm/omap: drop DSS ops_flags Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 46/84] drm/omap: drop dssdev display field Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 47/84] drm/omap: simplify DSI manual update code Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 48/84] drm/omap: dsi: simplify pin config Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 49/84] ARM: omap2plus_defconfig: Update for moved DSI command mode panel Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 50/84] drm/omap: squash omapdrm sub-modules into one Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 51/84] drm/omap: remove unused display.c Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 52/84] drm/omap: drop unused owner field Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 53/84] drm/omap: remove dispc_ops Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 54/84] drm/omap: remove dss_mgr_ops Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 55/84] drm/panel: panel-dsi-cm: use MIPI_DCS_GET_ERROR_COUNT_ON_DSI Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 56/84] drm/panel: panel-dsi-cm: cleanup tear enable Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 57/84] ARM: dts: omap5: add address-cells & size-cells to dsi Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 58/84] drm/omap: pll: fix iteration loop check Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 59/84] drm/omap: dsi: set trans_mode according to client mode_flags Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 60/84] drm/panel: panel-dsi-cm: set column & page at setup Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 61/84] drm/omap: dsi: send nop instead of page & column Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 62/84] drm/omap: dsi: simplify VC handling Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 63/84] drm/omap: dsi: drop useless channel checks Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 64/84] drm/omap: dsi: cleanup dispc channel usage Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 65/84] drm/omap: dsi: rename 'channel' to 'vc' Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 66/84] drm/omap: dsi: pass vc and channel to various functions Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 67/84] drm/omap: dsi: untangle vc & channel Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 68/84] drm/omap: dsi: skip dsi_vc_enable_hs when already in correct mode Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 69/84] drm/omap: dsi: enable HS before sending the frame Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 70/84] drm/omap: dsi: use separate VCs for cmd and video Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 71/84] drm/panel: panel-dsi-cm: remove extra 'if' Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 72/84] drm/panel: panel-dsi-cm: add panel database to driver Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 73/84] drm/panel: panel-dsi-cm: drop unneeded includes Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 74/84] drm/omap: dsi: move structs & defines to dsi.h Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 75/84] drm/omap: dsi: move enable/disable to bridge enable/disable Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 76/84] drm/omap: dsi: display_enable cleanup Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 77/84] drm/omap: dsi: display_disable cleanup Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 78/84] drm/omap: dsi: rename dsi_display_* functions Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 79/84] drm/omap: dsi: cleanup initial vc setup Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 80/84] drm/omap: dsi: split video mode enable/disable into separate func Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 81/84] drm/omap: dsi: fix and cleanup ddr_clk_always_on Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 82/84] drm/omap: dsi: remove ulps support Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 83/84] drm/omap: dsi: fix DCS_CMD_ENABLE Tomi Valkeinen
2020-12-15 10:46 ` [PATCH v6 84/84] drm/omap: dsi: allow DSI commands to be sent early Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201215104657.802264-2-tomi.valkeinen@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=dri-devel@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).