From patchwork Tue Mar 27 14:26:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10310285 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 6B00560212 for ; Tue, 27 Mar 2018 14:27:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CA3B29D5E for ; Tue, 27 Mar 2018 14:27:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5149829D62; Tue, 27 Mar 2018 14:27: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=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 C043129D5E for ; Tue, 27 Mar 2018 14:27:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C21856E634; Tue, 27 Mar 2018 14:27:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0076.outbound.protection.outlook.com [104.47.38.76]) by gabe.freedesktop.org (Postfix) with ESMTPS id 559A06E634 for ; Tue, 27 Mar 2018 14:27:02 +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=0K2YzKrIXkC6hszRIkjBXqaRseezPujz0p7ddrE+Kd8=; b=fpqkmMaTbZqiN8zGczrkrAustu7taq6zZiKnlvBct+lkyEmtBpwkZQNLLAa8p1axGMXQWIsIyiKwFWuz7vATP17DvVh32oXczraEDf7Jv/CADUzQBXQPYTmD/0faIvZH5mGhHfxSfH5PNLzDHiKzIto8Gs5Wn7U1/76Hp99ZOx8= Received: from localhost.localdomain (155.4.205.56) by BY2PR05MB759.namprd05.prod.outlook.com (2a01:111:e400:2c50::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.5; Tue, 27 Mar 2018 14:26:57 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vmwgfx: Fix vmw_du_cursor_plane_atomic_check Date: Tue, 27 Mar 2018 16:26:17 +0200 Message-Id: <20180327142617.6471-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: VI1PR09CA0074.eurprd09.prod.outlook.com (2603:10a6:802:29::18) To BY2PR05MB759.namprd05.prod.outlook.com (2a01:111:e400:2c50::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fa67bc3-34a4-47a0-2f2d-08d593eeccc9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BY2PR05MB759; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 3:wT7c3EXc3cS3/MWk11982HA67hnLDY07Xl+QHY54Rc2bL/ATYtyzi6RajqiYbXFXacVI9wc5F8FOJKs7rU/ROFWAkqlk5yYmiEjnbZPSw82dKXxyCnDL30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qi2uHzXI8dl8Jx06EOT4ediA9koX+PUF2UbR9NsLF6KG0YLdVIvSnO8BXsVSJrnHWNI5MvQ1P/wFlXgvGX+iYLCInd0VMtsv4JTvtewxbo0AkbdtuSR1yIQ9bGPadt7r7cO5Jg3tdn89D7WsMhfG58iIGvsIXyls6Q06DIFdXgLIoyABNom9wl/RmJl99of2KDtH+cIP0nHUqyUDPouIbMP4TgAvS4cDlDD0PzK4+Kh4sa5FYJ; 4:KfVL1TZU4AXe6jaMTxJuM/d/5Q7bvzKYyd/aeB4KQXe+GcBJMYlGouvoTb3a49CyQyo24WVjZ2w8WzpGmyEVEeYppSfeQHwLPUUKQXdXt8Dc0TJkTNgYor13G51Cm+C8RmjaeapS2YC+eYElffWJRLGlARP7QBii7NkZbRp9JxwPnGeVXV0fnqLwHdO3JK5GEeW7QU30uxEpP3hE/cEXXZbEN9nWgJFBiLpKaURs92zluHqt5HCLMuK1cwwkJdKqbogiW//9rJyxCWCwqi9csOlk/+AR1gbAavEFtCgGeW6m46vfKvo0Vqe8V1ytqtKfr0bNcOUqk1P3JGPBsI+BCa7tqMhvSKNorBasR2nODjQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(146099531331640); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6041310)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:BY2PR05MB759; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB759; X-Forefront-PRVS: 0624A2429E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(376002)(396003)(346002)(39380400002)(39860400002)(189003)(199004)(6346003)(6512007)(47776003)(16526019)(186003)(53936002)(386003)(105586002)(6486002)(6506007)(106356001)(26005)(486005)(486005)(476003)(97736004)(1857600001)(36756003)(6916009)(16586007)(5660300001)(2351001)(8676002)(86362001)(2361001)(48376002)(3846002)(6116002)(7736002)(6666003)(316002)(51416003)(2906002)(59450400001)(2616005)(1076002)(8936002)(81166006)(81156014)(478600001)(956004)(107886003)(68736007)(305945005)(50466002)(66066001)(25786009)(50226002)(52116002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB759; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB759; 23:ZKKYbfJphqfTsPnIuf8qeV08FATSCTEBk1J2DqzHC9?= =?us-ascii?Q?QW34RHhPhSeqz5U54zb7zoEMiNMOkcGRr7x9GqpkrqTvtqvkdbTWCvYAnfBJ?= =?us-ascii?Q?zMtH3lQI4PZJb3K6zXjTto6CzAv5/QpXiGhk6W645fb60EIcU4qYNAxxnqxX?= =?us-ascii?Q?5rGRNwUTYiRbLOVkgok3P3/OR2qGP6sKDtMSfRQFzPuEwDH1yfAP9TAtX5EK?= =?us-ascii?Q?PjfbVPqxfWmi881LYJ/wg20hmGTBRR3Ohr93zFKhfqZ4XhJXJc+YL9yC70X0?= =?us-ascii?Q?l0IwdfBXoXRGWzzqzKoebmZzs9j1thP309wlDdnK2pmePPCHZyNtbMMyplng?= =?us-ascii?Q?EnMLP7WKvJMuZMlKarSEK2H5QJ3oEXYAfcwVzQ/zanmxwX3zjKQ0PAbe5aLG?= =?us-ascii?Q?lLO5WThWVopN9NQFrYzpXelZToRPuFjR4L0KlHtCwlBPRi6hjqawG2+Xc6Au?= =?us-ascii?Q?y06TzIlB3dYVZwv5y3BwlObZpctjwpBplTwDnRSpW9Hk10YQ5WOpjrSDxWO0?= =?us-ascii?Q?jufCaliJB5jcv397lWtH3voRZ3roE/xT/VaFMgFTKm2Ih+XcJHQUiIejdX71?= =?us-ascii?Q?FjofBFbC12Dc517U0f2J+uMZyi86gKabTPafqZ531w06W/fyUFLw72ip+m7k?= =?us-ascii?Q?XyvsL/u0PD9bVl4OU62uDMtPFYnmmmm2J5x9Hk1MvMW3XZ0rpZANpBakZWPv?= =?us-ascii?Q?kBdzlr1le7UzCm7tFflcJyR0YoGOABipcxt843IXVeuOm6vFwQyHptEAC1Qm?= =?us-ascii?Q?fkBbFvCqwESUVq+awPF3qpbWrTABYN60oVlnnfwfTb74N3uFmbMC9Z4dY4BG?= =?us-ascii?Q?0XE3L8G1DleSYi1YDlFdJ5tuJ27d8hr13H6jtjMWTCVBqE9NBHBFMtIuQmf4?= =?us-ascii?Q?bLnxoJJQGEelOQdNGIi/kDPyagfO11eRXHfkY44Yap4OgDRyXfiZXOl4y5gH?= =?us-ascii?Q?dXYlJQRiJU6e5u714Cd1MRncpPxx5yVn2XvzcfAobfNx6sWRQcQ2UxtLyBNj?= =?us-ascii?Q?5gqUrrF5v/6Tu/DuVTgFV8Y87J/hF3TZ6BK5wq7NC+ShmvZvvinFckIXoGG+?= =?us-ascii?Q?ZnXXTQHLFdilrw5D0oYfmbrnsbWwU1+NJSrsLk2fIhUCKkzf/oScgFgh7btl?= =?us-ascii?Q?GfJaq5h4aBx9tK4dMZZI2rEdx635RvndH7mN0O/TROMDzSB9oH6sVdfMS23n?= =?us-ascii?Q?oo+IHUWfafSjTFM/foRs5xSQe4UPONRE2SfbnTiR+e4uXIvAxNXLfKOAwDsn?= =?us-ascii?Q?uWs5aei14qQEIklkvWXatwJa8AZcyaQgjtG+YdQzW8bb20ZwgZ2YI38PoJJh?= =?us-ascii?Q?Nny3qwem81egtEGHPrB8g=3D?= X-Microsoft-Antispam-Message-Info: pgh76woxhM+eiVpcAyidr+MX8EZnIBeY7yOesSF9Ym+rVhnpawS4rpnxS6RD0bULAz+CeFipzY3l4aatAEYEFD6VdNphHP48TIP8N5uVZprIAQV8+9CAp7ADx9znzAbdL1hf7UARjqXNTnxCCi/yyyIdDhJYNlRCZIAW4SxW016SRxmXFdLB+Lq3uZGr4D9G X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 6:rnmCk2O7m9t3Kw3mGAGgtCHYogxI04AfoU59JtD79h8ASSiYERnAQ3EmvHsaQyuVl7nJ+JBi8It+Lpn8/auQCHYy0ybfLN4HhK2qKNTEj2+3xKyAcTE/AagcjijmH57WdM4DREOuxI/++T6UQX8AWEIzSMeWq8ZCdtt2oLEcAddEepQcJQu4ofIc2eD/a7/6X/8S+AeWqbokKLiGMPEzFVj2j/B67Jht1Yzj2pRON+6LOuKXsPvLqfJXpPgEO3/BUFsV169DpqFWRQcSsvQJNnQrQMVHa3k3aVWldXSLadaIk1jvqIcD5jXjL8gpOPfxp3pssb89M34tYoi3O/YT/wVx/Mw5OuPLdpFgDKHpsCi93OY7JLIYg8T/MMgj+XhLEUfORWu6tXoZY7mRlPB/vw8xyBfPUamvYYgA9kl7w5Or7ubgdaA0UHzq76NmydFY8auTAQzyhzkjiZtZS3g8mA==; 5:dbzerH43bHXqGj50fWqwC7W3sEo+sC9RH64lAlmSVYZrEzC3IFJImkvkJ1cmOHYb1O5/5FcL1gyyoDUib4A7zpphghzNz6mZ3EXQLzggM15hYpiRbDaS4Wpjvx49zhmHos9i2egBZWrD+RLzjFAXO9YU4rVp5kuI3seSoYvC8k8=; 24:W72OHLpboMEY+re846RQ0uvMe9PfSU2v1D702cl1zRSrcOAmTrMQ3AOwUowHZQAVkseTU1BSqBhuC0zetcZqynScrezscUsH/E9zP2QNUoo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB759; 7:DLKwSvS6BdSrs9wKFLNFOaFFwuZ/N3I/X6O6X8FkCMubbtoHC3ysgCc9VqME+LoLCflc6nk8F81C24hoHdt1KUSVw0y5hglonE8E01urQfonKGrqMFd411E9oNs/+pEuFc/xXW7XLgprq+EK+kC8/l47KPnCEfKC/qJUbDd3I1GsXQyYF8KCdXvx4nWWuXsr8ea/8tEu8kDNuP6j03uufBNVspk+76PCrreMaoPKNi3b6Fj2UrSt4NASDpyM2Srw; 20:ztkZGN59inKiHwoEiGTTQNwBYgohPSEryBDQyylhPymayzM79WOeIIZ5h1/KjODOtsxRzlhtV/UmU6pmB6C+Dm6QpQ5v7tHTc5PYhZjvYrStr4LPMj3ULC7Ykh6Q6kHcxTe1CJGyjPaMkVHAydB610tri3L2L9KmXeJtcVrmyws= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2018 14:26:57.7998 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fa67bc3-34a4-47a0-2f2d-08d593eeccc9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB759 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 , dan.carpenter@oracle.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use the correct helper and also return early on helper success rather than on helper failure. Also explicitly return 0 in the case of no fb. Signed-off-by: Thomas Hellstrom Reported-by: Dan Carpenter Reported-by: Daniel Vetter --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 3628a9fe705f..0f7dc9ea2657 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -494,23 +494,23 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *new_state) { int ret = 0; + struct drm_crtc_state *crtc_state = NULL; struct vmw_surface *surface = NULL; struct drm_framebuffer *fb = new_state->fb; - struct drm_rect src = drm_plane_state_src(new_state); - struct drm_rect dest = drm_plane_state_dest(new_state); - /* Turning off */ if (!fb) - return ret; + return 0; - ret = drm_plane_helper_check_update(plane, new_state->crtc, fb, - &src, &dest, - DRM_MODE_ROTATE_0, - DRM_PLANE_HELPER_NO_SCALING, - DRM_PLANE_HELPER_NO_SCALING, - true, true, &new_state->visible); - if (!ret) + if (new_state->crtc) + crtc_state = drm_atomic_get_new_crtc_state(new_state->state, + new_state->crtc); + + ret = drm_atomic_helper_check_plane_state(new_state, crtc_state, + DRM_PLANE_HELPER_NO_SCALING, + DRM_PLANE_HELPER_NO_SCALING, + true, true); + if (ret) return ret; /* A lot of the code assumes this */