From patchwork Tue Jul 3 19:14:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10505007 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 AF089601D3 for ; Tue, 3 Jul 2018 19:17:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9952C28C60 for ; Tue, 3 Jul 2018 19:17:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D55528C7F; Tue, 3 Jul 2018 19:17:12 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 429EF28C60 for ; Tue, 3 Jul 2018 19:17:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 79FF46E8D9; Tue, 3 Jul 2018 19:16:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710067.outbound.protection.outlook.com [40.107.71.67]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CB256E8D8 for ; Tue, 3 Jul 2018 19:16:47 +0000 (UTC) Received: from fedoratest.localdomain (155.4.205.56) by DM6PR05MB4587.namprd05.prod.outlook.com (2603:10b6:5:9f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.11; Tue, 3 Jul 2018 19:16:35 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH -next 08/15] drm/vmwgfx: Perform memory validations only when need full modeset. Date: Tue, 3 Jul 2018 21:14:53 +0200 Message-Id: <20180703191500.2374-9-thellstrom@vmware.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20180703191500.2374-1-thellstrom@vmware.com> References: <20180703191500.2374-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: DM5PR21CA0042.namprd21.prod.outlook.com (2603:10b6:3:ed::28) To DM6PR05MB4587.namprd05.prod.outlook.com (2603:10b6:5:9f::24) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ea88d37-b4dc-4528-9636-08d5e1197eea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM6PR05MB4587; X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4587; 3:kfP85do+ucOqM8h+lswQg/nRLC1mSPfOEhD1e+iJU5zkcb+P+cVb4q7oRYcLhW3PobY03WtPVBxdrdIOBtaU9LqeAtoOg66o2IwfQ6aGjqVTdZt8Etn5QWQX+Ecy8MYPmWMUtxWqRg/AMB246e2ILnIxBEw9+jukTZ2Bd8nCXTuelwHjk3+e732UCcDyujbtoob0H8GJ2ih4+IYf2lqo4oneXJzhlacIGVBymop/NJgf9uW/TgF2GzT+2v1hmlPq; 25:as1q53FJb/6R+UP9dL/U0kzB6NdsDZvXPDyh6g1ikUUi2jm7ARKimrEspC7+l5y9KRgLVWsWfGVpj9PDgfulvPK7xIdtrVT3Uk643V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h3IysFaQAdNRixwbNYPHaiEYB+Dq6UhEVBXwDET; 4:ne6uL9R1d6HKFvxGqABttbocDyCOwy2xKlVK1K8NobssNXoOrW5tdKuYY4Vuk25UOXU5/nvU9e4awJdqEj1kvVupysSWFZJkSLhkOfU+37QyyZuGz60JCZXywQ/T3sK+F0TonAPhMNjvLXGBPpduAiGrSDtdi+RKxGRrLUGV7nQhs0aVdng8KdalabbMO+EijFhtfoQxKjBG4nk9ThSusAVWUWN3gV3FcgzSlVaQTuJY1noNkIWBcIIZZqXu+DH40gT5GfLXZqvYxOJE4cnuKsLJ++2BWUe/HBOL26hOsy2F5AGxCkmsnHCtiUfn0hoJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM6PR05MB4587; BCL:0; PCL:0; RULEID:; SRVR:DM6PR05MB4587; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(366004)(39860400002)(396003)(376002)(346002)(199004)(189003)(2361001)(53936002)(76176011)(68736007)(52116002)(51416003)(47776003)(26005)(2351001)(50226002)(16526019)(97736004)(86362001)(386003)(2906002)(6506007)(66066001)(186003)(316002)(16586007)(48376002)(446003)(6486002)(50466002)(54906003)(14444005)(11346002)(2616005)(1076002)(956004)(6116002)(6512007)(476003)(81166006)(8676002)(81156014)(36756003)(3846002)(5660300001)(486006)(107886003)(106356001)(305945005)(25786009)(7736002)(4326008)(478600001)(6916009)(105586002)(6666003)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR05MB4587; H:fedoratest.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR05MB4587; 23:D5WH7uiJhxnyoR//5rV7+EkavUwfoI5CC1eghxa0F?= =?us-ascii?Q?6pCDvfj3YDJz88bilJMIYJt/DYr9vVBPnf69Y+PK4wmbT5ycdU9BfoFNjpWE?= =?us-ascii?Q?GSuYYWAo085duYKJy5zBIvieXc4WpBRqPIfoWjBsZjQpoo0VzWcTWcz5BTbq?= =?us-ascii?Q?N9UFB3Aq2kAuxUe+yX4GDMwbFpNDrBnQj15tuetJoa+nW+HORvag/fxWC7Vu?= =?us-ascii?Q?C/v8kWiB13qp44t63oL/O1u9I6OJc6L4HzjopUcQh6KNoHQQ6nyobWnuaN17?= =?us-ascii?Q?PkpQ5/8i3/A+p8beuWkC8Mnr4123fR2eCTbB7kmf7cmoLxlw2V60LRdJfKFD?= =?us-ascii?Q?j6l23MDKBVftDXVI7+8nis1wd9fMjx1QYbOShPt8bYQHTwhfa9ckqzyCaXa4?= =?us-ascii?Q?JIlbZw4M1584QfAK6KajoQ27kaGAOQ2OGHfvadgxvzTYA+V3SwpLw6mgMxwr?= =?us-ascii?Q?jZI8krLcpDSslDpxTd+FhX7mJXvm7Np2fzMP95O0CaraPdBySDhtnHqLw8Y7?= =?us-ascii?Q?Qnua5NiDxQvAv+q1ceF7MHZNRlFMI2ZJAyAR0tqzOHS5HRIXYrTsRSjSk2rf?= =?us-ascii?Q?fSc9xWaMEmTCEm0Casy2W7AZwrK2TRe90RJciqZY2cyMY/WtiUhwd8pDs3a6?= =?us-ascii?Q?Peqis6+hZa3CZc4COnJW+zG/nnBFYjdy+hjYvFx1a9vgXF5gwikq8h6OhRwn?= =?us-ascii?Q?QzKz/piIFSWufuA4O8kzRnA3a0VpTEcAfKjwU1Ebe/GMVFV3oIMehttoUOno?= =?us-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HoxxfDXZ+VVld+w4XVt2iv5T3h+hfIipveEKwYwiDn9KHnrhu1rdj; 20:p3aYux3C8jNhxyhIXx/MKJV+xmgZiiftOkREosauNgiVqrSyIjGAs5ihnzOs5RLya75jfGYHTL4OWnHe4sbyIsT14fGD4bUeeRIzR7yFM1LeiDLLgEFN9n+N05K9RPIUhYJZhxycH2dX8eh9PcAzCYnSICKuF4/fev9WZqtz9Xc= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 19:16:35.4252 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ea88d37-b4dc-4528-9636-08d5e1197eea X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4587 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 , Deepak Rawat , linux-graphics-maintainer@vmware.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Deepak Rawat For cases when full modeset is not requested like page-flip, skip memory validation as the topology is not changed. Signed-off-by: Deepak Rawat Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 387bb39de839..3605ac1702c2 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1670,13 +1670,32 @@ static int vmw_kms_atomic_check_modeset(struct drm_device *dev, struct drm_atomic_state *state) { - int ret; + struct drm_crtc *crtc; + struct drm_crtc_state *crtc_state; + bool need_modeset = false; + int i, ret; ret = drm_atomic_helper_check(dev, state); if (ret) return ret; - return vmw_kms_check_topology(dev, state); + if (!state->allow_modeset) + return ret; + + /* + * Legacy path do not set allow_modeset properly like + * @drm_atomic_helper_update_plane, This will result in unnecessary call + * to vmw_kms_check_topology. So extra set of check. + */ + for_each_new_crtc_in_state(state, crtc, crtc_state, i) { + if (drm_atomic_crtc_needs_modeset(crtc_state)) + need_modeset = true; + } + + if (need_modeset) + return vmw_kms_check_topology(dev, state); + + return ret; } static const struct drm_mode_config_funcs vmw_kms_funcs = {