public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@nokia.com>
To: "ext Taneja, Archit" <archit@ti.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"Semwal, Sumit" <sumit.semwal@ti.com>,
	"Mittal, Mukund" <mmittal@ti.com>,
	"Nilofer, Samreen" <samreen@ti.com>
Subject: RE: [PATCH v5 3/7] OMAP: DSS2: Introduce omap_channel as a omap_dss_device parameter
Date: Thu, 02 Dec 2010 11:27:10 +0200	[thread overview]
Message-ID: <1291282030.778.9.camel@tubuntu> (raw)
In-Reply-To: <FCCFB4CDC6E5564B9182F639FC356087035EFD6FE6@dbde02.ent.ti.com>

On Thu, 2010-12-02 at 13:27 +0530, ext Taneja, Archit wrote:
> Hi,
> 
> Tomi Valkeinen wrote:
> > Hi,
> > 

> > - The files are getting quite crowded with code that checks
> > for the channel and then do the work with bits/irqs depending
> > on the channel.
> > This makes the code a bit difficult to read. I don't have any
> > clear ideas right now how to make it clearer, but some
> > methods to generalize these kinds of functions would be nice.
> > But this is not so important for the time being, and we can improve it later.
> 
> I am assuming that you are referring to 'DISPC_IRQ_MASK_ERROR' and the registering/unregistering of
> irq masks in manager.c

Not only the irqs, but also, for example, code like this:


        if (channel == OMAP_DSS_CHANNEL_LCD ||
                        channel == OMAP_DSS_CHANNEL_LCD2)
                bit = 5; /* GOLCD */
        else
                bit = 6; /* GODIGIT */

        if (channel == OMAP_DSS_CHANNEL_LCD2)
                return REG_GET(DISPC_CONTROL2, bit, bit) == 1;
        else
                return REG_GET(DISPC_CONTROL, bit, bit) == 1;

So lots of the functions contain ifs based on the channel. I don't know
right now what would be the best way to make the code cleaner (probably
some kinds of look-up tables, but they incur some overhead), and as I
said, it's cosmetical and can be cleaned up later (presuming we come up
with a good way).

> I guess we could have a dss_features function which could return the mask based on what omap
> it is. But this way the mask values/contents would be totally invisble in manager.c and dispc.c, one
> would need to check it in dss_features.c, which also isn't readable.

Right. I agree that that solution isn't perhaps the best one either.

> One thing which I would like to add is that this series doesn't need to touch any board file for now.
> The present dss_recheck_connections() doesn't try to differentiate between LCD and DIGIT channels, it just
> uses 'omap_display_type' to differentiate between them. Only a panel which needs to connect to LCD2 has to do this,
> This method wouldn't have worked if we didn't switch to uniform use of dssdev->manager->id instead of
> dssdev->channel. We will need to change dss_recheck_connections() in the future to make it more uniform.

Ok.

If you can split this patch into the two parts I suggested (if that's ok
for you, you didn't comment on that one), and check if there's anything
to add to the commit descriptions, I think we can go and apply this
patch set.

Btw, on what platforms have you tested this (or generally any patches
you send?). I only have 3430SDP currently that I can easily use to test,
so my testing is a bit limited.

 Tomi



  reply	other threads:[~2010-12-02  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22  7:22 [PATCH v5 0/7] OMAP: DSS2: Overlay Manager LCD2 support in DISPC Archit Taneja
2010-11-22  7:22 ` [PATCH v5 1/7] OMAP: DSS2: Add dss_features for omap4 and overlay manager related features Archit Taneja
2010-11-22  7:23 ` [PATCH v5 2/7] OMAP: DSS2: Represent DISPC register defines with channel as parameter Archit Taneja
2010-11-22  7:23 ` [PATCH v5 3/7] OMAP: DSS2: Introduce omap_channel as a omap_dss_device parameter Archit Taneja
2010-12-01 15:38   ` Tomi Valkeinen
2010-12-02  7:57     ` Taneja, Archit
2010-12-02  9:27       ` Tomi Valkeinen [this message]
2010-12-02  9:47         ` Taneja, Archit
2010-12-02 10:19           ` Tomi Valkeinen
2010-12-02 10:30             ` Taneja, Archit
2010-12-02 11:00               ` Tomi Valkeinen
2010-12-02 11:03                 ` Taneja, Archit
2010-11-22  7:23 ` [PATCH v5 4/7] OMAP: DSS2: Change remaining Dispc functions for new 'channel' argument Archit Taneja
2010-11-22  7:23 ` [PATCH v5 5/7] OMAP: DSS2: LCD2 Channel Changes for DISPC Archit Taneja
2010-11-22  7:23 ` [PATCH v5 6/7] OMAP: DSS2: Use dss_features to handle DISPC bits removed on OMAP4 Archit Taneja
2010-11-22  7:23 ` [PATCH v5 7/7] OMAP: DSS2: Add new Overlay Manager Archit Taneja

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=1291282030.778.9.camel@tubuntu \
    --to=tomi.valkeinen@nokia.com \
    --cc=archit@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mmittal@ti.com \
    --cc=samreen@ti.com \
    --cc=sumit.semwal@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