From patchwork Fri Nov 24 10:29:27 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: 10073927 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 DDD6260383 for ; Fri, 24 Nov 2017 10:29:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE6F92A260 for ; Fri, 24 Nov 2017 10:29:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2DF42A395; Fri, 24 Nov 2017 10:29:35 +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 4D0F22A260 for ; Fri, 24 Nov 2017 10:29:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC9A36E8F3; Fri, 24 Nov 2017 10:29:33 +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 9EAD26E8F3 for ; Fri, 24 Nov 2017 10:29:32 +0000 (UTC) Received: by mail-wm0-x242.google.com with SMTP id b189so21469144wmd.0 for ; Fri, 24 Nov 2017 02:29:32 -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=i2kibfCIbhgO9GiVWhofp3nk3P4JXP3JBvoaBXSaGuE=; b=pETIab8DIkB8sT85MBSrwOcFrW62JxcoBM/O2TxSie8AUa7KF+22AsBtwqxB89Jany FXRdqyB4OfkSfZLXgr5EX72eJesS5V8JpiFmCmk8LaKwe4Uf4ecja6GzGZZS/SmJxH+t NpPdvOoami2wIj2R8GBvxgixbksijZ8PU/WjhpEVRJIyRsMRLeMFwJ42yDoejuDCAGft 5xlrAnSPB8DeXl43KAaB95RK4v93QajmqsLRfzogVoXaZaSRbLTFPZ/5IBr8uBjmLfEy A04u0exJLUuqjUL0EQSL7AIWQceELk/yIcRHfXfqZNViaS1WV8QaoQDQ3eY3nfPKfEwo 1Wlg== 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=i2kibfCIbhgO9GiVWhofp3nk3P4JXP3JBvoaBXSaGuE=; b=F3O6p+ceePC/Q4StbrqutiHsdiPbwRMj+OM90Tc9mJd10Jq/wIx847XjuWYLzgkXr0 Io/kH0nwqsHF57dG3PB7kH/TnB+7lr+9AY60bbHeAT0bamGatsPFhVD4uDWm6UcManDQ PjC8LwUmKsUCHLtV18f+RTiVAazEqp0vFTOz73J7BL7/1OwKKs9y6rvvuNZcHUGj6mqU YO0mEpCfNYRjdPQfTR00eKOirw3AxVNGYyfQsoNK8m3HxEYmGEDQrPvPvqG3bljk4xv8 B2ZYpvD+a7XqkIs6Ets0pcZ6GH9XEnE4sQc1MwyIjeRaO4JWk74Ln6ksUfa/5e6oyLWY 9A6Q== X-Gm-Message-State: AJaThX53GLHXx2w4uzZDx0X3NY8Ot9PWamSKbOIq9NwKZZdtDqRQ1/k8 YzBb3a2e+oQrwkG3k6jLeE4= X-Google-Smtp-Source: AGs4zMaOxz29Ol7AAFX7juaetr21ggiHUwNTYsgvX8UnBVoOav0sCJh1rrRy0u//ahZUx9dmekrhFA== X-Received: by 10.28.234.80 with SMTP id i77mr8840181wmh.76.1511519371203; Fri, 24 Nov 2017 02:29:31 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:c858:99a0:aef3:7a9d]) by smtp.gmail.com with ESMTPSA id l6sm10842777wre.53.2017.11.24.02.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Nov 2017 02:29:30 -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:29:27 +0100 Message-Id: <20171124102927.2502-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 I missed this driver because it is in the staging area. Signed-off-by: Christian König Reviewed-by: Hans de Goede --- 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;