From patchwork Fri Oct 9 20:08:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Lutomirski X-Patchwork-Id: 52803 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n99K8iGU026839 for ; Fri, 9 Oct 2009 20:08:44 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8D149EBED; Fri, 9 Oct 2009 13:08:42 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-bw0-f208.google.com (mail-bw0-f208.google.com [209.85.218.208]) by gabe.freedesktop.org (Postfix) with ESMTP id EDC1B9E7A6 for ; Fri, 9 Oct 2009 13:08:40 -0700 (PDT) Received: by bwz4 with SMTP id 4so1882495bwz.24 for ; Fri, 09 Oct 2009 13:08:39 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.14.22 with SMTP id e22mr1043536faa.42.1255118919310; Fri, 09 Oct 2009 13:08:39 -0700 (PDT) Date: Fri, 9 Oct 2009 16:08:39 -0400 X-Google-Sender-Auth: cf24572f80886d8c Message-ID: From: Andrew Lutomirski To: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [RFC/PATCH] render reclock quirks X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 4337414..6a4bff5 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -29,10 +29,15 @@ #include "i915_drm.h" #include "i915_drv.h" #include "intel_bios.h" +#include #define SLAVE_ADDR1 0x70 #define SLAVE_ADDR2 0x72 +static bool render_reclock_quirk_avail; +static bool force_render_reclock; +module_param(force_render_reclock, bool, 0400); + static void * find_section(struct bdb_header *bdb, int section_id) { @@ -351,21 +356,51 @@ parse_driver_features(struct drm_i915_private *dev_priv, struct drm_device *dev = dev_priv->dev; struct bdb_driver_features *driver; - /* set default for chips without eDP */ - if (!SUPPORTS_EDP(dev)) { - dev_priv->edp_support = 0; - return; - } - + /* Due to quirks, we continue even if driver == NULL. */ driver = find_section(bdb, BDB_DRIVER_FEATURES); - if (!driver) - return; - if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP) + if (driver && SUPPORTS_EDP(dev) && driver->lvds_config == BDB_DRIVER_FEATURE_EDP) dev_priv->edp_support = 1; + else + dev_priv->edp_support = 0; - if (driver->dual_frequency) + if (driver && driver->dual_frequency) { + dev_priv->render_reclock_avail = true; + } else if (render_reclock_quirk_avail) { + dev_priv->render_reclock_avail = true; + printk(KERN_INFO "i915: Quirk-enabling render reclocking\n"); + } else if (force_render_reclock) { dev_priv->render_reclock_avail = true; + printk(KERN_WARNING "i915: Force-enabled render reclocking. If this works, please\n" + " email dmesg and dmidecode output to intel-gfx@lists.freedesktop.org\n"); + } else { + printk(KERN_INFO "i915: Your VBIOS does not support render reclocking.\n" + " Set the module parameter force_render_reclock=1 to try forcing it on."); + } +} + +static int render_reclock_quirk(const struct dmi_system_id *d) +{ + render_reclock_quirk_avail = true; + return 0; +} + +static void +load_quirks(void) +{ + static const struct dmi_system_id sysids[] = { + { + .ident = "Lenovo X200s", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), + DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X200s"), + }, + .callback = render_reclock_quirk, + }, + {} + }; +