From patchwork Thu Mar 22 10:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10301197 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 A38FF60385 for ; Thu, 22 Mar 2018 10:24:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9642429AA1 for ; Thu, 22 Mar 2018 10:24:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89C9E29AA4; Thu, 22 Mar 2018 10:24:56 +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 2898C29AA1 for ; Thu, 22 Mar 2018 10:24:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E6DBC6EBDA; Thu, 22 Mar 2018 10:24:50 +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-co1nam03on0077.outbound.protection.outlook.com [104.47.40.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 45CB36EBDC for ; Thu, 22 Mar 2018 10:24:44 +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=eAxCY95odAngZ/Cu+VfXZa2biilsOH945aha65s3Gi8=; b=MNbGJZyQGPyvrEOUMq8z3xntLvuuiYzG4/i9qh1kg0Bmbr2+NAkKaKjNKD1L5+tdqBY0Ydgdvhu/rKmchmTjwtoG5WsGu2wTP4oxgq1UkzU+Xm2nTt4o1KQpsxMERHAcDSootWKnYPiVTymebmdg+hMVTBxEUeq7kStm6FYWKQQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; Received: from localhost.localdomain (155.4.205.56) by DM2PR05MB767.namprd05.prod.outlook.com (2a01:111:e400:244d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.609.6; Thu, 22 Mar 2018 10:24:41 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org, linux-graphics-maintainer@vmware.com Subject: [PATCH -next 06/11] drm/vmwgfx: Get rid of the device-private suspended member Date: Thu, 22 Mar 2018 11:23:47 +0100 Message-Id: <20180322102352.2881-6-thellstrom@vmware.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180322102352.2881-1-thellstrom@vmware.com> References: <20180322102352.2881-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: HE1PR0502CA0021.eurprd05.prod.outlook.com (2603:10a6:3:e3::31) To DM2PR05MB767.namprd05.prod.outlook.com (2a01:111:e400:244d::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2dafd568-0772-4f4c-b6d3-08d58fdf1fe8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM2PR05MB767; X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB767; 3:LoZP8BVQZn8myHtjBbfilIMm0usbKNczUcP3rUJAT77I5gALQHSZ6GhtISTIiychNiyd+qqBMYQ5RhX8s/TH55CWaz1cy6XbC4LlhuGlh3rZ6JDLvAWcWdycp14vuBju1gOubuDXLwInu0naDRwa+sBPA2tZQICtpAsNbVM0brUeIDgqbz7XRoPSrLgJsIcCXOpd2A1NHUrtFciJn+4SdmKjLnSUT9iCnLoRabh66C7VqoYWyF+SmJlEfWtlu1Be; 25:n5j4B1DIUY++YUFg3s7YOQ8aBlulWZF8wZNXZc4CuQWedEnQCXQvA8PMyqTf+xvdPocvwzMzpzAnGKmw3PkW/p58mg7mmbXKzOgBqtJOCsJZ6X0pgwU40xXc+yHG5g6amM0Qz1PaA7J4gYfpHIMAz5EI7Gn8gR7J1jJH6OGpVF3PvQdpZvO+0NmWeLvooqnsqLuvotX0QyzlwBNN2yI0liuf/8pOVyHt2yDiLavgsvtp9F+r8J5lEqDNcfZnTDYdfgnpEgVlGbYdJDW5U0xNrKyVwxZ+cSpHkmRp489z/D+g5wiA5CoArHC1uTr0M8hnxDS93khqK2Ahhzli3O6nVnvzEPme957O0Q8TY78dmPQ=; 31:yoRJRJuCi1K2INTnNXYztaBOolfzzSVIbre9z2dkxlLuw11/FcjtHZIpFztpDcLKWr2Qj9R7+rNOSADCqoQFR5V055b7RbLil2ugED2NpsVm9a3MCptT0LPa++b6q/dI+axNQlFY44B4wHE3TTcgJtJXinTf3mibN84d/a0Zx32w5axDsrSyf7XZ96aKk2rCBHakh4dG9LnbS2CiHXuybwFDJmF6cRTdSqnIH3Wd+Lo= X-MS-TrafficTypeDiagnostic: DM2PR05MB767: X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB767; 20:1NQ8ZB/DR3iPUKdmyLPA3/ip0p/FTx/SVvNfJarkX45KE5I6ShA1Lsw0vB0dt+NIM1FDfpco8JtK/DIfyAtUv2EMgh2CHTnqemgLF3bp3sD13WdrfZgpJj5TdPXt3/FyGnSBje1u/giUh0zCmhld0aUzhBEBgbwNRzKFo6pIePwX1X056M3gB1Bxw/muvPRq8TKWzmzFAfWXcS63Blje++2+Mx6saUVu122B/ZrjiQCQsIIViVDKLxX3fdXnV/GkhiNHuNDJeBQHli+ZE/9tlGK7RDaVy5g5pcOaEhEFjplUrUDc/GycwSSsev3yt8GHdcpmcX6xHr7UeBUTkNGOl5VQZXcWyL4h3qSS+s94YxjNL3uLqXnOh0bkLnLdplFfA1LYL1JIEk+TtjcW+4AUyLp1ybu/abXWe4Z2Iinyk7awjbo6yvJhDCWiC8h1mIUoX3ZYMtWNgruZ5oyvj5QsHNIH0kpih0JPXaI2Y/8Vpb59xkq0d6zhUQtEMSnM2pYs; 4:9hkhvfiYY5hTAryMPTHFVtWXjteJ97F9/DgAMbXF18nu/hvvsYBJm+tPSTphX3wvriVPq4Pfjmepg+m7l2yOJ9vR8j/0c3v54I+3RnBIsuiRB276zvFo4txsbux0CgIYd1LAs7llTH8DlZS0o/qjapBddWedT0sEmvIEGaFJkiwcMAB4fcqqlVOMZTDECAOrTnL1Igb5wt5kj9FdKNPkXFOGKy4AdZCxClCLV/sDDOMOlWbOxoXU+pRT2lNAnQAvi4gFDEYnlAn+AF7J6N4FKXSOYpQ6PnbbywgPKr5r35C2iyXLC4Ovh2wnNuE7oIyBGqCg19YS1ormrQyXPaNzow== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(10201501046)(3002001)(93006095)(93001095)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:DM2PR05MB767; BCL:0; PCL:0; RULEID:; SRVR:DM2PR05MB767; X-Forefront-PRVS: 0619D53754 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(346002)(39380400002)(376002)(396003)(39860400002)(366004)(199004)(189003)(76176011)(15650500001)(59450400001)(8676002)(81156014)(316002)(68736007)(5660300001)(305945005)(8936002)(50226002)(16586007)(36756003)(81166006)(86362001)(50466002)(6486002)(48376002)(186003)(16526019)(6512007)(53936002)(6636002)(6506007)(386003)(2950100002)(25786009)(6116002)(52116002)(106356001)(105586002)(51416003)(47776003)(3846002)(26005)(1076002)(2906002)(97736004)(7736002)(66066001)(478600001)(446003)(26583001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR05MB767; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; DM2PR05MB767; 23:xzgXA+wL0xCpKhSbOC/ummcfOWwyg4d6Bke96HjVCs?= =?us-ascii?Q?FLRCVbd0BOTMlj2QBPihHi0WMRHEJ3s8FI5GQsV4cJus8qe1HL5lp7JK1GCQ?= =?us-ascii?Q?SO2WdFHZaJ1fdYIMvmBgB3BqSDWfWeTgJ7S2mYgpvpvQtJcbYBpkwuCftkxQ?= =?us-ascii?Q?tSyJaIL+zSAWhrQqRt536rpKAqM3ORXNM351h2Dd0oP4VYEUy6AtAn8174ay?= =?us-ascii?Q?CJIz1OTRftOe0I92wVh0sNXfxLStXiEY53QWABwSYUmuN1vlHu7kWD4DQ87N?= =?us-ascii?Q?wTLDVywonxpsTCT9xjnmiZ+EC6QO5faonK/aQt2Gv9YaersvQBactxvlOrjZ?= =?us-ascii?Q?tAgaGGKIuOeP+6SEddJ/HHEGLlCQpWKApDKpl/jPt7YcgFNrNz1lKecl6MkD?= =?us-ascii?Q?RtNLkI2RWN1S6BCacw3xHMBbQPJ1n87EtnVELfkQo8H87k2oyAnm/CpLfimM?= =?us-ascii?Q?fhRN7y5xxRh07C+bRoC4j/p1PIlN4WmPCWpqcMkCldo6mWtfrUpKw/H0lGlR?= =?us-ascii?Q?V6R9pspR8Ktb2f4efuQIt9Gi9Wv0B34KnlEi+GOzxykaizcEammmAeBP62uD?= =?us-ascii?Q?D67PErmg0nRNudZ3adtGC0gG0eriJSbSwMBDPQgpSze3Qh6vSwDj9/ZVyqd+?= =?us-ascii?Q?Z0g77kDytOXVtaA7BErxJu1dqFT4xWi91znfkcdE9NsqEv1mVQOQWSQnbTLW?= =?us-ascii?Q?XRuObXUtHQEKgnBMHvAJUJKl5/xbeNwcW6+DZ6FwBfZ8iS8krdxXyFZIypGs?= =?us-ascii?Q?j3MLyR7ToMOHrmLzpL68jw6YnQmiUS4b8QuGtMmlgB065CQfPfvjluYrBLGR?= =?us-ascii?Q?6an3I9bobe5lCpcE6rvslj46nr0ilkkavsSIo6Ty/KHIRuHbOfgVeXlDLWn2?= =?us-ascii?Q?4YKuxON+WedLsnscoNtVnHXXrSjAiZahjgmwVfzqMjtnLRlP4gwqc25oWUWj?= =?us-ascii?Q?/alHQQ48wE0K3PB4dR2nCyInKNLRXxs8jcH2coTiwcnBndhZ04BfisckwwSE?= =?us-ascii?Q?U2GlSXw0AG1lrkXmk/pXhI/AbyQzZGB7AkAVx+dMrUDKNnU3/iohzoC+Z9Ss?= =?us-ascii?Q?+VadWmWaPk/4aqHboNyiBYRKTfxl12+oYQe44uwMmxhgZ0aXwgONUSeooUX7?= =?us-ascii?Q?npsBenF6JlUAY8cuFAeE0p5cEfF59OIv2Uwq731pYUGewvLz6mFKgaxaPwma?= =?us-ascii?Q?PhwOex2vN30EU=3D?= X-Microsoft-Antispam-Message-Info: TfDQL2sLsidWE7TTcyQz6OLwbr3Ej2E2UvNvwwe3QRhTAm9oQvUZWVv8uF9lzFCOMuKfn29o9xKcUnyB0NvEDPGBTr6IbJPGaMhkcaidgiZaCNjIZ5mmqOIUypCTc56EnmHfgM12kZESZtsx1GLI3vhY7dAM2cSbZ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i/DlsIrbwktxuSqy2eMSzKM2nmecQs8htN/r2k5Ce/div4lgXKAOWKmbKywUPkjr14FrYk0jl0bNhV9k0tq9OP5; 20:k7UybelJxLSenzv4URFLwIJvuuwbxPbY6ihi8cXET+58dRK2dAMdTlBQVYmwvVH03maMsHv3wZficTov+nlKOUFwhSYwK+QxEHvDWRm9ReLNiCyZxrdBg4Rb+fM/ql3goQ51glHLnuQeU8MuWrB6av8GAjS6AQ0tjEaeJ2A5ew0= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2018 10:24:41.1541 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2dafd568-0772-4f4c-b6d3-08d58fdf1fe8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB767 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP It was used to early block fbdev dirty processing. Replace it with an unprotected check of the par->dirty.active field. While this might race with the vmw_fb_off() function, we do a protected check later so the race will at worst lead to grabbing and releasing a couple of locks. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 3 --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index c66f32a6a9d9..61a03ac90f8c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1449,7 +1449,6 @@ static int vmw_pm_freeze(struct device *kdev) DRM_ERROR("Failed to freeze modesetting.\n"); return ret; } - dev_priv->suspended = true; if (dev_priv->enable_fb) vmw_fb_off(dev_priv); @@ -1471,7 +1470,6 @@ static int vmw_pm_freeze(struct device *kdev) vmw_kms_resume(dev); if (dev_priv->enable_fb) vmw_fb_on(dev_priv); - dev_priv->suspended = false; vmw_fb_refresh(dev_priv); return -EBUSY; } @@ -1512,7 +1510,6 @@ static int vmw_pm_restore(struct device *kdev) if (dev_priv->enable_fb) vmw_fb_on(dev_priv); - dev_priv->suspended = false; vmw_fb_refresh(dev_priv); return 0; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index bfb97625708b..42d2acd804c2 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -497,7 +497,6 @@ struct vmw_private { struct vmw_master *active_master; struct vmw_master fbdev_master; struct notifier_block pm_nb; - bool suspended; bool refuse_hibernation; bool suspend_locked; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index e85c1868ef12..be40cff3e1f6 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -187,7 +187,7 @@ static void vmw_fb_dirty_flush(struct work_struct *work) struct vmw_dma_buffer *vbo = par->vmw_bo; void *virtual; - if (vmw_priv->suspended) + if (!READ_ONCE(par->dirty.active)) return; mutex_lock(&par->bo_mutex);