diff mbox

[1/6] OMAPDSS: APPLY: set infos to dirty on enable

Message ID 1384779009-10512-2-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen Nov. 18, 2013, 12:50 p.m. UTC
Currently when DISPC is suspended, the driver stores all DISPC registers
to memory, so that they can be restored on resume. This is a bad way to
handle suspend/resume, as it's prone to failures and requires somewhat
large amount of extra space to store the registers.

A better approach is to program the DISPC from scratch when resuming.
This can be easily accomplished in apply layer by setting the manager
and overlay infos to dirty when the manager is to be enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/video/omap2/dss/apply.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

Comments

archit taneja Nov. 25, 2013, 1:06 a.m. UTC | #1
On Monday 18 November 2013 06:20 PM, Tomi Valkeinen wrote:
> Currently when DISPC is suspended, the driver stores all DISPC registers
> to memory, so that they can be restored on resume. This is a bad way to
> handle suspend/resume, as it's prone to failures and requires somewhat
> large amount of extra space to store the registers.
>
> A better approach is to program the DISPC from scratch when resuming.
> This can be easily accomplished in apply layer by setting the manager
> and overlay infos to dirty when the manager is to be enabled.

I guess this won't work if we wanted to support DSI command mode 
displays. I.e, only shut DSS off and keep the panel up. In that case, we 
would need to mark the flags dirty in dss_mgr_start_update_compat().

We don't support the above use case anyway, but just pointing out :)

Archit

>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/video/omap2/dss/apply.c | 22 ++++++++++++++++++++++
>   1 file changed, 22 insertions(+)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index 60758db..6ab4cb6 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -1072,6 +1072,7 @@ static void dss_setup_fifos(void)
>   static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
>   {
>   	struct mgr_priv_data *mp = get_mgr_priv(mgr);
> +	struct omap_overlay *ovl;
>   	unsigned long flags;
>   	int r;
>
> @@ -1091,6 +1092,27 @@ static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
>   		goto err;
>   	}
>
> +	/*
> +	 * Mark the info & extra_info dirty for the manager and its enabled
> +	 * overlays to force register writes. This ensures that the relevant
> +	 * registers are set after DSS has been off and the registers have been
> +	 * reset.
> +	 */
> +
> +	mp->info_dirty = true;
> +	mp->extra_info_dirty = true;
> +
> +	list_for_each_entry(ovl, &mgr->overlays, list) {
> +		struct ovl_priv_data *op = get_ovl_priv(ovl);
> +
> +		if (!op->enabled)
> +			continue;
> +
> +		op->info_dirty = true;
> +		op->extra_info_dirty = true;
> +		dispc_ovl_set_channel_out(ovl->id, mgr->id);
> +	}
> +
>   	dss_setup_fifos();
>
>   	dss_write_regs();
>

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomi Valkeinen Nov. 26, 2013, 10:21 a.m. UTC | #2
On 2013-11-25 03:06, Archit Taneja wrote:
> On Monday 18 November 2013 06:20 PM, Tomi Valkeinen wrote:
>> Currently when DISPC is suspended, the driver stores all DISPC registers
>> to memory, so that they can be restored on resume. This is a bad way to
>> handle suspend/resume, as it's prone to failures and requires somewhat
>> large amount of extra space to store the registers.
>>
>> A better approach is to program the DISPC from scratch when resuming.
>> This can be easily accomplished in apply layer by setting the manager
>> and overlay infos to dirty when the manager is to be enabled.
> 
> I guess this won't work if we wanted to support DSI command mode
> displays. I.e, only shut DSS off and keep the panel up. In that case, we
> would need to mark the flags dirty in dss_mgr_start_update_compat().

Hmm, true, I didn't try with DSI command mode panel. But I think it
should work. The DSI driver should call mgr->enable before update, if
the mgr has been off.

 Tomi
diff mbox

Patch

diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 60758db..6ab4cb6 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -1072,6 +1072,7 @@  static void dss_setup_fifos(void)
 static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
 {
 	struct mgr_priv_data *mp = get_mgr_priv(mgr);
+	struct omap_overlay *ovl;
 	unsigned long flags;
 	int r;
 
@@ -1091,6 +1092,27 @@  static int dss_mgr_enable_compat(struct omap_overlay_manager *mgr)
 		goto err;
 	}
 
+	/*
+	 * Mark the info & extra_info dirty for the manager and its enabled
+	 * overlays to force register writes. This ensures that the relevant
+	 * registers are set after DSS has been off and the registers have been
+	 * reset.
+	 */
+
+	mp->info_dirty = true;
+	mp->extra_info_dirty = true;
+
+	list_for_each_entry(ovl, &mgr->overlays, list) {
+		struct ovl_priv_data *op = get_ovl_priv(ovl);
+
+		if (!op->enabled)
+			continue;
+
+		op->info_dirty = true;
+		op->extra_info_dirty = true;
+		dispc_ovl_set_channel_out(ovl->id, mgr->id);
+	}
+
 	dss_setup_fifos();
 
 	dss_write_regs();