From patchwork Mon Jan 30 10:12:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 13120883 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2BA44C54EAA for ; Mon, 30 Jan 2023 10:18:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25F5A10E216; Mon, 30 Jan 2023 10:18:01 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDC0D10E22E; Mon, 30 Jan 2023 10:17:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675073876; x=1706609876; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ZaT4EbQIZs0rcQzQfGUV9BXhBKPnUIQhy1h9051DvC0=; b=SLfIz12JDJh44SGtB8KC3tuhkDDX9DUP0A8Dgktkj7mp3UMLiB7UwHcb ++sf7dr8WmkimbZ+uJv5c8qhp1+BXczf4GAyIPiaciCM1mfzUWRHs3yoY dVm5tGT61hqqIjttZ+SY5lAGvYVGndSjNHFLJ3wbdXX+jHe3aivXGbPVS oZdVwvvvdv5zcWg6c7f4h6bISjiW42wjoRmrY4pyZ/jS/nme32/X7HIMT yD9tYR4qoS3dFkg+2uBi/9ckLtR3nQQIJIjL/agA0OmiTZJHoUfVyguZ6 uilRkT9wRFwLdmvMTdXS6sn3wgfA9jaHReOrbtsa9d2Q1zYqPFsMA9amJ A==; X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="328798968" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="328798968" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 02:17:13 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="696348863" X-IronPort-AV: E=Sophos;i="5.97,257,1669104000"; d="scan'208";a="696348863" Received: from dscheepe-mobl2.ger.corp.intel.com (HELO mwauld-desk1.intel.com) ([10.252.1.159]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2023 02:14:19 -0800 From: Matthew Auld To: intel-gfx@lists.freedesktop.org Subject: [PATCH 4/6] drm/ttm: stop allocating dummy resources during BO creation Date: Mon, 30 Jan 2023 10:12:28 +0000 Message-Id: <20230130101230.25347-4-matthew.auld@intel.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230130101230.25347-1-matthew.auld@intel.com> References: <20230130101230.25347-1-matthew.auld@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Christian_K=C3=B6nig?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Christian König That should not be necessary any more when drivers should at least be able to handle the move without a resource. Signed-off-by: Christian König Reviewed-by: Matthew Auld Signed-off-by: Matthew Auld --- drivers/gpu/drm/ttm/ttm_bo.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 773080f48864..169818b32be2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -952,7 +952,6 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo, struct sg_table *sg, struct dma_resv *resv, void (*destroy) (struct ttm_buffer_object *)) { - static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM }; int ret; kref_init(&bo->kref); @@ -969,12 +968,6 @@ int ttm_bo_init_reserved(struct ttm_device *bdev, struct ttm_buffer_object *bo, bo->base.resv = &bo->base._resv; atomic_inc(&ttm_glob.bo_count); - ret = ttm_resource_alloc(bo, &sys_mem, &bo->resource); - if (unlikely(ret)) { - ttm_bo_put(bo); - return ret; - } - /* * For ttm_bo_type_device buffers, allocate * address space from the device.