From patchwork Thu May 16 21:56:27 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: 10947067 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 D770F1398 for ; Thu, 16 May 2019 21:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6BAC28ADE for ; Thu, 16 May 2019 21:57:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB56028C56; Thu, 16 May 2019 21:57:17 +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 53D0D28ADE for ; Thu, 16 May 2019 21:57:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DA097897DC; Thu, 16 May 2019 21:57:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35266897DC for ; Thu, 16 May 2019 21:57:15 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2019 14:57:14 -0700 X-ExtLoop1: 1 Received: from dceraolo-linux.fm.intel.com ([10.1.27.145]) by orsmga001.jf.intel.com with ESMTP; 16 May 2019 14:57:14 -0700 From: Daniele Ceraolo Spurio To: intel-gfx@lists.freedesktop.org Date: Thu, 16 May 2019 14:56:27 -0700 Message-Id: <20190516215634.16675-1-daniele.ceraolospurio@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 0/7] Runtime PM encapsulation 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 While reworking other parts of the code to rely less on i915 and use the new uncore logic for register access, I've noticed that, after the conversion, in a few places the i915 structure is required only for the rpm_get/put calls. We do have a reference to the rpm structure in the uncore one, so, since we're relying on the latter more, having the rpm code work directly on its own sub-structure will allow us to ditch dev_priv in a few more places. Also, having a section of the code work on its own logic sub-structure instead getting it out of dev_priv every time makes the flow generally cleaner IMO. This series grows the code slightly due to flipping all the get/put call points derive the rpm structure from dev_priv, but we should recoup that over time while we complete the rework. While applying the changes I noticed that there is also a lot of potential for refactoring/encapsuliation around the display power functions. I experimented a bit with splitting these functions to their own file and moving most of the logic to work on i915_power_domains since we keep getting that structure out of i915, but the code is not as easy to update due to frequent calls to other areas in the display domain, so I gave up for now. Series very lightly tested. Cc: Imre Deak Cc: Chris Wilson Daniele Ceraolo Spurio (7): drm/i915: prefer i915_runtime_pm in intel_runtime function drm/i915: Remove rpm asserts that use i915 drm/i915: make enable/disable rpm assert function use the rpm structure drm/i915: move and rename i915_runtime_pm drm/i915: move a few more functions to accept the rpm structure drm/i915: update rpm_get/put to use the rpm structure drm/i915: update with_intel_runtime_pm to use the rpm structure drivers/gpu/drm/i915/gt/intel_context.c | 2 +- drivers/gpu/drm/i915/gt/intel_engine_cs.c | 8 +- drivers/gpu/drm/i915/gt/intel_hangcheck.c | 4 +- drivers/gpu/drm/i915/gt/intel_reset.c | 6 +- drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 20 +- drivers/gpu/drm/i915/gt/selftest_lrc.c | 36 +-- .../gpu/drm/i915/gt/selftest_workarounds.c | 16 +- drivers/gpu/drm/i915/gvt/aperture_gm.c | 17 +- drivers/gpu/drm/i915/gvt/gvt.h | 4 +- drivers/gpu/drm/i915/gvt/sched_policy.c | 4 +- drivers/gpu/drm/i915/gvt/scheduler.c | 4 +- drivers/gpu/drm/i915/i915_debugfs.c | 79 +++---- drivers/gpu/drm/i915/i915_drv.c | 57 ++--- drivers/gpu/drm/i915/i915_drv.h | 50 +---- drivers/gpu/drm/i915/i915_gem.c | 30 +-- drivers/gpu/drm/i915/i915_gem_fence_reg.c | 6 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 8 +- drivers/gpu/drm/i915/i915_gem_shrinker.c | 12 +- drivers/gpu/drm/i915/i915_irq.c | 38 ++-- drivers/gpu/drm/i915/i915_perf.c | 6 +- drivers/gpu/drm/i915/i915_pmu.c | 11 +- drivers/gpu/drm/i915/i915_sysfs.c | 14 +- drivers/gpu/drm/i915/i915_vma.c | 2 +- drivers/gpu/drm/i915/intel_csr.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 4 +- drivers/gpu/drm/i915/intel_drv.h | 105 --------- drivers/gpu/drm/i915/intel_fbdev.c | 6 +- drivers/gpu/drm/i915/intel_guc.c | 4 +- drivers/gpu/drm/i915/intel_guc_log.c | 6 +- drivers/gpu/drm/i915/intel_hotplug.c | 4 +- drivers/gpu/drm/i915/intel_huc.c | 2 +- drivers/gpu/drm/i915/intel_panel.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 8 +- drivers/gpu/drm/i915/intel_runtime_pm.c | 205 ++++++++---------- drivers/gpu/drm/i915/intel_runtime_pm.h | 185 ++++++++++++++-- drivers/gpu/drm/i915/intel_uc.c | 2 +- drivers/gpu/drm/i915/intel_uncore.c | 26 +-- drivers/gpu/drm/i915/intel_uncore.h | 4 +- drivers/gpu/drm/i915/intel_wakeref.c | 4 +- drivers/gpu/drm/i915/selftests/huge_pages.c | 4 +- drivers/gpu/drm/i915/selftests/i915_active.c | 8 +- drivers/gpu/drm/i915/selftests/i915_gem.c | 10 +- .../drm/i915/selftests/i915_gem_coherency.c | 4 +- .../gpu/drm/i915/selftests/i915_gem_context.c | 18 +- .../gpu/drm/i915/selftests/i915_gem_evict.c | 6 +- drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 8 +- .../gpu/drm/i915/selftests/i915_gem_object.c | 6 +- drivers/gpu/drm/i915/selftests/i915_request.c | 22 +- .../gpu/drm/i915/selftests/i915_timeline.c | 16 +- drivers/gpu/drm/i915/selftests/intel_guc.c | 8 +- drivers/gpu/drm/i915/selftests/intel_uncore.c | 4 +- .../gpu/drm/i915/selftests/mock_gem_device.c | 2 +- 52 files changed, 553 insertions(+), 566 deletions(-)