]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Fix scanoutpos calculations
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 11 Oct 2013 16:10:32 +0000 (19:10 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 14 Oct 2013 15:11:48 +0000 (17:11 +0200)
commit2c621574064d6b64eecf02a083336e3c1996247f
treea667e39eca9ccf0cca05fd53fb806e5592dcf611
parent5c8c0a7a8098405777a5315ad26c3b638d889606
drm/i915: Fix scanoutpos calculations

The reported scanout position must be relative to the end of vblank.
Currently we manage to fumble that in a few ways.

First we don't consider the case when vtotal != vbl_end. While that
isn't very common (happens maybe only w/ old panel fitting hardware),
we can fix it easily enough.

The second issue is that on pre-CTG hardware we convert the pixel count
to horizontal/vertical components at the very beginning, and then forget
to adjust the horizontal component to be relative to vbl_end. So instead
we should keep our numbers in the pixel count domain while we're
adjusting the position to be relative to vbl_end. Then when we do the
conversion in the end, both vertical _and_ horizontal components will
come out correct.

v2: Change position to int from u32 to avoid sign issues

Cc: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: mario.kleiner.de@gmail.com
Tested-by: mario.kleiner.de@gmail.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c