drm/i915: make user mode sync polarity setting explicit
authorImre Deak <imre.deak@intel.com>
Tue, 30 Jul 2013 10:36:32 +0000 (13:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:21:22 +0000 (17:21 -0700)
commitcc0ffca95bf3e8cd393327c444c5bf4493deda90
tree15a1059b1982d77d5dd6c76dba9ccac5e42100fc
parent97bd47aaaeff070e7907a6a0be78329e8c783feb
drm/i915: make user mode sync polarity setting explicit

commit 2960bc9cceecb5d556ce1c07656a6609e2f7e8b0 upstream.

Userspace can pass a mode with an unspecified vsync/hsync polarity
setting. All encoders in the Intel driver take this to mean a negative
polarity setting. The HW readout/state checker code on the other hand
needs these flags to be explicitly set, otherwise the state checker will
WARN about the mismatch.

Get rid of the WARN by making the polarity setting explicit in the
adjusted mode flags based on the requested mode flags. This will keep
the existing behavior otherwise.

Note that we could guess from the other timing parameters whether the
user wanted a VESA or other standard mode and set the polarity
accordingly. This is what the NV driver does
(drivers/gpu/drm/nouveau/dispnv04/crtc.c), but I think that's not very
exact and would change the existing behavior of the Intel driver.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65442
Signed-off-by: Imre Deak <imre.deak@intel.com>
Tested-by: cancan,feng <cancan.feng@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/i915/intel_display.c