linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 11/32] OMAPDRM: fix overlay manager handling
Date: Fri, 07 Jun 2013 06:33:56 +0000	[thread overview]
Message-ID: <51B17C04.9070106@ti.com> (raw)
In-Reply-To: <1369906493-27538-12-git-send-email-tomi.valkeinen@ti.com>

On Thursday 30 May 2013 03:04 PM, Tomi Valkeinen wrote:
> Currently omapdrm creates crtcs, which map directly to DSS overlay
> managers, only on demand at init time. This would make it difficult to
> manage connecting the display entities in the future, as the code cannot
> just search for a suitable overlay manager.
>
> We cannot fix this the sane way, which would be to create crtcs for each
> overlay manager, because we need an overlay for each crtc. With limited
> number of overlays, that's not possible.
>
> So the solution for now is to detach the overlay manager from the crtc.
> crtcs are still created on demand at init time, but all overlay managers
> are always initialized by the omapdss.
>
> This way we can create and connect whole display pipelines from the
> overlay manager to the display, regardless of which crtcs omapdrm would
> create.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>   drivers/gpu/drm/omapdrm/omap_crtc.c | 22 +++++++++++++++-------
>   drivers/gpu/drm/omapdrm/omap_drv.c  |  2 ++
>   drivers/gpu/drm/omapdrm/omap_drv.h  |  1 +
>   drivers/video/omap2/dss/apply.c     |  3 ---
>   drivers/video/omap2/dss/dispc.c     |  4 ++++
>   5 files changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
> index 79b200a..02075bf 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -40,7 +40,7 @@ struct omap_crtc {
>   	 * mgr->id.)  Eventually this will be replaced w/ something
>   	 * more common-panel-framework-y
>   	 */
> -	struct omap_overlay_manager mgr;
> +	struct omap_overlay_manager *mgr;
>
>   	struct omap_video_timings timings;
>   	bool enabled;
> @@ -90,6 +90,9 @@ uint32_t pipe2vbl(struct drm_crtc *crtc)
>    * job of sequencing the setup of the video pipe in the proper order
>    */
>
> +/* ovl-mgr-id -> crtc */
> +static struct omap_crtc *omap_crtcs[8];
> +
>   /* we can probably ignore these until we support command-mode panels: */
>   static void omap_crtc_start_update(struct omap_overlay_manager *mgr)
>   {
> @@ -107,7 +110,7 @@ static void omap_crtc_disable(struct omap_overlay_manager *mgr)
>   static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
>   		const struct omap_video_timings *timings)
>   {
> -	struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
> +	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
>   	DBG("%s", omap_crtc->name);
>   	omap_crtc->timings = *timings;
>   	omap_crtc->full_update = true;
> @@ -116,7 +119,7 @@ static void omap_crtc_set_timings(struct omap_overlay_manager *mgr,
>   static void omap_crtc_set_lcd_config(struct omap_overlay_manager *mgr,
>   		const struct dss_lcd_mgr_config *config)
>   {
> -	struct omap_crtc *omap_crtc = container_of(mgr, struct omap_crtc, mgr);
> +	struct omap_crtc *omap_crtc = omap_crtcs[mgr->id];
>   	DBG("%s", omap_crtc->name);
>   	dispc_mgr_set_lcd_config(omap_crtc->channel, config);
>   }
> @@ -569,7 +572,7 @@ static void omap_crtc_pre_apply(struct omap_drm_apply *apply)
>   	} else {
>   		if (encoder) {
>   			omap_encoder_set_enabled(encoder, false);
> -			omap_encoder_update(encoder, &omap_crtc->mgr,
> +			omap_encoder_update(encoder, omap_crtc->mgr,
>   					&omap_crtc->timings);
>   			omap_encoder_set_enabled(encoder, true);
>   			omap_crtc->full_update = false;
> @@ -595,6 +598,11 @@ static const char *channel_names[] = {
>   		[OMAP_DSS_CHANNEL_LCD2] = "lcd2",
>   };

Since we are creating overlay managers structs now, we could get rid of 
the channel_names strings above and use mgr->name instead. Not 
necessary, of course.

Archit

>
> +void omap_crtc_pre_init(void)
> +{
> +	dss_install_mgr_ops(&mgr_ops);
> +}
> +
>   /* initialize crtc */
>   struct drm_crtc *omap_crtc_init(struct drm_device *dev,
>   		struct drm_plane *plane, enum omap_channel channel, int id)
> @@ -635,9 +643,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
>   	omap_irq_register(dev, &omap_crtc->error_irq);
>
>   	/* temporary: */
> -	omap_crtc->mgr.id = channel;
> -
> -	dss_install_mgr_ops(&mgr_ops);
> +	omap_crtc->mgr = omap_dss_get_overlay_manager(channel);
>
>   	/* TODO: fix hard-coded setup.. add properties! */
>   	info = &omap_crtc->info;
> @@ -651,6 +657,8 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,
>
>   	omap_plane_install_properties(omap_crtc->plane, &crtc->base);
>
> +	omap_crtcs[channel] = omap_crtc;
> +
>   	return crtc;
>
>   fail:
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
> index 691e760..f8947f9 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -98,6 +98,8 @@ static int omap_modeset_init(struct drm_device *dev)
>   	int num_crtcs;
>   	int i, id = 0;
>
> +	omap_crtc_pre_init();
> +
>   	drm_mode_config_init(dev);
>
>   	omap_drm_irq_install(dev);
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
> index 215a20d..14f17da 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.h
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.h
> @@ -157,6 +157,7 @@ const struct omap_video_timings *omap_crtc_timings(struct drm_crtc *crtc);
>   enum omap_channel omap_crtc_channel(struct drm_crtc *crtc);
>   int omap_crtc_apply(struct drm_crtc *crtc,
>   		struct omap_drm_apply *apply);
> +void omap_crtc_pre_init(void);
>   struct drm_crtc *omap_crtc_init(struct drm_device *dev,
>   		struct drm_plane *plane, enum omap_channel channel, int id);
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index 74d1d00..c844071 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -1577,7 +1577,6 @@ int omapdss_compat_init(void)
>
>   	apply_init_priv();
>
> -	dss_init_overlay_managers();
>   	dss_init_overlay_managers_sysfs(pdev);
>   	dss_init_overlays(pdev);
>
> @@ -1642,7 +1641,6 @@ err_disp_sysfs:
>
>   err_mgr_ops:
>   	dss_uninit_overlay_managers_sysfs(pdev);
> -	dss_uninit_overlay_managers();
>   	dss_uninit_overlays(pdev);
>
>   	compat_refcnt--;
> @@ -1671,7 +1669,6 @@ void omapdss_compat_uninit(void)
>   	dss_uninstall_mgr_ops();
>
>   	dss_uninit_overlay_managers_sysfs(pdev);
> -	dss_uninit_overlay_managers();
>   	dss_uninit_overlays(pdev);
>   out:
>   	mutex_unlock(&compat_init_lock);
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index b33b016..83d7bb9 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -3710,6 +3710,8 @@ static int __init omap_dispchw_probe(struct platform_device *pdev)
>
>   	dispc_runtime_put();
>
> +	dss_init_overlay_managers();
> +
>   	dss_debugfs_create_file("dispc", dispc_dump_regs);
>
>   	return 0;
> @@ -3723,6 +3725,8 @@ static int __exit omap_dispchw_remove(struct platform_device *pdev)
>   {
>   	pm_runtime_disable(&pdev->dev);
>
> +	dss_uninit_overlay_managers();
> +
>   	return 0;
>   }
>
>


  reply	other threads:[~2013-06-07  6:33 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30  9:34 [PATCH 00/32] OMAPDSS: dss-dev-model "base" (Part 1/2) Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 01/32] OMAPDSS: add pdata->default_display_name Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 02/32] OMAPDSS: only probe pdata if there's one Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 03/32] OMAPDSS: add omap_dss_find_output() Tomi Valkeinen
2013-05-30 11:07   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 11:40     ` Tomi Valkeinen
2013-05-30 15:40       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 16:54         ` Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 04/32] OMAPDSS: add omap_dss_find_output_by_node() Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 05/32] OMAPDSS: fix dss_get_ctx_loss_count for DT Tomi Valkeinen
2013-05-30 11:09   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 11:28     ` Tomi Valkeinen
2013-05-30 15:43       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 16:14         ` Tomi Valkeinen
2013-05-30 16:36   ` Kevin Hilman
2013-05-30 17:21     ` Tomi Valkeinen
2013-05-31 15:17     ` Grygorii Strashko
2013-05-31 19:31       ` Kevin Hilman
2013-05-30  9:34 ` [PATCH 06/32] OMAPDSS: DPI: fix regulators " Tomi Valkeinen
2013-05-30 11:12   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-30 11:35     ` Tomi Valkeinen
2013-05-30 13:05       ` Arnd Bergmann
2013-05-30 15:54         ` Jean-Christophe PLAGNIOL-VILLARD
2013-06-07  5:57   ` Archit Taneja
2013-05-30  9:34 ` [PATCH 07/32] OMAPDSS: SDI: " Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 08/32] OMAPDSS: clean up dss_[ovl|mgr]_get_device() Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 09/32] OMAPDSS: add helpers to get mgr or output from display Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 10/32] OMAPDSS: split overlay manager creation Tomi Valkeinen
2013-06-07  6:31   ` Archit Taneja
2013-06-07  9:53     ` Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 11/32] OMAPDRM: fix overlay manager handling Tomi Valkeinen
2013-06-07  6:33   ` Archit Taneja [this message]
2013-05-30  9:34 ` [PATCH 12/32] OMAPDSS: Implement display (dis)connect support Tomi Valkeinen
2013-06-07  6:58   ` Archit Taneja
2013-06-07  8:31     ` Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 13/32] OMAPDSS: CORE: use devm_regulator_get Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 14/32] OMAPDSS: DSI: cleanup regulator init Tomi Valkeinen
2013-06-07  6:50   ` Archit Taneja
2013-05-30  9:34 ` [PATCH 15/32] OMAPDSS: DPI: cleanup pll & " Tomi Valkeinen
2013-06-07  6:52   ` Archit Taneja
2013-06-07  8:45     ` Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 16/32] OMAPDSS: HDMI: add hdmi_init_regulator Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 17/32] OMAPDSS: SDI: clean up regulator init Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 18/32] OMAPDSS: VENC: " Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 19/32] OMAPDSS: add videomode conversion support Tomi Valkeinen
2013-06-07  7:18   ` Archit Taneja
2013-06-07  8:35     ` Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 20/32] OMAPDSS: remove dssdev uses in trivial cases Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 21/32] OMAPDSS: add panel list Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 22/32] OMAPDSS: use the panel list in omap_dss_get_next_device Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 23/32] OMAPDSS: don't use dss bus in suspend/resume Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 24/32] OMAPDSS: implement display sysfs without dss bus Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 25/32] OMAPDSS: Add panel dev pointer to dssdev Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 26/32] OMAPDSS: remove omap_dss_start/stop_device() Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 27/32] OMAPDSS: combine omap_dss_output into omap_dss_device Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 28/32] OMAPDSS: omapdss.h: add owner field to omap_dss_device Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 29/32] OMAPDSS: add module_get/put to omap_dss_get/put_device() Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 30/32] OMAPDSS: add THIS_MODULE owner to DSS outputs Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 31/32] OMAPDSS: output: increase refcount in find_output funcs Tomi Valkeinen
2013-05-30  9:34 ` [PATCH 32/32] OMAPFB: use EPROBE_DEFER if default display is not present 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=51B17C04.9070106@ti.com \
    --to=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /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).