drm/i915: Check encoder type in enc_to_dig_port()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 24 Feb 2017 14:18:45 +0000 (16:18 +0200)
committerAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Mon, 27 Feb 2017 07:07:59 +0000 (09:07 +0200)
commit9a5da00b7ce0dec87fc0707c5cd17fed03e183cd
tree6a67523e10a8fd4425b71fa5cc38d53a65c7a958
parent79f255a0c99cf5d871161959d91bd7ba711f949f
drm/i915: Check encoder type in enc_to_dig_port()

Don't allow conversion from arbitraty encoder types to a digital port.
Calling enc_to_dig_port() with the wrong encoder may seem far fetched,
but certain paths of the ddi code may be called with hasell's analog
encoder and the conversion is wrong for DP mst encoders too, so safe
guard against it.

v2: Warn if encoder type is unknown and device is not DDI. (Imre)
v3: Remove stray hunk from rebase error. (Ander)
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170224141845.5836-1-ander.conselvan.de.oliveira@intel.com
drivers/gpu/drm/i915/intel_drv.h