From mboxrd@z Thu Jan 1 00:00:00 1970 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=-9.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS 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 5CA07C433E1 for ; Wed, 26 Aug 2020 01:46:05 +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 3D906206E3 for ; Wed, 26 Aug 2020 01:46:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D906206E3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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 B21C36E9E0; Wed, 26 Aug 2020 01:46:04 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2DDEA6E9E0 for ; Wed, 26 Aug 2020 01:46:03 +0000 (UTC) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-508-hAbZXCZhN0--uJG5fvzQEw-1; Tue, 25 Aug 2020 21:44:42 -0400 X-MC-Unique: hAbZXCZhN0--uJG5fvzQEw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2D2491005E5B; Wed, 26 Aug 2020 01:44:41 +0000 (UTC) Received: from tyrion-bne-redhat-com.redhat.com (vpn2-54-53.bne.redhat.com [10.64.54.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id B382760C13; Wed, 26 Aug 2020 01:44:39 +0000 (UTC) From: Dave Airlie To: dri-devel@lists.freedesktop.org Subject: [PATCH 02/23] drm/radeon/ttm: don't store driver copy of device pointer. Date: Wed, 26 Aug 2020 11:44:07 +1000 Message-Id: <20200826014428.828392-3-airlied@gmail.com> In-Reply-To: <20200826014428.828392-1-airlied@gmail.com> References: <20200826014428.828392-1-airlied@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=airlied@gmail.com X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: gmail.com 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: kraxel@redhat.com, sroland@vmware.com, bskeggs@redhat.com, christian.koenig@amd.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Dave Airlie This can be gotten back from bdev. Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_ttm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index f6311f404db8..0923a8601112 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -412,7 +412,6 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_reso */ struct radeon_ttm_tt { struct ttm_dma_tt ttm; - struct radeon_device *rdev; u64 offset; uint64_t userptr; @@ -515,6 +514,7 @@ static int radeon_ttm_backend_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem) { struct radeon_ttm_tt *gtt = (void*)ttm; + struct radeon_device *rdev = radeon_get_rdev(ttm->bdev); uint32_t flags = RADEON_GART_PAGE_VALID | RADEON_GART_PAGE_READ | RADEON_GART_PAGE_WRITE; int r; @@ -531,7 +531,7 @@ static int radeon_ttm_backend_bind(struct ttm_tt *ttm, } if (ttm->caching_state == tt_cached) flags |= RADEON_GART_PAGE_SNOOP; - r = radeon_gart_bind(gtt->rdev, gtt->offset, ttm->num_pages, + r = radeon_gart_bind(rdev, gtt->offset, ttm->num_pages, ttm->pages, gtt->ttm.dma_address, flags); if (r) { DRM_ERROR("failed to bind %lu pages at 0x%08X\n", @@ -544,8 +544,9 @@ static int radeon_ttm_backend_bind(struct ttm_tt *ttm, static void radeon_ttm_backend_unbind(struct ttm_tt *ttm) { struct radeon_ttm_tt *gtt = (void *)ttm; + struct radeon_device *rdev = radeon_get_rdev(ttm->bdev); - radeon_gart_unbind(gtt->rdev, gtt->offset, ttm->num_pages); + radeon_gart_unbind(rdev, gtt->offset, ttm->num_pages); if (gtt->userptr) radeon_ttm_tt_unpin_userptr(ttm); @@ -584,7 +585,6 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_buffer_object *bo, return NULL; } gtt->ttm.ttm.func = &radeon_backend_func; - gtt->rdev = rdev; if (ttm_dma_tt_init(>t->ttm, bo, page_flags)) { kfree(gtt); return NULL; -- 2.27.0 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel