From patchwork Thu Nov 23 16:14:28 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: 10073041 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 823106056E for ; Thu, 23 Nov 2017 16:14:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75D7B2A12B for ; Thu, 23 Nov 2017 16:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694002A131; Thu, 23 Nov 2017 16:14:37 +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 DEF5E2A12B for ; Thu, 23 Nov 2017 16:14:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C31B96E7FC; Thu, 23 Nov 2017 16:14:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 86D306E7FC for ; Thu, 23 Nov 2017 16:14:33 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id 128so17564955wmo.3 for ; Thu, 23 Nov 2017 08:14:33 -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=M6E/77ylTdRgdokR95iaBzjVlL5kNiLAw1f8Yv2T0Pg=; b=JAZIcWzozyfeeyoDcLHqMzvBiaNhfaCT6OZveXNaHiMhPouopleOCtiBZx1UAMuAkR je3aeBXDYJuAg1S+mfFogYymO8gtt17T84krP2jIbRFQUl/yqxkrXcA6ZHTWgb1ZpAWi 4hvBTjHOg4Vje6aO+Rtl3mJZaTiVxsWB648AEXGPxb20/+in7UDe0GUekWprUFTIbYVD wS3D4tUfQJ3QG4ZSTGcrxJ21KYen0VtQF3NhSuGYB71+DYM3lJkGq0x/pgmMeY2kVvU7 4Nbm166ffA/gQI109TcV1v1JJToCyJ906e8NkWfJ3RWfEjzlOvmj8lC87f+j5eGDH4yN wSXQ== 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=M6E/77ylTdRgdokR95iaBzjVlL5kNiLAw1f8Yv2T0Pg=; b=bvMXTZ233gLFV4Qs0f6b4DCTjKiUInP5lp69v7B8l8LR798lhl3HlI9Ragr8Kq/Adx apDFPSYyQ6xSrMmDKfVkXv6VwiLdz6ftPhnSlEQIbuH7OPV96k5dO2RB64OfTKqrnqHQ Dw0pUsDZVEFFiw0UWE6QJZh5nTJQ5ayB42CPORaWQQoIdgqVO52Ol85p9Fy7TdEndrI7 ZYcU+4BFH6pr8oHJING5Ph6Z2Qg82Xp44ybY5k2D0enc2qIAj4Ehg0wn0viqnelF7gAp mz/hzFrlATvzrlWhNdreA+qsvghaZRIOYZC1gKbhVOViEPPWA4LD1OZeM/dnY3gA6q6D FkFg== X-Gm-Message-State: AJaThX5HMBMi3ZhtxLToQhIqHTunNOFgmfCUjdWr8oDhflT1cScpaWj/ 8YCiunrVHXWdrCbKoQnnb6Q= X-Google-Smtp-Source: AGs4zMZZQMqXe+jKmePmii0zneLNeT0NOCwBd/LXc8cMrZTgK23dDRxxdpOvx3dH1+QkvESV9slfKA== X-Received: by 10.28.128.73 with SMTP id b70mr6967868wmd.53.1511453672187; Thu, 23 Nov 2017 08:14:32 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:61a5:f6a5:4c4d:c9cd]) by smtp.gmail.com with ESMTPSA id a74sm32027020wrc.7.2017.11.23.08.14.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Nov 2017 08:14:31 -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 Subject: [PATCH] staging: vboxvideo: adapt to new TTM interface Date: Thu, 23 Nov 2017 17:14:28 +0100 Message-Id: <20171123161428.20215-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;