From patchwork Wed Mar 21 09:53:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10299027 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 5657460386 for ; Wed, 21 Mar 2018 09:54:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B37129704 for ; Wed, 21 Mar 2018 09:54:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D9D729779; Wed, 21 Mar 2018 09:54:25 +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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 8127929704 for ; Wed, 21 Mar 2018 09:54:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 97DC96E53D; Wed, 21 Mar 2018 09:54:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0074.outbound.protection.outlook.com [104.47.40.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF7AF6E53D for ; Wed, 21 Mar 2018 09:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=E0kk29GG8gJMTzfBpn8XSRLeV+9sDrUiwZd3TyrBNe4=; b=fjdW+fu5Cbs4cay8iktv9ZbwG7Wqfd2GjnW5w0r3MZixS2gBRPCs8rrR1a2i24P5A6VUDZfVvTdsn1PMaqUAJjlK2nL8bQvj7h1bYlg2XP6Ti+U5GyN4zkixAh4f0T69PnSSHqbmjpcF99N64Jw50i5VeRlhnmC96oRB5pOerUI= Received: from localhost.localdomain (155.4.205.56) by BLUPR05MB755.namprd05.prod.outlook.com (2a01:111:e400:89e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.6; Wed, 21 Mar 2018 09:54:17 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vmwgfx: Fix a destoy-while-held mutex problem. Date: Wed, 21 Mar 2018 10:53:46 +0100 Message-Id: <20180321095347.3118-1-thellstrom@vmware.com> X-Mailer: git-send-email 2.14.3 MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: HE1PR0402CA0006.eurprd04.prod.outlook.com (2603:10a6:3:d0::16) To BLUPR05MB755.namprd05.prod.outlook.com (2a01:111:e400:89e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 774901f9-f338-4f7f-2df9-08d58f11b6d3 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BLUPR05MB755; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 3:IofUSBVcaBJwOP9o+Gvk5Tb28n1vHzBmD5HDDYbaMBfHNNfspxfuevBwE66mtsUu6qblpaZ95ST4diGcPx1mnfKXeECRzCAF4PMvZbCg5jXJx6U0Lah2rEMqrjVOLprP4Kx3+Vomh716mwHKBkc3hI+HU6wAndeZjZ5mz5/3+e+Y+BliJfpp4zt1cp0Z95rj+c6+FmexbksAW5nfnegmB4ut+XsZOL20hlCzGotKzKXDeq2HAaTc/LAB4XuQBHXB; 25:4KSfy54o76YBffx0TkTs96P9MWokXMQ0WiPwEMDWNHhAyxruMqLz0u6YLbAS8GWJwTC082plkMhWm2cjQhP6HPJOtSv5hAwLDlNLKjGHKRDyINBdfCvOoUy7LRV0AHvJy19Uo1UsW+1OINE6MzCG1W69jIkSuAT7inzDn+EXZCd2/h+8fb46kTvvcJenaqcVdt6OOFekEcQOh1UxJTeUPt3KK5nuP67UIl4JAsPfWSBWj4XmhBwq20a7S/3+Y/OhuBAprlrUNFdJ08+D5qYd1brklx5B49XS2lK3UQDkuGII5MvG6A/4LYf2oSnaXuwMbDYHeJHYRrrv8wNZDfQCmg==; 31:1O/rUGamgrWKE/FWXeXwkVDo5Y64LYM8k/7RhO/iCsU6+IRkL8qJv71OP4Byvui1KNarSSJQXo8tFm9kH6oRtV6n/87/upkU1IwahUOBwu9NAuUhRHdJuSfMO1qRb2lPf5j/7sEYjZtVAihx0Q0qgp/jZfdrGVOmGD5as8iR3fGxUBBADRzaI5aG0giyyirhD2csWGOD0d5/JDSiKojl7zIWtbai4MR75exiDgbrAEs= X-MS-TrafficTypeDiagnostic: BLUPR05MB755: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 20:SmMgqmULdQIfN7S6d4yWYVY9oS8L4KB7GJA2fAeaRGSJVUtYb0TDzekmMKElpcmNHk+ar1lvpb2zJtlfPto45ME80hEG2Shw0oM6cx/hKrYDtHPVFx6/rkMLdJstdd1cFmGD1p08iUIxQ2rhol0glLpqy0myGFYEd6VJJIkKp3Y4uLC3riQUGS3aekbhEjfVeIhGoEoxTkdTVHFnrSjiHwavUoKKsEo4uAG0Sy4LPvuVLUkr/Szshx2yE2sReER3XpP/b6jDg/g1ONzh8dKSdFMoQm0FHVsF2hIpmPtUSMu4LzD1cmhLXZRPxwj+ZMj4hydP0Ej30UJyIbZJF7hG9pIdrpssMQYVrUfqTICcwuZHgj9fxd/UhF5FZSIwqkzp0RbD9ifAzyQ8lGKky46mzzvzrpGod+ApXQaraUDycpqtfernNQy8ohA9kBDKaIp/GygqH2GG+YvYRfZfDCURQoe4NFCJKZpfAnprTno+J5LB0nlfSYw4O2j1QaGcexw6; 4:QDZwdBIEhcccGGxRtSJ3ciZGPkvdqHFEcqZuaIF6NTt4fDAEkepU6tmearUGNgFIwix3E/9NJEzQpm242YRpGcn4GYEpfLw3tNvp9kPaP5bHx2OiX59iVeA6QuCdWQAH2fJib8VP5Z2rrFVKsdkXsQ/CDzWAyUss4ylaH3ObqrB7HEPR+6OiFuJjsCU9YPGJbCw3oBIRhvnmn7kANflaCOONaocnXuYK2g0I65DTvE+yt/EuBc7V6B1SOTbymSdvTjEpi0t+07JitYeiSzkF+egBwK+hkxeahX0LDbfa2eKqrvrULRwiP7NrtV9eZwMUDRQpSejAZmyUQ+14pQ913HdupE6pujUe2J2KyCPVSKY= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231221)(944501321)(52105095)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:BLUPR05MB755; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB755; X-Forefront-PRVS: 0618E4E7E1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(366004)(396003)(376002)(39860400002)(39380400002)(189003)(199004)(81166006)(8936002)(16586007)(305945005)(7736002)(5660300001)(68736007)(81156014)(8676002)(2906002)(26005)(51416003)(52116002)(6506007)(1857600001)(16526019)(386003)(186003)(6666003)(53936002)(6512007)(6916009)(36756003)(50226002)(47776003)(2361001)(6486002)(66066001)(2351001)(50466002)(48376002)(86362001)(106356001)(105586002)(478600001)(1076002)(97736004)(6116002)(4326008)(25786009)(3846002)(59450400001)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB755; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB755; 23:kfX0i/qTGjfB9KskYC8QlLRSW9RlRkwPjisxNQ/0r8?= =?us-ascii?Q?pYTkS2UG9eEDwbrLmFu7Ip/0PxPr0NT+BS+BCtllpU23yUgewYni8eUVt0w+?= =?us-ascii?Q?j/kJy5k3p2w0sF705qEj/vgkVLtDwW3zjNU5qv3XV7F6fX+vl8GKbVYfzF+A?= =?us-ascii?Q?9VnHfQHQ1ky6gFd9+bgdIGUKe77fJF/z9ZLlEBGzJhXmJLmfKjfsunZkaYAF?= =?us-ascii?Q?gsA4HqrzFfIDjpxJ0TA7lQUokkz4t3lkotEryPE0ASuzjCTr0QtNPJXN4OFC?= =?us-ascii?Q?peFgBpuSBA+oDHsQLstECWgLaeWc4vMUju668RD7cwlFRZoz7pl7z6f0vMmO?= =?us-ascii?Q?uz8/kccq/EE9Ev4ZpBYDykU4Gpf9H5WLyXd5bFDp2EEauMmDTeuu3fGP4ZFB?= =?us-ascii?Q?UZWHbiVhjIGRpNad0kadkW9MSRszHHuKYnxmH7nHFBQK+KTBrwRFoApAjWan?= =?us-ascii?Q?wgJcDpN1uhqZEr9ntPtuuLYJPEAllgS+eSedl+UBFtLDB/LLWCP9TFfwh4wG?= =?us-ascii?Q?izF7QwMo0+6vKVXpgyt0ulyNFE/gsuUgDE+oqWpuYUb1EnKpHcSykMnmjmEP?= =?us-ascii?Q?Q6fSCwDzCPe3Y1vPlDXElz/X/YYo7OvzUDVO08ZsGruv1zZmTEGJEvMQ2dCF?= =?us-ascii?Q?F1sx6WWbI8JcYDunfjPfqf3sL6ewW/x2c95vIhljREO9qaONW+TD1zqL/6Ro?= =?us-ascii?Q?xitelNKM221crYyseBj1gF6bPjwZLF9j0bXEYR/NV74U3eRnHsK8VHPcrt0u?= =?us-ascii?Q?IyWTyUQI+YLo1R5eFqZPjO02cIMx5Eez8D+hqXYhcfV7U45/4cTHqESjVQvC?= =?us-ascii?Q?eg4M6f44aCHFwCJN220bkDeEcWbweSEplUMrLL/YVeSU9t0OsIoytxpOPK4Q?= =?us-ascii?Q?5v44rp/upK8L95yMFGENHM8BPKDA+pvyMqMK2l54uBzskaBFavopRRh2GO3Z?= =?us-ascii?Q?rum9HWvfavaCXvF1q6xcd7nfPk+C13nonrLvSzSarhpVc+kXElQUxz87H9C+?= =?us-ascii?Q?sNMgAJy8hI3p4uVJRscTF/AQ9l7atn8phFXe8HchSwK/62Zpm3CZufylG9lA?= =?us-ascii?Q?xahTyEeGuRJcjhy6kLT2HjyCQrzJBy7EfwveQ94GLVsdExhQlWQPeI5Cn6B8?= =?us-ascii?Q?iwE23PGqo+AS+7LwfD4byyDvRUXA6f1Z3lJFbjaftSED/Ugy8/sZicXT8TkP?= =?us-ascii?Q?AJCuHgKdPExuM=3D?= X-Microsoft-Antispam-Message-Info: 0+TwHvCVv8bH/b48/Z2ottYDvUh2dzAcUNCD5rZ8XwWvlNRhC6nS+isYA0aFEtoH/alCFKVlMOgzbDnqgxS5Y3Ycw0nG474o4+8aEBH8U380z7/u2h1Tq7PFRjZOKXYpIbPlFvlRvGGn0x9ljkGi57lxlCNo99d7JBnaBkRkmpmwu3nZydGzDFqng2FTfyfC X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 6:3IwVU3wxJ4AH4uV1TYzJ0lRtwSy3zRvG4Uo1xBuQvoS+JUCstvQZgf1Vr5jGoBffTvk2oO4NGoeF/mYF6Yh11DrZyW6RPoGcfrahpDp9HbY7TpE6GpCYnScYLE0EJ4+Ba/dXHKadyypur6XUIkJtq2JrcVmUrkOTVkmNyhGMgXf31RmlVailnGb8H25Gcv1mCf/zQiIk44pp5ekwAvUmhRkqKd9Cu4+D48iYOO9xmMehXgioc8SIt1dzXlJiz9OCnNlL0hgWKQ1R+iW+BvP42B/vvtfmCvu0NM9D9xvTb1n6kox4Cj3F17yYPRgQ/sLm72J20R112asgafrshHCZYfaVG3teNKnm3GL9llhiC4q3CbXfN05u+EdRRe6Dz8K6o+OkgYnDLNS9Bm2/wsjjSdH4igKM9lsZirepvYDQmf03EhubWVmpCClUpnx/1KLmnYHUUuAu1Y0lCTHw+lUj5A==; 5:5wKjnvfaCUn1dt6qsHD1N4Pbv4RyxbDhRa1zfRzQbGD6Ty86oPEc/iZa8MPJt8ZcNDrTrZ9ry48uvClSm5h807TXqaJRzl9OgamHlM5AKko+yEccA/94alKzz1nxI5ptyEuuS9lE2Vv79Yo6MR3jFOG3qTSrmmpz9A+XU0MC8sM=; 24:LsRTkAqSoRtpZnB2bKF2ghQdjXlO1H78/6xn6HXEDjwxeBXDn+oJJol51xePU1hQ/AzdDPyJfCwIXVoxAee6G+jw/I/v/w7Gv3HiFZ/AeW4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 7:Uem4Vdjl6DCqxBN0n+Trg3BhZrvoTRBSoJJcVqWzDGm2PV6gFpJESuNAdT9Hse5J6qasLuDOZeA+WxahV/jefqjpFy6u+MW4r3tQHWfkXF3L2ynhTzabe2HEv/vKpSqVIK0vBulBVR2xxmtontgs2EdEsX4sXL0EPksr+71Ifp+x3QOsLaR3WqkOBTcvx+os2fFIoiADL7v6AwagBpCvBuDx88wi4WDrSgqOZbFdxLa6FioN5sbQjoxFGZsIzAlo; 20:k2I2RjPmB4VqjSDBpevluyU0QfbwbITuxjXFwFjdVVklLUGw7366q61RnoGFiNWquRdLT/wV4MyBoz6U0DkIgpGCB8+PEVfieaqjtrYtLafe70TR1Rg30xlHQd5UIrRvyU7IgqE20CFzv6TRQ17mA82wAi7L9GnH9UYAnWCCkIs= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Mar 2018 09:54:17.9225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 774901f9-f338-4f7f-2df9-08d58f11b6d3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB755 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Hellstrom , linux-graphics-maintainer@vmware.com, stable@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When validating legacy surfaces, the backup bo might be destroyed at surface validate time. However, the kms resource validation code may have the bo reserved, so we will destroy a locked mutex. While there shouldn't be any other users of that mutex when it is destroyed, it causes a lock leak and thus throws a lockdep error. Fix this by having the kms resource validation code hold a reference to the bo while we have it reserved. We do this by introducing a validation context which might come in handy when the kms code is extended to validate multiple resources or buffers. Cc: Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 28 +++++++++++++++++++--------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 12 +++++++++--- drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 5 +++-- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 5 +++-- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index b3d62aa01a9b..3c824fd7cbf3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -31,7 +31,6 @@ #include #include - /* Might need a hrtimer here? */ #define VMWGFX_PRESENT_RATE ((HZ / 60 > 0) ? HZ / 60 : 1) @@ -2517,9 +2516,12 @@ void vmw_kms_helper_buffer_finish(struct vmw_private *dev_priv, * Helper to be used if an error forces the caller to undo the actions of * vmw_kms_helper_resource_prepare. */ -void vmw_kms_helper_resource_revert(struct vmw_resource *res) +void vmw_kms_helper_resource_revert(struct vmw_validation_ctx *ctx) { - vmw_kms_helper_buffer_revert(res->backup); + struct vmw_resource *res = ctx->res; + + vmw_kms_helper_buffer_revert(ctx->buf); + vmw_dmabuf_unreference(&ctx->buf); vmw_resource_unreserve(res, false, NULL, 0); mutex_unlock(&res->dev_priv->cmdbuf_mutex); } @@ -2536,10 +2538,14 @@ void vmw_kms_helper_resource_revert(struct vmw_resource *res) * interrupted by a signal. */ int vmw_kms_helper_resource_prepare(struct vmw_resource *res, - bool interruptible) + bool interruptible, + struct vmw_validation_ctx *ctx) { int ret = 0; + ctx->buf = NULL; + ctx->res = res; + if (interruptible) ret = mutex_lock_interruptible(&res->dev_priv->cmdbuf_mutex); else @@ -2558,6 +2564,8 @@ int vmw_kms_helper_resource_prepare(struct vmw_resource *res, res->dev_priv->has_mob); if (ret) goto out_unreserve; + + ctx->buf = vmw_dmabuf_reference(res->backup); } ret = vmw_resource_validate(res); if (ret) @@ -2565,7 +2573,7 @@ int vmw_kms_helper_resource_prepare(struct vmw_resource *res, return 0; out_revert: - vmw_kms_helper_buffer_revert(res->backup); + vmw_kms_helper_buffer_revert(ctx->buf); out_unreserve: vmw_resource_unreserve(res, false, NULL, 0); out_unlock: @@ -2581,11 +2589,13 @@ int vmw_kms_helper_resource_prepare(struct vmw_resource *res, * @out_fence: Optional pointer to a fence pointer. If non-NULL, a * ref-counted fence pointer is returned here. */ -void vmw_kms_helper_resource_finish(struct vmw_resource *res, - struct vmw_fence_obj **out_fence) +void vmw_kms_helper_resource_finish(struct vmw_validation_ctx *ctx, + struct vmw_fence_obj **out_fence) { - if (res->backup || out_fence) - vmw_kms_helper_buffer_finish(res->dev_priv, NULL, res->backup, + struct vmw_resource *res = ctx->res; + + if (ctx->buf || out_fence) + vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf, out_fence, NULL); vmw_resource_unreserve(res, false, NULL, 0); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index 948362c43c73..3d2ca280eaa7 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -240,6 +240,11 @@ struct vmw_display_unit { int set_gui_y; }; +struct vmw_validation_ctx { + struct vmw_resource *res; + struct vmw_dma_buffer *buf; +}; + #define vmw_crtc_to_du(x) \ container_of(x, struct vmw_display_unit, crtc) #define vmw_connector_to_du(x) \ @@ -296,9 +301,10 @@ void vmw_kms_helper_buffer_finish(struct vmw_private *dev_priv, struct drm_vmw_fence_rep __user * user_fence_rep); int vmw_kms_helper_resource_prepare(struct vmw_resource *res, - bool interruptible); -void vmw_kms_helper_resource_revert(struct vmw_resource *res); -void vmw_kms_helper_resource_finish(struct vmw_resource *res, + bool interruptible, + struct vmw_validation_ctx *ctx); +void vmw_kms_helper_resource_revert(struct vmw_validation_ctx *ctx); +void vmw_kms_helper_resource_finish(struct vmw_validation_ctx *ctx, struct vmw_fence_obj **out_fence); int vmw_kms_readback(struct vmw_private *dev_priv, struct drm_file *file_priv, diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 63a4cd794b73..3ec9eae831b8 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -909,12 +909,13 @@ int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer_surface *vfbs = container_of(framebuffer, typeof(*vfbs), base); struct vmw_kms_sou_surface_dirty sdirty; + struct vmw_validation_ctx ctx; int ret; if (!srf) srf = &vfbs->surface->res; - ret = vmw_kms_helper_resource_prepare(srf, true); + ret = vmw_kms_helper_resource_prepare(srf, true, &ctx); if (ret) return ret; @@ -933,7 +934,7 @@ int vmw_kms_sou_do_surface_dirty(struct vmw_private *dev_priv, ret = vmw_kms_helper_dirty(dev_priv, framebuffer, clips, vclips, dest_x, dest_y, num_clips, inc, &sdirty.base); - vmw_kms_helper_resource_finish(srf, out_fence); + vmw_kms_helper_resource_finish(&ctx, out_fence); return ret; } diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index b68d74888ab1..6b969e5dea2a 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -980,12 +980,13 @@ int vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv, struct vmw_framebuffer_surface *vfbs = container_of(framebuffer, typeof(*vfbs), base); struct vmw_stdu_dirty sdirty; + struct vmw_validation_ctx ctx; int ret; if (!srf) srf = &vfbs->surface->res; - ret = vmw_kms_helper_resource_prepare(srf, true); + ret = vmw_kms_helper_resource_prepare(srf, true, &ctx); if (ret) return ret; @@ -1008,7 +1009,7 @@ int vmw_kms_stdu_surface_dirty(struct vmw_private *dev_priv, dest_x, dest_y, num_clips, inc, &sdirty.base); out_finish: - vmw_kms_helper_resource_finish(srf, out_fence); + vmw_kms_helper_resource_finish(&ctx, out_fence); return ret; }