From patchwork Mon Nov 12 17:12:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10679047 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 2631F14BD for ; Mon, 12 Nov 2018 17:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AF3B2A000 for ; Mon, 12 Nov 2018 17:12:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F4642A2CD; Mon, 12 Nov 2018 17:12:49 +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=-4.2 required=2.0 tests=BAYES_00,HK_RANDOM_FROM, 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 062EB2A000 for ; Mon, 12 Nov 2018 17:12:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A12189FAC; Mon, 12 Nov 2018 17:12:48 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC4DF89FAC for ; Mon, 12 Nov 2018 17:12:46 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Nov 2018 09:12:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,496,1534834800"; d="scan'208";a="105598608" Received: from scygan-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.252.10.123]) by fmsmga004.fm.intel.com with ESMTP; 12 Nov 2018 09:12:44 -0800 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Mon, 12 Nov 2018 17:12:35 +0000 Message-Id: <20181112171242.7640-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 0/7] mkwrite_device_info removal 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: , Cc: Jani Nikula Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Some time ago we discussed the long term goal or removing the mkwrite_device_info hack in favour of splitting device info to a truly read-only and runtime halfves. This series attempts to do that. Approach taken is to identify three classes of device info members: 1. Only set in static const tables. 2. Set in static const tables and modified at runtime. 3. Only set at runtime. First set is left as is. Third set is moved from const device_info into a newly created runtime_device_info and all accessors and use sites are converted to look at the new location. Second set is duplicated in both device info structures, but the const copy is only used to copy over the respective members early on driver load. Otherwise the process is the same as for the third group. End result is complete removal of mkwrite_device_info and removal of the embedded copy of device info stored in dev_priv/i915, which is now replaced with a pointer to the actual read-only/static const table. Apart from the conceptual cleanup this has the benefit of making the static tables smaller since they are duplicated by the amount of platforms. And dev_priv/i915 is also smaller since it doesn't hold a copy of the whole device info. On rough edge however is the copying over of group two members on driver load. I haven't found a nice automatic way to do it so at the moment it relies on manually adding lines to i915_driver_create. Last patch of the series if probably best omitted since I think double underscore protection actually works well for preventing mistakes in any future work. Tvrtko Ursulin (7): drm/i915: Remove has_pooled_eu static initializer drm/i915: Introduce runtime device info drm/i915: Move all runtime modified device info fields into runtime info drm/i915: Remove mkwrite_device_info drm/i915: Move gen and platform mask to runtime device info drm/i915: Introduce subplatform concept drm/i915: Remove double underscore from static device info member names drivers/gpu/drm/i915/i915_debugfs.c | 31 ++- drivers/gpu/drm/i915/i915_drv.c | 71 +++++-- drivers/gpu/drm/i915/i915_drv.h | 191 ++++++++---------- drivers/gpu/drm/i915/i915_gem.c | 5 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 2 +- drivers/gpu/drm/i915/i915_gpu_error.c | 19 +- drivers/gpu/drm/i915/i915_gpu_error.h | 1 + drivers/gpu/drm/i915/i915_irq.c | 2 +- drivers/gpu/drm/i915/i915_pci.c | 5 +- drivers/gpu/drm/i915/i915_perf.c | 5 +- drivers/gpu/drm/i915/i915_query.c | 2 +- drivers/gpu/drm/i915/i915_reg.h | 190 ++++++++--------- drivers/gpu/drm/i915/intel_bios.c | 2 +- drivers/gpu/drm/i915/intel_device_info.c | 178 +++++++++++----- drivers/gpu/drm/i915/intel_device_info.h | 82 ++++++-- drivers/gpu/drm/i915/intel_display.c | 20 +- drivers/gpu/drm/i915/intel_display.h | 10 +- drivers/gpu/drm/i915/intel_engine_cs.c | 9 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 4 +- drivers/gpu/drm/i915/intel_guc_submission.c | 4 +- drivers/gpu/drm/i915/intel_i2c.c | 2 +- drivers/gpu/drm/i915/intel_lpe_audio.c | 2 +- drivers/gpu/drm/i915/intel_lrc.c | 14 +- drivers/gpu/drm/i915/intel_pm.c | 11 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 4 +- drivers/gpu/drm/i915/intel_ringbuffer.h | 4 +- drivers/gpu/drm/i915/intel_uncore.c | 4 +- drivers/gpu/drm/i915/intel_workarounds.c | 6 +- drivers/gpu/drm/i915/selftests/huge_pages.c | 18 +- .../gpu/drm/i915/selftests/i915_gem_context.c | 6 +- drivers/gpu/drm/i915/selftests/intel_guc.c | 4 +- drivers/gpu/drm/i915/selftests/intel_lrc.c | 4 +- .../gpu/drm/i915/selftests/mock_gem_device.c | 11 +- 34 files changed, 527 insertions(+), 398 deletions(-) Cc: Chris Wilson Cc: Jani Nikula