From patchwork Mon Jul 18 13:08:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prarit Bhargava X-Patchwork-Id: 986122 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6ID9Cu9030180 for ; Mon, 18 Jul 2011 13:09:32 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 371A79EFE2 for ; Mon, 18 Jul 2011 06:09:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 069019E890 for ; Mon, 18 Jul 2011 06:09:01 -0700 (PDT) Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6ID91W9022382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 18 Jul 2011 09:09:01 -0400 Received: from localhost.localdomain (prarit.bos.redhat.com [10.16.16.23]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6ID8nvI005963; Mon, 18 Jul 2011 09:09:00 -0400 From: Prarit Bhargava To: linux-kernel@vger.kernel.org Subject: [PATCH 10/34] drivers/gpu changes for SMBIOS and System Firmware Date: Mon, 18 Jul 2011 09:08:24 -0400 Message-Id: <1310994528-26276-11-git-send-email-prarit@redhat.com> In-Reply-To: <1310994528-26276-1-git-send-email-prarit@redhat.com> References: <1310994528-26276-1-git-send-email-prarit@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Cc: Prarit Bhargava , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 18 Jul 2011 13:09:32 +0000 (UTC) As part of the new SMBIOS and System Firmware code: - Replace old dmi* structures and functions with new sysfw* and smbios* structures and functions in individual drivers - cleanup sysfw_id lookup tables - cleanup of includes for dmi.h and mod_devicetable.h which were included in some files that did not need them Cc: dri-devel@lists.freedesktop.org Acked-by: Chris Wilson Signed-off-by: Prarit Bhargava --- drivers/gpu/drm/i915/intel_lvds.c | 81 ++++++++++++++++++------------------- drivers/gpu/vga/vga_switcheroo.c | 1 - 2 files changed, 40 insertions(+), 42 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index b28f7bd..5d59058 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c @@ -28,7 +28,7 @@ */ #include -#include +#include #include #include #include "drmP.h" @@ -502,20 +502,20 @@ static int intel_lvds_get_modes(struct drm_connector *connector) return 1; } -static int intel_no_modeset_on_lid_dmi_callback(const struct dmi_system_id *id) +static int intel_no_modeset_on_lid_callback(const struct sysfw_id *id) { DRM_DEBUG_KMS("Skipping forced modeset for %s\n", id->ident); return 1; } /* The GPU hangs up on these systems if modeset is performed on LID open */ -static const struct dmi_system_id intel_no_modeset_on_lid[] = { +static const struct sysfw_id intel_no_modeset_on_lid[] = { { - .callback = intel_no_modeset_on_lid_dmi_callback, + .callback = intel_no_modeset_on_lid_callback, .ident = "Toshiba Tecra A11", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), - DMI_MATCH(DMI_PRODUCT_NAME, "TECRA A11"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "TOSHIBA"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "TECRA A11"), }, }, @@ -551,7 +551,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val, false); /* Don't force modeset on machines where it causes a GPU lockup */ - if (dmi_check_system(intel_no_modeset_on_lid)) + if (sysfw_callback(intel_no_modeset_on_lid)) return NOTIFY_OK; if (!acpi_lid_open()) { dev_priv->modeset_on_lid = 1; @@ -648,95 +648,94 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = { .destroy = intel_encoder_destroy, }; -static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id) +static int __init intel_no_lvds_callback(const struct sysfw_id *id) { DRM_DEBUG_KMS("Skipping LVDS initialization for %s\n", id->ident); return 1; } /* These systems claim to have LVDS, but really don't */ -static const struct dmi_system_id intel_no_lvds[] = { +static const struct sysfw_id intel_no_lvds[] = { { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Apple Mac Mini (Core series)", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Apple"), - DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini1,1"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Apple Mac Mini (Core 2 series)", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Apple"), - DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "Apple"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Macmini2,1"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "MSI IM-945GSE-A", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "MSI"), - DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "MSI"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "A9830IMS"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Dell Studio Hybrid", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "Dell Inc."), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "Studio Hybrid 140g"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "AOpen Mini PC", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "AOpen"), - DMI_MATCH(DMI_PRODUCT_NAME, "i965GMx-IF"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "AOpen"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "i965GMx-IF"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "AOpen Mini PC MP915", .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), - DMI_MATCH(DMI_BOARD_NAME, "i915GMx-F"), + SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"), + SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMx-F"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "AOpen i915GMm-HFS", .matches = { - DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"), - DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"), + SYSFW_MATCH(SYSFW_BOARD_VENDOR, "AOpen"), + SYSFW_MATCH(SYSFW_BOARD_NAME, "i915GMm-HFS"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Aopen i945GTt-VFA", .matches = { - DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"), + SYSFW_MATCH(SYSFW_PRODUCT_VERSION, "AO00001JW"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Clientron U800", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Clientron"), - DMI_MATCH(DMI_PRODUCT_NAME, "U800"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "Clientron"), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "U800"), }, }, { - .callback = intel_no_lvds_dmi_callback, + .callback = intel_no_lvds_callback, .ident = "Asus EeeBox PC EB1007", .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer INC."), - DMI_MATCH(DMI_PRODUCT_NAME, "EB1007"), + SYSFW_MATCH(SYSFW_SYS_VENDOR, "ASUSTeK Computer INC."), + SYSFW_MATCH(SYSFW_PRODUCT_NAME, "EB1007"), }, }, - - { } /* terminating entry */ + {} }; /** @@ -862,7 +861,7 @@ bool intel_lvds_init(struct drm_device *dev) u8 pin; /* Skip init on machines we know falsely report LVDS */ - if (dmi_check_system(intel_no_lvds)) + if (sysfw_callback(intel_no_lvds)) return false; pin = GMBUS_PORT_PANEL; diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 58434e8..1a9139c 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -18,7 +18,6 @@ */ #include -#include #include #include #include