From patchwork Mon Dec 14 19:17:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 11972835 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 7BCF9C2BB40 for ; Mon, 14 Dec 2020 19:17:37 +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 B650622286 for ; Mon, 14 Dec 2020 19:17:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B650622286 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 65FC56E0F4; Mon, 14 Dec 2020 19:17:34 +0000 (UTC) Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 33DAB6E0F4 for ; Mon, 14 Dec 2020 19:17:33 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id m5so17535916wrx.9 for ; Mon, 14 Dec 2020 11:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ufmOwKPgQFQAB4ql7EQmK6jhaZylxb/hsIu+JjUm62I=; b=LjpuryWAed6pObwmf7bC7xMdnZSZEEOxYjaEvegHWOauiVjiQPN7l1c8To8AdluT/g ijkF+SybBpfWOECo358ss/aLN8ys6vRccn3L1oGBaPkR9/rRg+HNsqZEmLxEl7kbgk53 uDfV7z6j96kNBZ4ti7QxFlGRDnF+AsJjTj63Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ufmOwKPgQFQAB4ql7EQmK6jhaZylxb/hsIu+JjUm62I=; b=dhq5B25OUYzmFO8JSB/aaRS3KYOmiyXc9nofv3iplExttaLxHYvamS4hAfangcNqwJ mSc6Sucho/aXviA/VYA32rgrg2xC3oy6Rq595x9xJ/S+mFnnwoI/cugiOCtmCiCWEgXz oABJqhXbNgO2UQAiSfJXWU8uKUNoWsCQYCl0TipUgkMRdKr4y5GYf5Wi36z8etUNjvVu L5NFrJeyOAAtpNOw11EkZPtwqLLkxXz+W+UBiJaMBfRuVkEqPL7dCvlGW8roa+6zWqRI cGW432vZ/hraKhsxEDypI1LQany3j4lqEaiXDDaSB5Jt1KpQxM3w1bwkK3t2iGI8hfkT oWBw== X-Gm-Message-State: AOAM530xqRxomSU/qgn4oHyG6NffHL70PD98CjlnT4D5a2UyY5I0THsv kzuKXhOw03FKph25IvDjsTcvJtECHzvAXw== X-Google-Smtp-Source: ABdhPJwwR4xV9ozVPMY/L90foplvJ9uxsIv/2nhpOxme+jx4PdjnWbkNc/H77/Glz0HZVdCJLiPkIA== X-Received: by 2002:a5d:4a4e:: with SMTP id v14mr21901875wrs.80.1607973451522; Mon, 14 Dec 2020 11:17:31 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id r15sm7491720wrq.1.2020.12.14.11.17.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 11:17:30 -0800 (PST) From: Daniel Vetter To: DRI Development Subject: [PATCH] drm/amdkfd: fix ttm size refactor fallout Date: Mon, 14 Dec 2020 20:17:25 +0100 Message-Id: <20201214191725.3899147-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.29.2 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: Daniel Vetter , Felix Kuehling , amd-gfx@lists.freedesktop.org, Huang Rui , Daniel Vetter , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" I guess Christian didn't compile test amdkfd. Fixes: e11bfb99d6ec ("drm/ttm: cleanup BO size handling v3") Cc: Christian König Cc: Huang Rui (v1) Cc: Daniel Vetter Cc: Felix Kuehling Cc: amd-gfx@lists.freedesktop.org Signed-off-by: Daniel Vetter Acked-by: Alex Deucher Reviewed-by: Felix Kuehling Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c index 7791d074bd32..a9647e7f98a8 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -453,7 +453,7 @@ static int add_bo_to_vm(struct amdgpu_device *adev, struct kgd_mem *mem, struct amdgpu_bo *bo = mem->bo; uint64_t va = mem->va; struct list_head *list_bo_va = &mem->bo_va_list; - unsigned long bo_size = bo->tbo.mem.size; + unsigned long bo_size = bo->tbo.base.size; if (!va) { pr_err("Invalid VA when adding BO to VM\n"); @@ -1281,7 +1281,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu( struct kgd_dev *kgd, struct kgd_mem *mem, uint64_t *size) { struct amdkfd_process_info *process_info = mem->process_info; - unsigned long bo_size = mem->bo->tbo.mem.size; + unsigned long bo_size = mem->bo->tbo.base.size; struct kfd_bo_va_list *entry, *tmp; struct bo_vm_reservation_context ctx; struct ttm_validate_buffer *bo_list_entry; @@ -1402,7 +1402,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu( mutex_lock(&mem->lock); domain = mem->domain; - bo_size = bo->tbo.mem.size; + bo_size = bo->tbo.base.size; pr_debug("Map VA 0x%llx - 0x%llx to vm %p domain %s\n", mem->va, @@ -1506,7 +1506,7 @@ int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu( struct amdgpu_device *adev = get_amdgpu_device(kgd); struct amdkfd_process_info *process_info = ((struct amdgpu_vm *)vm)->process_info; - unsigned long bo_size = mem->bo->tbo.mem.size; + unsigned long bo_size = mem->bo->tbo.base.size; struct kfd_bo_va_list *entry; struct bo_vm_reservation_context ctx; int ret;