From patchwork Fri Nov 24 10:32:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10073933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 51BCA6037F for ; Fri, 24 Nov 2017 10:33:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4429F2A393 for ; Fri, 24 Nov 2017 10:33:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 380342A395; Fri, 24 Nov 2017 10:33:06 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 AD9E82A393 for ; Fri, 24 Nov 2017 10:33:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 32F806E912; Fri, 24 Nov 2017 10:33:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 003BA6E90B for ; Fri, 24 Nov 2017 10:33:03 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id 9so21476412wme.4 for ; Fri, 24 Nov 2017 02:33:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=dOIi3A4l1Y2A8skIDiv/eWpYUCpgCheUoo8BQ37lhNU=; b=IW7ae5RBOqliKvzE35A4MNt6gAq6EHk5jvQtZnIJOO2xs2d+bB7X6aQlaol29PQOdI 5Qyukyol+npLYnBz4AXRmnpsnXG+w9fjq2dPcYkvTw8WJivQzgN6OArGvQR+bMjSlQNo EyhyGoGHQcKh9IrXP1WOEhM1+rgA/zcUG6/0+UCYX56AdETJXrdcVlFT1uCYBCaj20T6 StaEm2Sami2GuneK+I9sLeG+g26cfD5hFd1zQBUkJ9ylrjVcgE+70jiFx9Xa9+7DKr3N teYUAY3cCFSc79FGCTHaFIsHxZEXoCGq+MeheUA7kX+O1m4HJZ1zKFZWD18iPEmch9gT 710A== 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:mime-version :content-transfer-encoding; bh=dOIi3A4l1Y2A8skIDiv/eWpYUCpgCheUoo8BQ37lhNU=; b=jlnib9oKVZd3bXRDnpI7046SSCTlolxSkWbWoweiF17hqsNU9GekikKEtnpMqCQJcM kx85DVbbCFi5maYxzlhM0rXqTbwytbUGNyf3hRREOpPNhKc/D19Y3vRPPVAIZ1TrV3VS x8gj8V3MYr//MWOSNkfSJ92hCIrAQapViraEeVjH69sNWcxs23S7Li0yZOuAbS4PiqI4 1PeUAejfE35/euMHzkyW5DsXEQRcJV2mjUZkO0nTTMta/O2zTpXyxPjzyaplRjclGIaf PfNjkqg/HInZzOhycxJrJXSqRQweYPAUHiFT+Z7sTjnbpQRatJb/Krrhn2qFx/5sbM50 xwaw== X-Gm-Message-State: AJaThX7rE+7ZTUUbCIAyk1j9NU883zB+zX0HPDffhJe1PRXUz5q/1gYY f+Nkym9kVfPu+gdPo6vChz4= X-Google-Smtp-Source: AGs4zMbfLg4t9xMQg5Tm0hQr2wZnYeL7Y4XmECxhUwnQRIXSy6TVOSETrJPraHzLSK/m9PLx+teshQ== X-Received: by 10.28.249.26 with SMTP id x26mr9872737wmh.36.1511519582592; Fri, 24 Nov 2017 02:33:02 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:c858:99a0:aef3:7a9d]) by smtp.gmail.com with ESMTPSA id q81sm6839720wmg.22.2017.11.24.02.33.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 02:33:01 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: hdegoede@redhat.com, dri-devel@lists.freedesktop.org, greg@kroah.com Subject: [PATCH] staging: vboxvideo: adapt to new TTM interface Date: Fri, 24 Nov 2017 11:32:59 +0100 Message-Id: <20171124103259.6033-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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 Fixes interface changes done in the following commits: drm/ttm: add operation ctx to ttm_bo_validate v2 drm/ttm: add context to driver move callback as well I missed this driver because it is in the staging area. Signed-off-by: Christian König Reviewed-by: Hans de Goede Acked-by: Greg Kroah-Hartman Acked-by: Alex Deucher --- drivers/staging/vboxvideo/vbox_ttm.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/staging/vboxvideo/vbox_ttm.c b/drivers/staging/vboxvideo/vbox_ttm.c index 4eb410a2a1a8..231c89e0699c 100644 --- a/drivers/staging/vboxvideo/vbox_ttm.c +++ b/drivers/staging/vboxvideo/vbox_ttm.c @@ -183,13 +183,6 @@ static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev, { } -static int vbox_bo_move(struct ttm_buffer_object *bo, - bool evict, bool interruptible, - bool no_wait_gpu, struct ttm_mem_reg *new_mem) -{ - return ttm_bo_move_memcpy(bo, interruptible, no_wait_gpu, new_mem); -} - static void vbox_ttm_backend_destroy(struct ttm_tt *tt) { ttm_tt_fini(tt); @@ -237,7 +230,6 @@ static struct ttm_bo_driver vbox_bo_driver = { .init_mem_type = vbox_bo_init_mem_type, .eviction_valuable = ttm_bo_eviction_valuable, .evict_flags = vbox_bo_evict_flags, - .move = vbox_bo_move, .verify_access = vbox_bo_verify_access, .io_mem_reserve = &vbox_ttm_io_mem_reserve, .io_mem_free = &vbox_ttm_io_mem_free, @@ -374,6 +366,7 @@ static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo) int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) { + struct ttm_operation_ctx ctx = { false, false }; int i, ret; if (bo->pin_count) { @@ -389,7 +382,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) for (i = 0; i < bo->placement.num_placement; i++) bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; - ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); + ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); if (ret) return ret; @@ -403,6 +396,7 @@ int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) int vbox_bo_unpin(struct vbox_bo *bo) { + struct ttm_operation_ctx ctx = { false, false }; int i, ret; if (!bo->pin_count) { @@ -416,7 +410,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) for (i = 0; i < bo->placement.num_placement; i++) bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT; - ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); + ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); if (ret) return ret; @@ -430,6 +424,7 @@ int vbox_bo_unpin(struct vbox_bo *bo) */ int vbox_bo_push_sysram(struct vbox_bo *bo) { + struct ttm_operation_ctx ctx = { false, false }; int i, ret; if (!bo->pin_count) { @@ -448,7 +443,7 @@ int vbox_bo_push_sysram(struct vbox_bo *bo) for (i = 0; i < bo->placement.num_placement; i++) bo->placements[i].flags |= TTM_PL_FLAG_NO_EVICT; - ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); + ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); if (ret) { DRM_ERROR("pushing to VRAM failed\n"); return ret;