From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
Darren Etheridge <darren.etheridge@gmail.com>,
linux-arm-kernel@lists.infradead.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] drm/i2c: tda998x: fix sync generation and calculation
Date: Thu, 20 Jun 2013 21:06:24 +0100 [thread overview]
Message-ID: <20130620200624.GQ2718@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1371757563-27862-1-git-send-email-sebastian.hesselbarth@gmail.com>
On Thu, Jun 20, 2013 at 09:46:03PM +0200, Sebastian Hesselbarth wrote:
> + ref_pix = 3 + mode->hsync_start - mode->hdisplay;
> + de_pix_s = mode->htotal - mode->hdisplay;
> + de_pix_e = de_pix_s + mode->hdisplay;
> + hs_pix_s = mode->hsync_start - mode->hdisplay;
> + hs_pix_e = hs_pix_s + mode->hsync_end - mode->hsync_start;
Correct, however, these can be simplified.
For de_pix_e:
de_pix_e = de_pix_s + mode->hdisplay;
de_pix_s = mode->htotal - mode->hdisplay;
Putting de_pix_s into de_pix_e's equation, you get:
de_pix_e = mode->htotal - mode->hdisplay + mode->hdisplay;
which ends up simply as:
de_pix_e = mode->htotal;
Now, doing the same for hs_pix_e:
hs_pix_e = mode->hsync_start - mode->hdisplay + mode->hsync_end - mode->hsync_start;
which ends up as:
hs_pix_e = mode->hsync_end - mode->hdisplay;
So overall these come out as:
de_pix_e = mode->htotal;
de_pix_s = mode->htotal - mode->hdisplay;
hs_pix_e = mode->hsync_end - mode->hdisplay;
hs_pix_s = mode->hsync_start - mode->hdisplay;
I've listed them in reverse order because it makes more sense to me when
thinking about it. What we're basically doing is rotating this by
hdisplay pixel clocks to the left, so using abbreviations:
ht=htotal
hds=hdisplay start
hde=hdisplay end
hss=hsync_start
hse=hsync_end
0 ht
hds hde hss hse |
|-----------------------------------|----|---|----|
becomes:
0 ht
0 hss hse hds hde
|----|---|----|-----------------------------------|
and from that you can visualize taking hdisplay (being hde-hds) off each
timing parameter modulo htotal gives you the above equations.
These calculations are the same as what was originally in the driver:
+ de_start = mode->htotal - mode->hdisplay;
+ de_end = mode->htotal;
+ hs_start = mode->hsync_start - mode->hdisplay;
+ hs_end = mode->hsync_end - mode->hdisplay;
when it was first committed.
This is otherwise exactly what I came up with which gets my TV working
again in HDMI mode.
next prev parent reply other threads:[~2013-06-20 20:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-20 19:46 Sebastian Hesselbarth
2013-06-20 20:06 ` Russell King - ARM Linux [this message]
2013-06-20 20:28 ` Sebastian Hesselbarth
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=20130620200624.GQ2718@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=airlied@linux.ie \
--cc=darren.etheridge@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sebastian.hesselbarth@gmail.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
all inboxes | Powered by JetHome®