From patchwork Thu May 20 15:09:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 12270779 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1741C433B4 for ; Thu, 20 May 2021 15:10:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DA8D611ED for ; Thu, 20 May 2021 15:10:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DA8D611ED Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DAB96F479; Thu, 20 May 2021 15:10:39 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BD986E1BE; Thu, 20 May 2021 15:10:37 +0000 (UTC) IronPort-SDR: 9A2OdeO428MBsTBm5sBbloT5C0WYCPdgeIr4/Xy7m9TIILsXEt5hzBOturoATGRBgDn6LpAoLs 4PDrzJ6UAP/A== X-IronPort-AV: E=McAfee;i="6200,9189,9989"; a="222341175" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="222341175" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 08:09:58 -0700 IronPort-SDR: x8aKiyZUKX9l8am38RHwyh2yiIG/zv5XG2QeGRprwCoI+/qptOsOcKJLwvqFuPCVzA6OTSYT0M VBN8PC8lMGsg== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="395728141" Received: from cbjoerns-mobl1.ger.corp.intel.com (HELO thellst-mobl1.intel.com) ([10.249.254.247]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 08:09:56 -0700 From: =?utf-8?q?Thomas_Hellstr=C3=B6m?= To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Thu, 20 May 2021 17:09:42 +0200 Message-Id: <20210520150947.803891-1-thomas.hellstrom@linux.intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 0/5] Core TTM changes for i915 TTM enabling X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Thomas_Hellstr=C3=B6m?= , =?utf-8?q?Christian_K=C3=B6nig?= , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is mainly a pre-check that the core TTM changes for the initial i915 TTM patch series look reasonably ok. Main thing is we add the new page-based iomem memcpy util to TTM, and for some speed the copy-from-wc-x86-only prefetching memcpy to core drm. Note that the legacy memcpy path is largely untested. Perhaps can give it some testing on vmwgfx. A bugfix and some minor optimization for the ttm_bo_pipeline_gutting() idle case Finally allow the frequently-pinning i915 driver to block swapping of pinned memory that is still on the LRU. If OK, I'd like to include these as a part of the i915 series. Cc: Christian König Cc: Dave Airlie Cc: Daniel Vetter Thomas Hellström (5): drm/ttm: Add a generic TTM memcpy move for page-based iomem drm, drm/i915: Move the memcpy_from_wc functionality to core drm drm/ttm: Use drm_memcpy_from_wc for TTM bo moves drm/ttm: Document and optimize ttm_bo_pipeline_gutting() drm/ttm, drm/amdgpu: Allow the driver some control over swapping drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 + drivers/gpu/drm/drm_drv.c | 2 + .../drm/{i915/i915_memcpy.c => drm_memcpy.c} | 31 +- drivers/gpu/drm/i915/Makefile | 1 - .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 5 +- drivers/gpu/drm/i915/gt/selftest_reset.c | 7 +- drivers/gpu/drm/i915/gt/uc/intel_guc_log.c | 11 +- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 +- drivers/gpu/drm/i915/i915_drv.c | 2 - drivers/gpu/drm/i915/i915_gpu_error.c | 8 +- drivers/gpu/drm/i915/i915_memcpy.h | 34 -- .../drm/i915/selftests/intel_memory_region.c | 7 +- drivers/gpu/drm/ttm/ttm_bo.c | 61 +- drivers/gpu/drm/ttm/ttm_bo_util.c | 547 ++++++++++++------ drivers/gpu/drm/ttm/ttm_tt.c | 9 + include/drm/drm_memcpy.h | 41 ++ include/drm/ttm/ttm_bo_driver.h | 94 +++ include/drm/ttm/ttm_tt.h | 10 + 20 files changed, 614 insertions(+), 270 deletions(-) rename drivers/gpu/drm/{i915/i915_memcpy.c => drm_memcpy.c} (84%) delete mode 100644 drivers/gpu/drm/i915/i915_memcpy.h create mode 100644 include/drm/drm_memcpy.h