From patchwork Tue Mar 26 07:40:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10870553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E15C414DE for ; Tue, 26 Mar 2019 07:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE0072909A for ; Tue, 26 Mar 2019 07:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C21DF290AF; Tue, 26 Mar 2019 07:41:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D31862909A for ; Tue, 26 Mar 2019 07:41:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 088C06E78E; Tue, 26 Mar 2019 07:41:06 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0D086E78E for ; Tue, 26 Mar 2019 07:41:04 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Mar 2019 00:41:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,271,1549958400"; d="scan'208";a="137457858" Received: from ipodgorn-mobl.ccr.corp.intel.com (HELO localhost.localdomain) ([10.252.14.78]) by fmsmga007.fm.intel.com with ESMTP; 26 Mar 2019 00:41:03 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Tue, 26 Mar 2019 07:40:53 +0000 Message-Id: <20190326074057.27833-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/4] Device id consolidation X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Series removes device id checks from i915_drv.h macros and consolidates them to i915_pciids.h as the main "database", while making intel_device_info.c reference the former, expanding the existing concept of a platform mask by a few low bits reserved for sub-platform mask. This has a two-fold positive effect of firstly consolidating the list of device ids to one location, and secondly removing the if-ladders from every IS__ call site. Maintenance burden is not completely removed but should be improved. One case in point is that I have found some disagreements between device id listed in i915_pciids.h and i915_drv.h. At the same time platform mask code is generalized to an array of u32 to accomodate the addition of EHL and avoid spilling into u64 which would cause a small code size increase. Downside is that any platforms on the u32 boundary, like currently ICL and EHL, lose the benefit of optimizing the "IS_ICELAKE || IS_ELKHARTLAKE" checks into a single conditional, although at the moment there aren't any such call-sites. Before vs after for the whole series: text data bss dec hex filename 1891093 43903 7424 1942420 1da394 i915.ko.0 1890434 43903 7424 1941761 1da101 i915.ko.1 add/remove: 12/3 grow/shrink: 92/121 up/down: 1974/-1769 (205) ... Total: Before=1286293, After=1286498, chg +0.02% Tvrtko Ursulin (4): drm/i915: Split Pineview device info into desktop and mobile drm/i915: Remove redundant device id from IS_IRONLAKE_M macro drm/i915: Split some PCI ids into separate groups drm/i915: Introduce concept of a sub-platform arch/x86/kernel/early-quirks.c | 3 +- drivers/gpu/drm/i915/i915_drv.c | 8 +- drivers/gpu/drm/i915/i915_drv.h | 133 +++++++++++------ drivers/gpu/drm/i915/i915_gpu_error.c | 3 + drivers/gpu/drm/i915/i915_pci.c | 14 +- drivers/gpu/drm/i915/intel_device_info.c | 145 ++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 27 +++- drivers/gpu/drm/i915/intel_pm.c | 4 +- include/drm/i915_pciids.h | 179 ++++++++++++++++------- 9 files changed, 414 insertions(+), 102 deletions(-) Reviewed-by: Chris Wilson