<br><div class="gmail_quote">On Wed, Dec 26, 2012 at 5:01 PM, Daniel Kurtz <span dir="ltr"><<a href="mailto:djkurtz@chromium.org" target="_blank">djkurtz@chromium.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It is a bit more precise to compute the total number of pixels first and<br>
then divide, rather than multiplying the line pixel count by the<br>
already-rounded line duration.<br>
<br>
Signed-off-by: Daniel Kurtz <<a href="mailto:djkurtz@chromium.org">djkurtz@chromium.org</a>><br></blockquote><div><br></div><div>Ping?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
drivers/gpu/drm/drm_irq.c | 6 +++++-<br>
1 files changed, 5 insertions(+), 1 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c<br>
index 19c01ca..05c91e0 100644<br>
--- a/drivers/gpu/drm/drm_irq.c<br>
+++ b/drivers/gpu/drm/drm_irq.c<br>
@@ -505,6 +505,7 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc)<br>
<br>
/* Valid dotclock? */<br>
if (dotclock > 0) {<br>
+ int frame_size;<br>
/* Convert scanline length in pixels and video dot clock to<br>
* line duration, frame duration and pixel duration in<br>
* nanoseconds:<br>
@@ -512,7 +513,10 @@ void drm_calc_timestamping_constants(struct drm_crtc *crtc)<br>
pixeldur_ns = (s64) div64_u64(1000000000, dotclock);<br>
linedur_ns = (s64) div64_u64(((u64) crtc->hwmode.crtc_htotal *<br>
1000000000), dotclock);<br>
- framedur_ns = (s64) crtc->hwmode.crtc_vtotal * linedur_ns;<br>
+ frame_size = crtc->hwmode.crtc_htotal *<br>
+ crtc->hwmode.crtc_vtotal;<br>
+ framedur_ns = (s64) div64_u64((u64) frame_size * 1000000000,<br>
+ dotclock);<br>
} else<br>
DRM_ERROR("crtc %d: Can't calculate constants, dotclock = 0!\n",<br>
crtc-><a href="http://base.id" target="_blank">base.id</a>);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.7.3<br>
<br>
</font></span></blockquote></div><br>