From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: mythripk@ti.com
Cc: linux-omap@vger.kernel.org
Subject: Re: [PATCH v3 3/4] OMAPDSS: HDMI: change the timing match logic
Date: Thu, 05 Jan 2012 09:21:50 +0200 [thread overview]
Message-ID: <1325748110.2045.23.camel@deskari> (raw)
In-Reply-To: <1325675397-15241-4-git-send-email-mythripk@ti.com>
[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]
On Wed, 2012-01-04 at 16:39 +0530, mythripk@ti.com wrote:
> From: Mythri P K <mythripk@ti.com>
>
> Change the timing match logic, Instead of the statically mapped method
> to get the corresponding timings for a given code and mode, move to a
> simpler array indexed method. It will help to scale up to add more
> timings when needed.
>
> Signed-off-by: Mythri P K <mythripk@ti.com>
> ---
> drivers/video/omap2/dss/hdmi.c | 177 +++++++++++++++++----------------------
> 1 files changed, 77 insertions(+), 100 deletions(-)
> -static int get_timings_index(void)
> +static const struct hdmi_config *hdmi_find_timing(
> + const struct hdmi_config *timings_arr,
> + int len)
> {
> - int code;
> + int i;
> + const struct hdmi_config *timing = NULL;
>
> - if (hdmi.mode == 0)
> - code = code_vesa[hdmi.code];
> - else
> - code = code_cea[hdmi.code];
> + for (i = 0; i < len; i++) {
> + if (timings_arr[i].cm.code == hdmi.code) {
> + timing = &timings_arr[i];
> + return timing;
> + }
> + }
> + return timing;
You don't need the timing variable at all. Just return &timings_arr[i]
or NULL.
> @@ -341,9 +312,15 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
> dssdev->panel.timings.x_res,
> dssdev->panel.timings.y_res);
>
> - code = get_timings_index();
> - update_hdmi_timings(&hdmi.ip_data.cfg, p, code);
> -
> + if (hdmi_get_timings() == NULL) {
> + /* HDMI code 4 corresponds to 640 * 480 VGA */
> + hdmi.code = 4;
> + /* DVI mode 1 corresponds to HDMI 0 to DVI */
> + hdmi.mode = HDMI_DVI;
> + hdmi.ip_data.cfg = vesa_timings[0];
> + } else {
> + hdmi.ip_data.cfg = *(hdmi_get_timings());
> + }
Now you are searching for the timings twice... Do:
timings = hdmi_get_timings();
if (timings == NULL) {
/* default to VGA */
...
} else {
hdmi.ip_data.cfg = *timings;
}
Tomi
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-01-05 7:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-04 11:09 [PATCH v3 0/4] OMAPDSS: HDMI: Improve the timings logic in HDMI mythripk
2012-01-04 11:09 ` [PATCH v3 1/4] OMAPDSS: HDMI: remove duplicate video interface code mythripk
2012-01-04 11:09 ` [PATCH v3 2/4] OMAPDSS: HDMI: update static timing table mythripk
2012-01-04 11:09 ` [PATCH v3 3/4] OMAPDSS: HDMI: change the timing match logic mythripk
2012-01-04 11:09 ` [PATCH v3 4/4] OMAPDSS: HDMI: remove duplicate code and mode parameter mythripk
2012-01-05 7:21 ` Tomi Valkeinen [this message]
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=1325748110.2045.23.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;
as well as URLs for NNTP newsgroup(s).