public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: "K, Mythri P" <mythripk@ti.com>
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH 0/8] HDMI: Split hdmi.c to seperate HDMI IP dependant code from DSS.
Date: Thu, 23 Jun 2011 15:31:14 +0300	[thread overview]
Message-ID: <1308832274.1834.109.camel@deskari> (raw)
In-Reply-To: <BANLkTinc9JUr-gBGSynzMtrqTVncDUbNKQ@mail.gmail.com>

On Thu, 2011-06-23 at 17:35 +0530, K, Mythri P wrote:
> Hi Tomi,
> 
> On Thu, Jun 23, 2011 at 3:28 PM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> > On Fri, 2011-06-17 at 13:47 +0530, Mythri P K wrote:
> >> HDMI IP block is common between TI OMAP4 Procerssor and Netra processor although
> >> the Display subsytem is different. Thus to reuse the code between these two
> >> processors , HDMI IP dependant code is seperated out from hdmi.c and moved to
> >> new library file hdmi_ti_4xxx_ip.c which now resides in /drivers/video a more
> >> generic location out of omap2/dss folder.
> >>
> >> This patch series does the split and also renames hdmi_omap4_panel.c to
> >> hdmi_panel.c as that file has nothing specific to OMAP4 and can be reused for
> >> other OMAP family of processors as well.
> >
> > These comments are based on the branch you have, not to particular
> > patches:
> >
> > include/video/hdmi_ti_4xxx_ip.h:
> >
> > - This file is in a way the most important one, because it's the public
> > API of the component. So you should be extra careful with this, and see
> > that everything in it makes sense, and it's clear how it is to be used.
> >
> > - hdmi_core_hdmi_dvi is defined but not used. Should it be in the
> > private header?
> 
>  HDMI_HDMI  and HDMI_DVI are used everywhere in hdmi.c and hdmi_ti_4xxx_ip.c,
> one thing  i could do is to add a patch to used this enumerator
> instead of int mode ?

Oh, so the "int mode" in the header is actually "enum hdmi_core_hdmi_dvi
mode"? Using int is obviously wrong, then.

> > - hdmi_pll_pwr seems to be very low level thing. It requires the user to
> > know HW details about the PLL, I don't think it should be visible to the
> > users. It is used in parameters for hdmi_ti_4xxx_set_pll_pwr(). When is
> > it supposed to be used? Why is hdmi_ti_4xxx_wp_video_start() not enough?
> >
> HDMI has core , PLL and PHY blocks, so user of the ip driver should
> configure them separately.

Why? Is there some requirement/benefit to it?

> > - The same goes to hdmi_ti_4xxx_pll_program. Who does the PLL
> > calculations, omapdss driver? Shouldn't the HDMI driver do it, the PLL
> > is a HDMI HW thing, not DSS HW? Or if they are defined in the board
> > file, and omapdss just gives them to the HDMI driver, I think the data
> > should be somehow passed through omapdss without omapdss actively
> > participating in the PLL programming. This would be easy if the HDMI
> > would use a platform device/driver model, the data could be passed via
> > the device data.

Can you comment on this? Why the PLL calculation is not in the HDMI IP
driver?

> > - If the PLL calculations have to be done by omapdss, couldn't the
> > hdmi_pll_info be part of hdmi_config?
> 
> hdmi_pll_info would be used only once while configuring (power on) ,
> Why would we have to store the pll_info then in hdmi_config?

Whether you store the hdmi_pll_info or not is HDMI IP driver internal
thing, not related to the API. We're talking about the API here.

Look at the include/video/hdmi_ti_4xxx_ip.h file and think from the
users view point: what is the most obvious and easiest way to use the
API. Then make the HDMI IP driver work with the API.

