From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, Archit Taneja <archit@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Subject: [PATCH 31/32] OMAPDSS: output: increase refcount in find_output funcs Date: Thu, 30 May 2013 09:34:52 +0000 [thread overview] Message-ID: <1369906493-27538-32-git-send-email-tomi.valkeinen@ti.com> (raw) In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> Now that omap_dss_output has been combined into omap_dss_device, we can add ref counting for the relevant output functions also. This patch adds omap_dss_get_device() calls to the various find_output() style functions. This, of course, means that the users of those find_output functions need to do a omap_dss_put_device() after use. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> --- drivers/gpu/drm/omapdrm/omap_drv.c | 2 ++ drivers/video/omap2/dss/output.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index a72100c..4c0bc40 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -277,6 +277,8 @@ static int omap_modeset_init(struct drm_device *dev) if (supported_outputs & output->id) encoder->possible_crtcs |= (1 << id); } + + omap_dss_put_device(output); } DBG("registered %d planes, %d crtcs, %d encoders and %d connectors\n", diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index cc81fec..9ad7d21 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -121,7 +121,7 @@ struct omap_dss_device *omap_dss_find_output(const char *name) list_for_each_entry(out, &output_list, list) { if (strcmp(out->name, name) = 0) - return out; + return omap_dss_get_device(out); } return NULL; @@ -134,7 +134,7 @@ struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node) list_for_each_entry(out, &output_list, list) { if (out->dev->of_node = node) - return out; + return omap_dss_get_device(out); } return NULL; @@ -143,20 +143,25 @@ EXPORT_SYMBOL(omap_dss_find_output_by_node); struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev) { - return dssdev->output; + return omap_dss_get_device(dssdev->output); } EXPORT_SYMBOL(omapdss_find_output_from_display); struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev) { struct omap_dss_device *out; + struct omap_overlay_manager *mgr; out = omapdss_find_output_from_display(dssdev); if (out = NULL) return NULL; - return out->manager; + mgr = out->manager; + + omap_dss_put_device(out); + + return mgr; } EXPORT_SYMBOL(omapdss_find_mgr_from_display); -- 1.8.1.2
WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com> To: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, Archit Taneja <archit@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Subject: [PATCH 31/32] OMAPDSS: output: increase refcount in find_output funcs Date: Thu, 30 May 2013 12:34:52 +0300 [thread overview] Message-ID: <1369906493-27538-32-git-send-email-tomi.valkeinen@ti.com> (raw) In-Reply-To: <1369906493-27538-1-git-send-email-tomi.valkeinen@ti.com> Now that omap_dss_output has been combined into omap_dss_device, we can add ref counting for the relevant output functions also. This patch adds omap_dss_get_device() calls to the various find_output() style functions. This, of course, means that the users of those find_output functions need to do a omap_dss_put_device() after use. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> --- drivers/gpu/drm/omapdrm/omap_drv.c | 2 ++ drivers/video/omap2/dss/output.c | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index a72100c..4c0bc40 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -277,6 +277,8 @@ static int omap_modeset_init(struct drm_device *dev) if (supported_outputs & output->id) encoder->possible_crtcs |= (1 << id); } + + omap_dss_put_device(output); } DBG("registered %d planes, %d crtcs, %d encoders and %d connectors\n", diff --git a/drivers/video/omap2/dss/output.c b/drivers/video/omap2/dss/output.c index cc81fec..9ad7d21 100644 --- a/drivers/video/omap2/dss/output.c +++ b/drivers/video/omap2/dss/output.c @@ -121,7 +121,7 @@ struct omap_dss_device *omap_dss_find_output(const char *name) list_for_each_entry(out, &output_list, list) { if (strcmp(out->name, name) == 0) - return out; + return omap_dss_get_device(out); } return NULL; @@ -134,7 +134,7 @@ struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node) list_for_each_entry(out, &output_list, list) { if (out->dev->of_node == node) - return out; + return omap_dss_get_device(out); } return NULL; @@ -143,20 +143,25 @@ EXPORT_SYMBOL(omap_dss_find_output_by_node); struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev) { - return dssdev->output; + return omap_dss_get_device(dssdev->output); } EXPORT_SYMBOL(omapdss_find_output_from_display); struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev) { struct omap_dss_device *out; + struct omap_overlay_manager *mgr; out = omapdss_find_output_from_display(dssdev); if (out == NULL) return NULL; - return out->manager; + mgr = out->manager; + + omap_dss_put_device(out); + + return mgr; } EXPORT_SYMBOL(omapdss_find_mgr_from_display); -- 1.8.1.2
next prev parent reply other threads:[~2013-05-30 9:34 UTC|newest] Thread overview: 120+ 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 01/32] OMAPDSS: add pdata->default_display_name Tomi Valkeinen 2013-05-30 9:34 ` 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 03/32] OMAPDSS: add omap_dss_find_output() Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 11:07 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:07 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:40 ` Tomi Valkeinen 2013-05-30 11:40 ` Tomi Valkeinen 2013-05-30 15:40 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 15:40 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 16:54 ` Tomi Valkeinen 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 05/32] OMAPDSS: fix dss_get_ctx_loss_count for DT Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 11:09 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:09 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:28 ` Tomi Valkeinen 2013-05-30 11:28 ` Tomi Valkeinen 2013-05-30 15:43 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 15:43 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 16:14 ` Tomi Valkeinen 2013-05-30 16:14 ` Tomi Valkeinen 2013-05-30 16:36 ` Kevin Hilman 2013-05-30 16:36 ` Kevin Hilman 2013-05-30 17:21 ` Tomi Valkeinen 2013-05-30 17:21 ` Tomi Valkeinen 2013-05-31 15:17 ` Grygorii Strashko 2013-05-31 15:17 ` Grygorii Strashko 2013-05-31 19:31 ` Kevin Hilman 2013-05-31 19:31 ` Kevin Hilman 2013-05-30 9:34 ` [PATCH 06/32] OMAPDSS: DPI: fix regulators " Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 11:12 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:12 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 11:35 ` Tomi Valkeinen 2013-05-30 11:35 ` Tomi Valkeinen 2013-05-30 13:05 ` Arnd Bergmann 2013-05-30 13:05 ` Arnd Bergmann 2013-05-30 15:54 ` Jean-Christophe PLAGNIOL-VILLARD 2013-05-30 15:54 ` Jean-Christophe PLAGNIOL-VILLARD 2013-06-07 5:56 ` Archit Taneja 2013-06-07 5:57 ` Archit Taneja 2013-05-30 9:34 ` [PATCH 07/32] OMAPDSS: SDI: " Tomi Valkeinen 2013-05-30 9:34 ` 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 ` 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 10/32] OMAPDSS: split overlay manager creation Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 6:19 ` Archit Taneja 2013-06-07 6:31 ` Archit Taneja 2013-06-07 9:53 ` Tomi Valkeinen 2013-06-07 9:53 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 11/32] OMAPDRM: fix overlay manager handling Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 6:21 ` Archit Taneja 2013-06-07 6:33 ` Archit Taneja 2013-05-30 9:34 ` [PATCH 12/32] OMAPDSS: Implement display (dis)connect support Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 6:46 ` Archit Taneja 2013-06-07 6:58 ` Archit Taneja 2013-06-07 8:31 ` Tomi Valkeinen 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 14/32] OMAPDSS: DSI: cleanup regulator init Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 6:49 ` Archit Taneja 2013-06-07 6:50 ` Archit Taneja 2013-05-30 9:34 ` [PATCH 15/32] OMAPDSS: DPI: cleanup pll & " Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 6:51 ` Archit Taneja 2013-06-07 6:52 ` Archit Taneja 2013-06-07 8:45 ` Tomi Valkeinen 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 17/32] OMAPDSS: SDI: clean up regulator init Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 18/32] OMAPDSS: VENC: " Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 19/32] OMAPDSS: add videomode conversion support Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-06-07 7:06 ` Archit Taneja 2013-06-07 7:18 ` Archit Taneja 2013-06-07 8:35 ` Tomi Valkeinen 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 21/32] OMAPDSS: add panel list Tomi Valkeinen 2013-05-30 9:34 ` 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 ` 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 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 24/32] OMAPDSS: implement display sysfs without dss bus Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 25/32] OMAPDSS: Add panel dev pointer to dssdev Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen 2013-05-30 9:34 ` [PATCH 26/32] OMAPDSS: remove omap_dss_start/stop_device() Tomi Valkeinen 2013-05-30 9:34 ` 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 ` 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 ` 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 ` 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 ` Tomi Valkeinen 2013-05-30 9:34 ` Tomi Valkeinen [this message] 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 2013-05-30 9:34 ` 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=1369906493-27538-32-git-send-email-tomi.valkeinen@ti.com \ --to=tomi.valkeinen@ti.com \ --cc=archit@ti.com \ --cc=linux-fbdev@vger.kernel.org \ --cc=linux-omap@vger.kernel.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.