From patchwork Wed Mar 13 23:13:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Ceraolo Spurio X-Patchwork-Id: 10851891 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 175466C2 for ; Wed, 13 Mar 2019 23:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0541929F12 for ; Wed, 13 Mar 2019 23:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB70B29FAC; Wed, 13 Mar 2019 23:13:32 +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 86C0629F12 for ; Wed, 13 Mar 2019 23:13:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 604036E10E; Wed, 13 Mar 2019 23:13:31 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CF326E10E for ; Wed, 13 Mar 2019 23:13:29 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2019 16:13:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,476,1544515200"; d="scan'208";a="307013618" Received: from dceraolo-linux.fm.intel.com ([10.1.27.134]) by orsmga005.jf.intel.com with ESMTP; 13 Mar 2019 16:13:28 -0700 From: Daniele Ceraolo Spurio To: intel-gfx@lists.freedesktop.org Date: Wed, 13 Mar 2019 16:13:09 -0700 Message-Id: <20190313231319.711-1-daniele.ceraolospurio@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 00/10] Compartmentalize uncore code 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: Paulo Zanoni Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP In some areas of the driver we do a really bad job in compartmentalizing the code. While passing dev_priv everywhere is always an easy solution, our driver is growing in ways in which this is getting in the way. We really want to compartmentalize our classes and keep as much code as we can under a controlled scope without relying on the God Object dev_priv. This series initiates a rework in this direction for the uncore code. The intel_uncore class already abstracts most of the handling around our register access, so passing it around instead of dev_priv in code that relates to register interface makes sense. For extra integration, the later part of the series (patch 7+) also moves the regs pointer inside the uncore structure. This is just an initial proposal and I'm open to alternative solution about this if we want to keep them separate. I've detailed a couple of simple options in the commit message of patch 7 Compile-tested only. Cc: Paulo Zanoni Cc: Joonas Lahtinen Cc: Abdiel Janulgue Daniele Ceraolo Spurio (10): drm/i915: do not pass dev_priv to low-level forcewake functions drm/i915: use intel_uncore in fw get/put internal paths drm/i915: use intel_uncore for all forcewake get/put drm/i915: make more uncore function work on intel_uncore drm/i915: make find_fw_domain work on intel_uncore drm/i915: reduce the dev_priv->uncore dance in uncore.c drm/i915: move regs pointer inside the uncore structure drm/i915: make raw access function work on uncore drm/i915: add uncore flags drm/i915: switch uncore mmio funcs to use intel_uncore drivers/gpu/drm/i915/gvt/mmio_context.c | 8 +- drivers/gpu/drm/i915/i915_debugfs.c | 17 +- drivers/gpu/drm/i915/i915_drv.c | 32 +- drivers/gpu/drm/i915/i915_drv.h | 46 +- drivers/gpu/drm/i915/i915_gem.c | 20 +- drivers/gpu/drm/i915/i915_irq.c | 22 +- drivers/gpu/drm/i915/i915_perf.c | 6 +- drivers/gpu/drm/i915/i915_reset.c | 12 +- drivers/gpu/drm/i915/i915_vgpu.c | 8 +- drivers/gpu/drm/i915/intel_display.c | 6 +- drivers/gpu/drm/i915/intel_engine_cs.c | 4 +- drivers/gpu/drm/i915/intel_guc.c | 8 +- drivers/gpu/drm/i915/intel_guc_fw.c | 4 +- drivers/gpu/drm/i915/intel_hangcheck.c | 2 +- drivers/gpu/drm/i915/intel_huc_fw.c | 4 +- drivers/gpu/drm/i915/intel_lrc.c | 6 +- drivers/gpu/drm/i915/intel_pm.c | 52 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 8 +- drivers/gpu/drm/i915/intel_uncore.c | 827 +++++++++--------- drivers/gpu/drm/i915/intel_uncore.h | 76 +- drivers/gpu/drm/i915/intel_workarounds.c | 4 +- drivers/gpu/drm/i915/selftests/intel_uncore.c | 15 +- .../gpu/drm/i915/selftests/mock_gem_device.c | 2 +- drivers/gpu/drm/i915/selftests/mock_uncore.c | 10 +- drivers/gpu/drm/i915/selftests/mock_uncore.h | 2 +- 25 files changed, 616 insertions(+), 585 deletions(-)