> > - Is hdmi_ti_4xxx_phy_off the counterpart of hdmi_ti_4xxx_phy_init? If
> > so, the naming could be better to clearly show this. Like init/uninit,
> > enable/disable, etc.
> 
> I shall rename. yes phy_off is counterpart of init , i shall renmane
> it to enable ,disable.
> >
> > - Is the "phy" relevant (from the user's point of view) in
> > hdmi_ti_4xxx_phy_init and off? Or could they be just init and uninit?
> 
> PHY is a seperate block in HDMI and even from the user point of view
> user should be aware of PHY, PLL and core blocks. so phy_init is
> relevant.

Again, why? Why cannot the user just give the configurations to the HDMI
IP driver, and start it, without knowing anything about PHY/PLL/core.

> > - Perhaps hdmi_ti_4xxx_basic_configure could be just configure, there's
> > no advanced configure or similar.
> Well, makes sense but this is the init_configuration(default
> configuration) is what was intended in the patch.
> >
> > - is the "wp" important in hdmi_ti_4xxx_wp_video_start?
> >
> yes wp == wrapper , so it would be clear to have a wp_video_Start.

Why does the user need to know wp == wrapper? Isn't the function just
about enabling the video output?

> > - read_ti_4xxx_edid() is named differently than the other functions.
> >
> I shall rename to hdmi_ti_4xxx_read_edid.
> 
> > drivers/video/hdmi_ti_4xxx_ip.c:
> >
> > - EXPORT_SYMBOL(hdmi_ti_4xxx_phy_init); is not below the function.
> >
> > drivers/video/omap2/dss/hdmi.c:
> >
> > - hdmi_ti_4xxx_set_pll_pwr() is only called in power_off(), but never
> > enabled. I presume the HDMI driver does that internally. That doesn't
> > sound like a valid use of the function.
> 
> It is enabled in hdmi_ti_4xxx_pll_program called from power on.

Yes, I can see that. But it's bad usage pattern. Never enable something
in one component, and disable it in another. The same entity has to do
them both.

> > - Looking at hdmi_power_on(), I feel that the API of the HDMI driver
> > could be simpler. Would it be enough to have just one function to setup
> > the HDMI, and another to turn the output on?
> No , I suppose it is the responsibility of the user of IP driver to
> configure PHY , PLL and CORE blocks seperately as we can reuse the PLL
> or PHY block in different SOC's as well.

Well, in that case, shouldn't PHY, PLL and CORE be in separate drivers?
If they are all in one HDMI IP driver, I don't see why the user would
need to know about PHY/PLL/CORE at all. The user just wants to use the
HDMI IP as a whole, doesn't it?

> > - omapdss_hdmi_display_set_timing() seems to be broken. It just sets
> > some variables and calls display_enable().
> It sets a variable custom_set , appropriate action will be taken while
> configuring timings based on that parameter.

This is the same thing as with the use of hdmi_ti_4xxx_set_pll_pwr.
Well, actually not, this is worse. A "set_timing" function which
unconditionally calls omapdss_hdmi_display_enable() makes no sense to
me. Why would set_timing function enable the display? And even more
importantly, omapdss_hdmi_display_enable() won't work correctly if it is
called unevenly related to omapdss_hdmi_display_disable(), which will
happen here.

 Tomi



  reply	other threads:[~2011-06-23 12:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-17  8:17 [PATCH 0/8] HDMI: Split hdmi.c to seperate HDMI IP dependant code from DSS Mythri P K
2011-06-17  8:17 ` [PATCH 1/8] OMAP4: DSS: HDMI: HDMI clean up to pass base_address Mythri P K
2011-06-17  8:17   ` [PATCH 2/8] OMAP4 : DSS : HDMI : Move the EDID portion from HDMI IP Mythri P K
2011-06-17  8:17     ` [PATCH 3/8] OMAP4: DSS: HDMI: Use specific HDMI timings structure Mythri P K
2011-06-17  8:17       ` [PATCH 4/8] OMAP4: DSS: HDMI: Move the common header file definition Mythri P K
2011-06-17  8:17         ` [PATCH 5/8] OMAP4: DSS2: HDMI: Split the HDMI driver to DSS and IP Mythri P K
2011-06-17  8:17           ` [PATCH 6/8] OMAP4: DSS: HDMI: Rename the functions in HDMI IP Mythri P K
2011-06-17  8:17             ` [PATCH 7/8] HDMI: Move HDMI IP Library from OMAP DSS to common Mythri P K
2011-06-17  8:17               ` [PATCH 8/8] OMAP4: DSS: Rename hdmi_omap4_panel.c to hdmi_panel.c Mythri P K
2011-06-20 13:48           ` [PATCH 5/8] OMAP4: DSS2: HDMI: Split the HDMI driver to DSS and IP Premi, Sanjeev
2011-06-23  5:55             ` K, Mythri P
2011-06-20 12:46       ` [PATCH 3/8] OMAP4: DSS: HDMI: Use specific HDMI timings structure Premi, Sanjeev
2011-06-23  5:45         ` K, Mythri P
2011-06-23  8:30       ` Tomi Valkeinen
2011-06-23  8:46         ` K, Mythri P
2011-06-20 13:33   ` [PATCH 1/8] OMAP4: DSS: HDMI: HDMI clean up to pass base_address Premi, Sanjeev
2011-06-23  5:51     ` K, Mythri P
2011-06-23 10:30       ` Premi, Sanjeev
2011-06-23 11:00         ` K, Mythri P
2011-06-23 11:03           ` Premi, Sanjeev
2011-06-23 11:09             ` K, Mythri P
2011-06-23  9:58 ` [PATCH 0/8] HDMI: Split hdmi.c to seperate HDMI IP dependant code from DSS Tomi Valkeinen
2011-06-23 12:05   ` K, Mythri P
2011-06-23 12:31     ` Tomi Valkeinen [this message]
2011-06-27  5:51       ` K, Mythri P
2011-06-27 12:58         ` Tomi Valkeinen
2011-06-29 13:38           ` K, Mythri P
2011-06-29 16:21             ` Tomi Valkeinen
2011-06-30 17:46               ` K, Mythri P
2011-07-01  8:51                 ` Tomi Valkeinen
2011-07-01  9:22                   ` K, Mythri P
2011-07-01 11:44                     ` Tomi Valkeinen
2011-07-01 12:43                       ` K, Mythri P

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=1308832274.1834.109.camel@deskari \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=mythripk@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