From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Archit Taneja <a0393947@ti.com>
Cc: Archit Taneja <archit@ti.com>,
linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 4/6] OMAPDSS: MANAGER: Make DISPC timings a manager_info parameter
Date: Thu, 19 Apr 2012 06:37:26 +0000 [thread overview]
Message-ID: <1334817446.1521.57.camel@lappy> (raw)
In-Reply-To: <4F8FAD01.3090406@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3139 bytes --]
On Thu, 2012-04-19 at 11:43 +0530, Archit Taneja wrote:
> On Wednesday 18 April 2012 08:28 PM, Tomi Valkeinen wrote:
> > On Mon, 2012-04-16 at 12:53 +0530, Archit Taneja wrote:
> >> DISPC manager size and DISPC manager blanking parameters(for LCD managers)
> >> follow the shadow register programming model. Currently, they are programmed
> >> directly by the interface drivers.
> >>
> >> Make timings(omap_video_timing struct) an overlay_manager_info member, they are
> >> now programmed via the apply mechanism used for programming shadow registers.
> >>
> >> The interface driver now call the function dss_mgr_set_timings() which applies
> >> the new timing parameters, rather than directly writing to DISPC registers.
> >
> > I don't think that works correctly. The omap_overlay_manager_info is
> > supposed to be set with set_manager_info() by the user of omapdss, to
> > configure the manager's features. The timings are not supposed to be set
> > via that mechanism, but with dssdev->set_timings().
> >
> > This is similar to the info and extra_info for overlay. info has stuff
> > that omapdss doesn't change, it just uses what the user gives.
> > extra_info, on the other hand, has omapdss private stuff that the user
> > does not see. Timings are clearly private stuff in this sense, because
> > they are set via dssdev->set_timings().
> >
> > One reason for this is the programming model we use. If the user of
> > omapdss does get_info() for two overlays, changes the infos, and then
> > calls set_info() for both overlays and finally apply() for the manager,
> > we don't do any locking there because omapdss presumes the info is
> > handled by one user. If, say, the dpi.c would change the info and call
> > apply at the same time, the configuration could go badly wrong.
>
> I think I get your point. So even though get_info() and set_info() fn's
> are spinlock protected, if there are 2 users setting the info, it
> doesn't mean that the info they finally written is correct. Is this
> example the same thing as what you mean ? :
>
> In order of time:
>
> -user 1 gets an overlay's info
>
> -user 2 gets an overlay's info
>
> -user 1 modifies and sets overlay info
>
> -user 2 sets overlay info without the knowledge of what user 1 did.
>
> So even though we ensure these events happen sequentially, we don't
> protect the info across multiple users.
Yes. The spinlocks ensure that the info is "whole", so we don't get a
few fields from user1 and a few fields from user2. But they don't
protect us from the case you described above.
For that we would need a "dss lock" that the user would acquire before
using get_info and set_info. But I don't want to go to that direction,
because we really only support one user anyway.
The problem in this particular case is that omapdss itself becomes
another user if it uses get_info & set_info. And that can be easily
avoided by splitting the configuration into public (the "info") and
internal ("extra_info"). The users of omapdss never touch the
extra_info, and omapdss never touches the info.
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-04-19 6:37 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 7:35 [PATCH 0/6] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-04-16 7:35 ` [PATCH 1/6] OMAPDSS: DISPC/RFBI: Use dispc_mgr_set_lcd_timings() for setting lcd size Archit Taneja
2012-04-16 7:35 ` [PATCH 2/6] OMAPDSS: DISPC: Use a common function to set manager timings Archit Taneja
2012-04-16 7:35 ` [PATCH 3/6] OMAPDSS: DISPC: Clean up manager timing/size functions Archit Taneja
2012-04-16 7:35 ` [PATCH 4/6] OMAPDSS: MANAGER: Make DISPC timings a manager_info parameter Archit Taneja
2012-04-18 14:58 ` Tomi Valkeinen
2012-04-19 6:25 ` Archit Taneja
2012-04-19 6:37 ` Tomi Valkeinen [this message]
2012-04-19 10:20 ` Archit Taneja
2012-04-19 11:37 ` Tomi Valkeinen
2012-04-16 7:35 ` [PATCH 5/6] OMAPDSS: MANAGER: Check validity of manager timings Archit Taneja
2012-04-16 7:35 ` [PATCH 6/6] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-04-19 11:48 ` [PATCH 0/6] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Tomi Valkeinen
2012-04-19 12:10 ` Archit Taneja
2012-04-19 12:00 ` Tomi Valkeinen
2012-05-03 7:19 ` [PATCH v2 0/4] " Archit Taneja
2012-05-03 7:19 ` [PATCH v2 1/4] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-07 14:47 ` Tomi Valkeinen
2012-05-08 4:36 ` Archit Taneja
2012-05-08 7:01 ` Tomi Valkeinen
2012-05-03 7:19 ` [PATCH v2 2/4] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-03 7:19 ` [PATCH v2 3/4] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-03 7:19 ` [PATCH v2 4/4] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-07 15:03 ` Tomi Valkeinen
2012-05-08 5:15 ` Archit Taneja
2012-05-08 7:16 ` Tomi Valkeinen
2012-05-08 7:50 ` Archit Taneja
2012-05-08 8:52 ` Tomi Valkeinen
2012-05-08 9:19 ` Archit Taneja
2012-05-08 10:10 ` [PATCH v3 0/5] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-05-08 10:10 ` [PATCH v3 1/5] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-08 10:10 ` [PATCH v3 2/5] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-08 10:59 ` Tomi Valkeinen
2012-05-08 10:10 ` [PATCH v3 3/5] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-08 10:10 ` [PATCH v3 4/5] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-08 10:50 ` Tomi Valkeinen
2012-05-08 11:34 ` Archit Taneja
2012-05-08 11:55 ` Tomi Valkeinen
2012-05-08 12:47 ` Archit Taneja
2012-05-09 9:56 ` Archit Taneja
2012-05-09 10:15 ` Tomi Valkeinen
2012-05-08 10:10 ` [PATCH v3 5/5] OMAPDSS: DPI/HDMI: Apply manager timings even if panel is disabled Archit Taneja
2012-05-09 10:22 ` [PATCH v4 0/9] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-05-09 10:22 ` [PATCH v4 1/9] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-09 10:22 ` [PATCH v4 2/9] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-09 10:22 ` [PATCH v4 3/9] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-09 10:22 ` [PATCH v4 4/9] OMAPDSS: APPLY: Don't check manager settings if it is disabled Archit Taneja
2012-05-09 10:22 ` [PATCH v4 5/9] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-09 10:22 ` [PATCH v4 6/9] OMAPDSS: DPI/HDMI: Apply manager timings even if panel is disabled Archit Taneja
2012-05-09 10:22 ` [PATCH v4 7/9] OMAPDSS: APPLY: Remove an unnecessary omap_dss_device pointer Archit Taneja
2012-05-09 10:22 ` [PATCH v4 8/9] OMAPDSS: DISPC: Remove omap_dss_device pointer usage from dispc_mgr_pclk_rate() Archit Taneja
2012-05-09 10:22 ` [PATCH v4 9/9] OMAPDSS: DISPC: Remove usage of dispc_mgr_get_device() Archit Taneja
2012-05-09 11:13 ` [PATCH v4 0/9] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Tomi Valkeinen
2012-05-09 11:36 ` Archit Taneja
2012-05-09 11:51 ` 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=1334817446.1521.57.camel@lappy \
--to=tomi.valkeinen@ti.com \
--cc=a0393947@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: 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).