Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3454594yba; Tue, 16 Apr 2019 11:40:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGRWQ3LmVYeM750XE8uvyaigN1/XWp6vgBe4rp7ELOAKuRhyudlhQN0lFOjW1DJObBjF2J X-Received: by 2002:a17:902:a50d:: with SMTP id s13mr28279292plq.58.1555440003168; Tue, 16 Apr 2019 11:40:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555440003; cv=none; d=google.com; s=arc-20160816; b=igvW/KoTd31VMMfolAnjFN/Yfj94RPg1WxmE3zqHM2wsTzMTE4Hk7X17Umzlmpr803 Z4BbqMeQoC+r+7/fSEBCCIbks5iwBPm7y+jdSWU54dybYlqhsI6qickpoShy8FUbyQhn r2iBSBqPGPgqkdRT16eIl9Ppls0YElPQ6+Jk5TS95ENzaNqgEjcuphZ52ZNKwI8rnM1B oUIT4FM7WByr0N4vWQqY2IWkqyQYh7j4sPCQE0WcaxZO25FaGUJlsE4ItuQ/D6C9lPL7 Cqtxp8b8veZPJHRlWmJonlyqR2a6STtaivOac7pp89p4NkA9W29+GiajQ8qlC4VsK2o+ s9mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/Q+iJ6rJZ2HsKCGJQjBe3G9bfJhGCGmYeQPjdB6XZUQ=; b=oYCfac2kXwziGx94rXgpOv+fOVRKV5oTTPouRRcx0lZofvBvSZ/mr0rQONaH7CazaW rMm9TeIEWTP76ICOl+viUxJDxSlrW1dhohYHIRn1LxB4Z8bAvEpFHXwJWcYSrG/5/4Wf ZnbOZSZkATERSz2qOUjws+vSJuu4ntkDMCz670TUFSdVrpqkxPdDIagCHaDIJclz5lsE rJIsM5Fuuoalli/fj05YRd8i9uRdOk5mZNeE/7MaMEAVauspkg/ffq0UnW366yRnNu6r rMmWVfPalg2daAI8k0lTYgS2JvWYMivhYstrQ4xCp3SXSduFCNgJSYCksZqQbxSl1zTi 2Wog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ukEXoOwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r11si43601620pgm.353.2019.04.16.11.39.47; Tue, 16 Apr 2019 11:40:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ukEXoOwE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730419AbfDPSi5 (ORCPT + 99 others); Tue, 16 Apr 2019 14:38:57 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39927 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730374AbfDPSiz (ORCPT ); Tue, 16 Apr 2019 14:38:55 -0400 Received: by mail-wr1-f67.google.com with SMTP id j9so28469313wrn.6; Tue, 16 Apr 2019 11:38:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/Q+iJ6rJZ2HsKCGJQjBe3G9bfJhGCGmYeQPjdB6XZUQ=; b=ukEXoOwEBqy3IRbtG1NbdOrME1rTGkJvvZv02W7F2Sc3QiNSgsezF8Cnnx3Th4sRoM rh4kX/FFL1bOeKq6VjVrZ+BIoHggOKFKYP6d5GhoIiPuc4TIEcQUZ2SUXArAWnoQELTN ue+BI22xwaXvu6KJ7W0rXZE8VapXmSkUAZtdhnKqd6gtAuMZVe8Rn7xHUPiyN+6KdH4M VaT70kxsacb8/zJbxNVgQaVkYlQBdBG2CMWYgnH8T9/XPoSiYhAljEjwE5/jnIMKuZdo P4Ej9iSQIf0MsVJh61NJkgGwYrxiaapRn7AVUtKqfrPGNMkdTv2i0HKO0cmxnA+WmsSi 7mpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/Q+iJ6rJZ2HsKCGJQjBe3G9bfJhGCGmYeQPjdB6XZUQ=; b=aJsQ0DWwdnh01gd20bNZiRkBlA8QicHIQP1y5EvfgIxsuY3H43utWg5SDStAhXlrWe 7r8gUWbtiqd5b92efIBO5st3a/U7NszK9Hdaut1rj4vaQf7jbT7szXv7jdBmEVbZqprS JMc4mJhLNAurSVLaD3f0phZUuX32dXYxm0F48+BIBa2JCsalr4ODsswW3XnQZKndWLTe T7G6CjnFqHaKC53GtaHk3MU/1d2kiPnLLO8/YAg9EZVBpdMg1+8gKiLplfU+kvjR8nQL LXfmp2l0VMafnsxFM21hnCoGmjyHkStHOJlXFRYCJdepV8SwmSNR84KIUviDzOxhhhk1 XmSg== X-Gm-Message-State: APjAAAUJoYDZNlrvify1fN45aVCTPs4AyrKZBKIbwiaRzWC2+LQDYd8P /outYtPXfq8drBylPucXjFU= X-Received: by 2002:adf:e288:: with SMTP id v8mr46638599wri.7.1555439933776; Tue, 16 Apr 2019 11:38:53 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:fcfa:e34f:82c0:3f66]) by smtp.gmail.com with ESMTPSA id m13sm128823wmg.42.2019.04.16.11.38.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 11:38:53 -0700 (PDT) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: sumit.semwal@linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org Subject: [PATCH 08/12] drm/ttm: use the parent resv for ghost objects Date: Tue, 16 Apr 2019 20:38:37 +0200 Message-Id: <20190416183841.1577-9-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190416183841.1577-1-christian.koenig@amd.com> References: <20190416183841.1577-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This way we can even pipeline imported BO evictions. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 895d77d799e4..97f35c4bda35 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -486,7 +486,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, struct ttm_buffer_object **new_obj) { struct ttm_transfer_obj *fbo; - int ret; fbo = kmalloc(sizeof(*fbo), GFP_KERNEL); if (!fbo) @@ -517,10 +516,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, kref_init(&fbo->base.kref); fbo->base.destroy = &ttm_transfered_destroy; fbo->base.acc_size = 0; - fbo->base.resv = &fbo->base.ttm_resv; - reservation_object_init(fbo->base.resv); - ret = reservation_object_trylock(fbo->base.resv); - WARN_ON(!ret); + reservation_object_init(&fbo->base.ttm_resv); *new_obj = &fbo->base; return 0; @@ -716,8 +712,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, if (ret) return ret; - reservation_object_add_excl_fence(ghost_obj->resv, fence); - /** * If we're not moving to fixed memory, the TTM object * needs to stay alive. Otherwhise hang it on the ghost @@ -729,7 +723,6 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, else bo->ttm = NULL; - ttm_bo_unreserve(ghost_obj); ttm_bo_put(ghost_obj); } @@ -772,8 +765,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, if (ret) return ret; - reservation_object_add_excl_fence(ghost_obj->resv, fence); - /** * If we're not moving to fixed memory, the TTM object * needs to stay alive. Otherwhise hang it on the ghost @@ -785,7 +776,6 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, else bo->ttm = NULL; - ttm_bo_unreserve(ghost_obj); ttm_bo_put(ghost_obj); } else if (from->flags & TTM_MEMTYPE_FLAG_FIXED) { @@ -841,16 +831,10 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) if (ret) return ret; - ret = reservation_object_copy_fences(ghost->resv, bo->resv); - /* Last resort, wait for the BO to be idle when we are OOM */ - if (ret) - ttm_bo_wait(bo, false, false); - memset(&bo->mem, 0, sizeof(bo->mem)); bo->mem.mem_type = TTM_PL_SYSTEM; bo->ttm = NULL; - ttm_bo_unreserve(ghost); ttm_bo_put(ghost); return 0; -- 2.17.1