From patchwork Mon Jul 29 16:54:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Welty, Brian" X-Patchwork-Id: 11064219 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 6DD3D14DB for ; Mon, 29 Jul 2019 16:54:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5623628725 for ; Mon, 29 Jul 2019 16:54:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A88928739; Mon, 29 Jul 2019 16:54:42 +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 333A328725 for ; Mon, 29 Jul 2019 16:54:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C7C0689A1F; Mon, 29 Jul 2019 16:54:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 29E37899BB; Mon, 29 Jul 2019 16:54:37 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2019 09:54:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,323,1559545200"; d="scan'208";a="176478844" Received: from nperf12.hd.intel.com ([10.127.88.161]) by orsmga006.jf.intel.com with ESMTP; 29 Jul 2019 09:54:35 -0700 From: Brian Welty To: dri-devel@lists.freedesktop.org, Daniel Vetter , intel-gfx@lists.freedesktop.org Subject: [RFC PATCH 0/3] Propose new struct drm_mem_region Date: Mon, 29 Jul 2019 12:54:54 -0400 Message-Id: <20190729165457.18500-1-brian.welty@intel.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This RFC series is first implementation of some ideas expressed earlier on dri-devel [1]. Some of the goals (open for much debate) are: - Create common base structure (subclass) for memory regions (patch #1) - Create common memory region types (patch #2) - Create common set of memory_region function callbacks (based on ttm_mem_type_manager_funcs and intel_memory_regions_ops) - Create common helpers that operate on drm_mem_region to be leveraged by both TTM drivers and i915, reducing code duplication - Above might start with refactoring ttm_bo_manager.c as these are helpers for using drm_mm's range allocator and could be made to operate on DRM structures instead of TTM ones. - Larger goal might be to make LRU management of GEM objects common, and migrate those fields into drm_mem_region and drm_gem_object strucures. Patches 1-2 implement the proposed struct drm_mem_region and adds associated common set of definitions for memory region type. Patch #3 is update to i915 and is based upon another series which is in progress to add vram support to i915 [2]. [1] https://lists.freedesktop.org/archives/dri-devel/2019-June/224501.html [2] https://lists.freedesktop.org/archives/intel-gfx/2019-June/203649.html Brian Welty (3): drm: introduce new struct drm_mem_region drm: Introduce DRM_MEM defines for specifying type of drm_mem_region drm/i915: Update intel_memory_region to use nested drm_mem_region drivers/gpu/drm/i915/gem/i915_gem_object.c | 2 +- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 2 +- drivers/gpu/drm/i915/i915_gem_gtt.c | 10 +++--- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm/i915/i915_query.c | 2 +- drivers/gpu/drm/i915/intel_memory_region.c | 10 +++--- drivers/gpu/drm/i915/intel_memory_region.h | 19 +++------- drivers/gpu/drm/i915/intel_region_lmem.c | 26 +++++++------- .../drm/i915/selftests/intel_memory_region.c | 8 ++--- drivers/gpu/drm/ttm/ttm_bo.c | 34 ++++++++++-------- drivers/gpu/drm/ttm/ttm_bo_manager.c | 14 ++++---- drivers/gpu/drm/ttm/ttm_bo_util.c | 11 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 8 ++--- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 4 +-- include/drm/drm_mm.h | 35 +++++++++++++++++++ include/drm/ttm/ttm_bo_api.h | 2 +- include/drm/ttm/ttm_bo_driver.h | 16 ++++----- include/drm/ttm/ttm_placement.h | 8 ++--- 18 files changed, 122 insertions(+), 91 deletions(-)