Commit 2d19b35b authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Stefan Bader

drm/i915: Ignore OpRegion panel type except on select machines

BugLink: http://bugs.launchpad.net/bugs/1770565

Turns out
commit a0562819 ("drm/i915: Get panel_type from OpRegion panel
details") has regressed quite a few machines. So it looks like we
can't use the panel type from OpRegion on all systems, and yet we
absolutely must use it on some specific systems.

Despite trying, I was unable to find any automagic way to determine
if the OpRegion panel type is respectable or not. The only glimmer
of hope I had was bit 8 in the SCIC response, but that turned out to
not work either (it was always 0 on both types of systems).

So, to fix the regressions without breaking the machine we know to need
the OpRegion panel type, let's just add a quirk for this. Only specific
machines known to require the OpRegion panel type will therefore use
it. Everyone else will fall bck to the VBT panel type.

The only known machine so far is a "Conrac GmbH IX45GM2". The PCI
subsystem ID on this machine is just a generic 8086:2a42, so of no use.
Instead we'll go with a DMI match.

I suspect we can now also revert
commit aeddda06 ("drm/i915: Ignore panel type from OpRegion on SKL")
but let's leave that to a separate patch.

v2: Do the DMI match in the opregion code directly, as dev_priv->quirks
    gets populated too late

Cc: Rob Kramer <rob@solution-space.com>
Cc: Martin van Es <martin@mrvanes.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Dave Airlie <airlied@linux.ie>
Cc: Marco Krüger <krgsch@gmail.com>
Cc: Sean Greenslade <sean@seangreenslade.com>
Cc: Trudy Tective <bertslany@gmail.com>
Cc: Robin Müller <rm1990@gmx.de>
Cc: Alexander Kobel <a-kobel@a-kobel.de>
Cc: Alexey Shumitsky <alexey.shumitsky@gmail.com>
Cc: Emil Andersen Lauridsen <mine809@gmail.com>
Cc: oceans112@gmail.com
Cc: James Hogan <james@albanarts.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: stable@vger.kernel.org
References: https://lists.freedesktop.org/archives/intel-gfx/2016-August/105545.html
References: https://lists.freedesktop.org/archives/dri-devel/2016-August/116888.html
References: https://lists.freedesktop.org/archives/intel-gfx/2016-June/098826.html
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94825
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97060
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97443
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97363
Fixes: a0562819 ("drm/i915: Get panel_type from OpRegion panel details")
Tested-by: default avatarMarco Krüger <krgsch@gmail.com>
Tested-by: default avatarAlexey Shumitsky <alexey.shumitsky@gmail.com>
Tested-by: default avatarSean Greenslade <sean@seangreenslade.com>
Tested-by: default avatarEmil Andersen Lauridsen <mine809@gmail.com>
Tested-by: default avatarRobin Müller <rm1990@gmx.de>
Tested-by: oceans112@gmail.com
Tested-by: default avatarRob Kramer <rob@solution-space.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1473758539-21565-1-git-send-email-ville.syrjala@linux.intel.com
References: http://patchwork.freedesktop.org/patch/msgid/1473602239-15855-1-git-send-email-adrienverge@gmail.comAcked-by: default avatarJani Nikula <jani.nikula@intel.com>

(cherry picked from commit c8ebfad7)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
(cherry picked from commit ea54ff40)
Signed-off-by: default avatarTimo Aaltonen <timo.aaltonen@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent bd681e08
...@@ -1013,6 +1013,23 @@ int intel_opregion_setup(struct drm_device *dev) ...@@ -1013,6 +1013,23 @@ int intel_opregion_setup(struct drm_device *dev)
return err; return err;
} }
static int intel_use_opregion_panel_type_callback(const struct dmi_system_id *id)
{
DRM_INFO("Using panel type from OpRegion on %s\n", id->ident);
return 1;
}
static const struct dmi_system_id intel_use_opregion_panel_type[] = {
{
.callback = intel_use_opregion_panel_type_callback,
.ident = "Conrac GmbH IX45GM2",
.matches = {DMI_MATCH(DMI_SYS_VENDOR, "Conrac GmbH"),
DMI_MATCH(DMI_PRODUCT_NAME, "IX45GM2"),
},
},
{ }
};
int int
intel_opregion_get_panel_type(struct drm_device *dev) intel_opregion_get_panel_type(struct drm_device *dev)
{ {
...@@ -1038,6 +1055,16 @@ intel_opregion_get_panel_type(struct drm_device *dev) ...@@ -1038,6 +1055,16 @@ intel_opregion_get_panel_type(struct drm_device *dev)
return -ENODEV; return -ENODEV;
} }
/*
* So far we know that some machined must use it, others must not use it.
* There doesn't seem to be any way to determine which way to go, except
* via a quirk list :(
*/
if (!dmi_check_system(intel_use_opregion_panel_type)) {
DRM_DEBUG_KMS("Ignoring OpRegion panel type (%d)\n", ret - 1);
return -ENODEV;
}
/* /*
* FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us * FIXME On Dell XPS 13 9350 the OpRegion panel type (0) gives us
* low vswing for eDP, whereas the VBT panel type (2) gives us normal * low vswing for eDP, whereas the VBT panel type (2) gives us normal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment