From: Archit Taneja <a0393947@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, archit@ti.com
Subject: Re: [PATCH 35/65] OMAPDSS: APPLY: move spinlock outside the struct
Date: Wed, 23 Nov 2011 09:37:16 +0000 [thread overview]
Message-ID: <4ECCBBFC.10002@ti.com> (raw)
In-Reply-To: <1321953724-6350-36-git-send-email-tomi.valkeinen@ti.com>
On Tuesday 22 November 2011 02:51 PM, Tomi Valkeinen wrote:
> dss_cache struct contains a spinlock used to protect the struct. A more
> logical place for the spinlock is outside the struct that it is
> protecting. So move it there.
>
> Signed-off-by: Tomi Valkeinen<tomi.valkeinen@ti.com>
> ---
> drivers/video/omap2/dss/apply.c | 22 ++++++++++++----------
> 1 files changed, 12 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
> index 23c723a..17639c0 100644
> --- a/drivers/video/omap2/dss/apply.c
> +++ b/drivers/video/omap2/dss/apply.c
> @@ -89,13 +89,15 @@ struct mgr_priv_data {
> };
>
> static struct {
> - spinlock_t lock;
> struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS];
> struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS];
>
> bool irq_enabled;
> } dss_cache;
>
> +/* protects dss_cache */
> +static spinlock_t data_lock;
Minor comment: The name 'data_lock' doesn't tell much that its
protecting the dss_cache struct. Probably 'cache_lock' or
'priv_data_lock' or something like that may be more informative.
Archit
> +
> static struct ovl_priv_data *get_ovl_priv(struct omap_overlay *ovl)
> {
> return&dss_cache.ovl_priv_data_array[ovl->id];
> @@ -108,7 +110,7 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
>
> void dss_apply_init(void)
> {
> - spin_lock_init(&dss_cache.lock);
> + spin_lock_init(&data_lock);
> }
>
> static bool ovl_manual_update(struct omap_overlay *ovl)
> @@ -149,10 +151,10 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr)
> unsigned long flags;
> bool shadow_dirty, dirty;
>
> - spin_lock_irqsave(&dss_cache.lock, flags);
> + spin_lock_irqsave(&data_lock, flags);
> dirty = mp->dirty;
> shadow_dirty = mp->shadow_dirty;
> - spin_unlock_irqrestore(&dss_cache.lock, flags);
> + spin_unlock_irqrestore(&data_lock, flags);
>
> if (!dirty&& !shadow_dirty) {
> r = 0;
> @@ -212,10 +214,10 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl)
> unsigned long flags;
> bool shadow_dirty, dirty;
>
> - spin_lock_irqsave(&dss_cache.lock, flags);
> + spin_lock_irqsave(&data_lock, flags);
> dirty = op->dirty;
> shadow_dirty = op->shadow_dirty;
> - spin_unlock_irqrestore(&dss_cache.lock, flags);
> + spin_unlock_irqrestore(&data_lock, flags);
>
> if (!dirty&& !shadow_dirty) {
> r = 0;
> @@ -464,7 +466,7 @@ static void dss_apply_irq_handler(void *data, u32 mask)
> for (i = 0; i< num_mgrs; i++)
> mgr_busy[i] = dispc_mgr_go_busy(i);
>
> - spin_lock(&dss_cache.lock);
> + spin_lock(&data_lock);
>
> for (i = 0; i< num_ovls; ++i) {
> ovl = omap_dss_get_overlay(i);
> @@ -498,7 +500,7 @@ static void dss_apply_irq_handler(void *data, u32 mask)
> dss_unregister_vsync_isr();
>
> end:
> - spin_unlock(&dss_cache.lock);
> + spin_unlock(&data_lock);
> }
>
> static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
> @@ -620,7 +622,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
> if (r)
> return r;
>
> - spin_lock_irqsave(&dss_cache.lock, flags);
> + spin_lock_irqsave(&data_lock, flags);
>
> /* Configure overlays */
> list_for_each_entry(ovl,&mgr->overlays, list)
> @@ -641,7 +643,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr)
> dss_write_regs();
> }
>
> - spin_unlock_irqrestore(&dss_cache.lock, flags);
> + spin_unlock_irqrestore(&data_lock, flags);
>
> dispc_runtime_put();
>
next prev parent reply other threads:[~2011-11-23 9:37 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 9:20 [PATCH 00/65] OMAPDSS: manager/apply improvements Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 01/65] OMAPDSS: DISPC: add missing prototype Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 02/65] OMAPDSS: Remove old fifomerge hacks Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 03/65] OMAPDSS: remove L4_EXAMPLE code Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 04/65] OMAPDSS: DISPC: make dispc_ovl_set_channel_out() public Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 05/65] OMAPDSS: DISPC: make dispc_ovl_set_fifo_threshold() public Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 06/65] OMAPDSS: remove partial update from the overlay manager Tomi Valkeinen
2011-11-22 11:53 ` [PATCH 06/65] OMAPDSS: remove partial update from the overlay Archit Taneja
2011-11-22 9:21 ` [PATCH 07/65] OMAPDSS: remove partial update from DSI Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 08/65] OMAPDSS: remove partial update from panel-taal Tomi Valkeinen
2011-11-22 11:55 ` Archit Taneja
2011-11-22 12:32 ` Tomi Valkeinen
2011-11-23 5:51 ` Archit Taneja
2011-11-22 9:21 ` [PATCH 09/65] OMAPDSS: pass ovl manager to dss_start_update Tomi Valkeinen
2011-11-23 5:55 ` Archit Taneja
2011-11-23 7:32 ` Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 10/65] OMAPDSS: DISPC: handle 0 out_width/out_height in ovl_setup() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 11/65] OMAPDSS: handle ilace/replication when configuring overlay Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 12/65] OMAPDSS: separate FIFO threshold setup from ovl_setup Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 13/65] OMAPDSS: separate overlay channel " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 14/65] OMAPDSS: setup manager with dispc_mgr_setup() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 15/65] OMAPDSS: DISPC: remove unused functions Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 16/65] OMAPDSS: remove unneeded dss_ovl_wait_for_go() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 17/65] OMAPDSS: add ovl/mgr_manual_update() helpers Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 18/65] OMAPDSS: split omap_dss_mgr_apply() to smaller funcs Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 19/65] OMAPDSS: apply affects only one overlay manager Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 20/65] OMAPDSS: create apply.c Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 21/65] OMAPDSS: hide manager's enable/disable() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 22/65] OMAPDSS: APPLY: track whether a manager is enabled Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 23/65] OMAPDSS: APPLY: skip isr register and config for manual update displays Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 24/65] OMAPDSS: APPLY: skip isr register and config for disabled displays Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 25/65] OMAPDSS: APPLY: cleanup dss_start_update Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 26/65] OMAPDSS: store overlays in an array Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 27/65] OMAPDSS: store managers " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 28/65] OMAPDSS: store overlays in a list for each manager Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 29/65] OMAPDSS: APPLY: separate vsync isr register/unregister Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 30/65] OMAPDSS: DISPC: Add dispc_mgr_get_vsync_irq() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 31/65] OMAPDSS: APPLY: use dispc_mgr_get_vsync_irq() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 32/65] OMAPDSS: APPLY: configure_* funcs take ovl/manager as args Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 33/65] OMAPDSS: APPLY: rename overlay_cache_data Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 34/65] OMAPDSS: APPLY: rename manager_cache_data Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 35/65] OMAPDSS: APPLY: move spinlock outside the struct Tomi Valkeinen
2011-11-23 9:37 ` Archit Taneja [this message]
2011-11-23 9:39 ` Archit Taneja
2011-11-23 10:29 ` Sergey Kibrik
2011-11-23 10:47 ` Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 36/65] OMAPDSS: APPLY: rename dss_cache to dss_data Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 37/65] OMAPDSS: APPLY: move ovl funcs to apply.c Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 38/65] OMAPDSS: APPLY: move mgr " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 39/65] OMAPDSS: remove ovl/mgr check-code temporarily Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 40/65] OMAPDSS: APPLY: add mutex Tomi Valkeinen
2011-11-23 9:49 ` Archit Taneja
2011-11-23 10:17 ` Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 41/65] OMAPDSS: APPLY: add missing uses of spinlock Tomi Valkeinen
2011-11-23 9:57 ` Archit Taneja
2011-11-23 10:12 ` Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd mode displays Tomi Valkeinen
2011-11-23 10:22 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd mode Archit Taneja
2011-11-23 10:42 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd Tomi Valkeinen
2011-11-23 11:20 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd mode Archit Taneja
2011-11-23 11:27 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd Tomi Valkeinen
2011-11-23 12:25 ` [PATCH 42/65] OMAPDSS: DSI: call mgr_enable/disable for cmd mode Archit Taneja
2011-11-22 9:21 ` [PATCH 43/65] OMAPDSS: APPLY: move mgr->enabled to mgr_priv_data Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 44/65] OMAPDSS: APPLY: add busy field " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 45/65] OMAPDSS: APPLY: rewrite overlay enable/disable Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 46/65] OMAPDSS: APPLY: rewrite register writing Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 47/65] OMAPDSS: DISPC: add dispc_mgr_get_framedone_irq Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 48/65] OMAPDSS: APPLY: add updating flag Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 49/65] OMAPDSS: APPLY: clean up isr_handler Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 50/65] OMAPDSS: APPLY: move mgr->info to apply.c Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 51/65] OMAPDSS: APPLY: move ovl->info " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 52/65] OMAPDSS: APPLY: move channel-field to extra_info set Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 53/65] OMAPDSS: APPLY: move fifo thresholds " Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 54/65] OMAPDSS: APPLY: rename dirty & shadow_dirty Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 55/65] OMAPDSS: APPLY: remove device_changed field Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 56/65] OMAPDSS: APPLY: add dss_apply_ovl_enable() Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 57/65] OMAPDSS: APPLY: skip enable/disable if already enabled/disabled Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 58/65] OMAPDSS: APPLY: add wait_pending_extra_info_updates() Tomi Valkeinen
2011-12-07 13:19 ` Archit Taneja
2011-12-07 13:15 ` [PATCH 58/65] OMAPDSS: APPLY: add Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 59/65] OMAPDSS: APPLY: remove runtime_get Tomi Valkeinen
2011-11-22 9:21 ` [PATCH 60/65] OMAPDSS: Add comments about blocking of ovl/mgr functions Tomi Valkeinen
2011-11-22 9:22 ` [PATCH 61/65] OMAPDSS: APPLY: add dss_ovl_simple_check() Tomi Valkeinen
2011-11-22 9:22 ` [PATCH 62/65] OMAPDSS: APPLY: add dss_mgr_simple_check() Tomi Valkeinen
2011-11-22 9:22 ` [PATCH 63/65] OMAPDSS: APPLY: add checking of ovls/mgrs settings Tomi Valkeinen
2011-12-07 13:17 ` Archit Taneja
2011-12-08 8:29 ` [PATCH 63/65] OMAPDSS: APPLY: add checking of ovls/mgrs Tomi Valkeinen
2011-12-13 10:14 ` [PATCH 63/65] OMAPDSS: APPLY: add checking of ovls/mgrs settings Archit Taneja
2011-12-13 11:16 ` [PATCH 63/65] OMAPDSS: APPLY: add checking of ovls/mgrs Tomi Valkeinen
2011-11-22 9:22 ` [PATCH 64/65] OMAPDSS: APPLY: add return value to dss_mgr_enable() Tomi Valkeinen
2011-11-22 9:22 ` [PATCH 65/65] OMAPDSS: check the return value of dss_mgr_enable() 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=4ECCBBFC.10002@ti.com \
--to=a0393947@ti.com \
--cc=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).