From patchwork Wed May 23 14:54:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10421717 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 004EC60224 for ; Wed, 23 May 2018 14:55:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E4E4328868 for ; Wed, 23 May 2018 14:55:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D92D22888A; Wed, 23 May 2018 14:55:19 +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 5AC5728868 for ; Wed, 23 May 2018 14:55:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 48FFD6E51D; Wed, 23 May 2018 14:55:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0047.outbound.protection.outlook.com [104.47.41.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id E853F6E51D for ; Wed, 23 May 2018 14:55:16 +0000 (UTC) Received: from fedoratest.localdomain (155.4.205.56) by DM6PR05MB4588.namprd05.prod.outlook.com (2603:10b6:5:9f::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.5; Wed, 23 May 2018 14:55:14 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH 3/3] drm/vmwgfx: Schedule an fb dirty update after resume Date: Wed, 23 May 2018 16:54:21 +0200 Message-Id: <20180523145421.2501-3-thellstrom@vmware.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180523145421.2501-1-thellstrom@vmware.com> References: <20180523145421.2501-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: HE1PR09CA0082.eurprd09.prod.outlook.com (2603:10a6:7:3d::26) To DM6PR05MB4588.namprd05.prod.outlook.com (2603:10b6:5:9f::25) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DM6PR05MB4588; X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4588; 3:cMpf0wPaiVssNKBQGsTY6w+nAKbPhIbnIluVfotDk1wXeawCAVrJ4cjHXd3CGuSurnj/ZRirMb2xRglsOOkxg07egXBP1SWMZPmpL0RoULYX+94j86b34VBpkfjurmOCraLH1Jj0SdqPulRXHxvcr9jABXUY6WwNqpacVOjE9iPc+rF5bxciGWKNJ/yT47eS1v/RI6+q8MJRLF4wy7YVKVHSUWJcB4DeCJ857pM3ddIXTsGQiQRHOw82zDUEZ7Gs; 25:4UkIo+P3HYrYeGBzdTDpR2+ehzxXQhrlSEXWda8Mx23Fbq5w/rUVNIgIzmbbFwZvB/ffTi4HATe3rGMR8XXj1xzza93qfp5JJXtPJOwZ5fRhOmpws6r+kIc9gRVgI+B3gjtOacE7qAKzcBuUwgX5FiJewSp+983T8Mx8ftB2VTbibIizjs4gY2u6MALnOXgMpAMlLv2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zxWm0pwYfn2Ra0TQHRp8CwDqzjg3EyzHy4v23dYiH4FNjvJ0Qjg7sNiZtDwadVMwS8r0qawy5V8i7peRwY3gMMpCenYJ3EbpSUER+CDw5zVbv6dBA//a+5FYBMOMh3An4nik/qTkog2kOsEJBA3pAP2HvE4jRQ1liisWiW3/FeGXRpva5NbCbtc6GSsjFnc8ChTAp66iYUDWcCjneOLl 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)(5005006)(8121501046)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR05MB4588; BCL:0; PCL:0; RULEID:; SRVR:DM6PR05MB4588; X-Forefront-PRVS: 06818431B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(189003)(199004)(478600001)(7736002)(305945005)(15650500001)(48376002)(50466002)(68736007)(4326008)(25786009)(36756003)(5660300001)(6486002)(53936002)(107886003)(6116002)(3846002)(6512007)(1076002)(106356001)(8936002)(105586002)(2351001)(50226002)(2361001)(81166006)(81156014)(8676002)(6666003)(6916009)(2906002)(97736004)(59450400001)(386003)(6506007)(186003)(16526019)(11346002)(956004)(2616005)(446003)(316002)(26005)(47776003)(575784001)(86362001)(66066001)(16586007)(51416003)(52116002)(76176011)(486006)(476003)(14143004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR05MB4588; H:fedoratest.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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM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6mLuYIrb?= =?us-ascii?Q?dun/fqTH5T9onCpi0p75E1yVLSZCBRk+wpZ5Tda6vNaoENkREAYX6oNkDsAj?= =?us-ascii?Q?UCwUei8+kp2XJVjzMpCeJ+gQfLN/Dkw9ZctzkxlpeE7nOYnBk3Ul7ydMsQ6i?= =?us-ascii?Q?ClKcJZVP9Wuss5xJCR5detTwGFpORWY88y4mXrfbgK+bGuRA3ClKrY8nG2Np?= =?us-ascii?Q?VdtppCHg+mSO+yRe8TSIM5OomNES1ZhT3QlsHuGZwV81R9cpEIXu0GRmKaBS?= =?us-ascii?Q?mx0n6NQbHzeHcpq166QzEscnjN0qQ+iTcXhqx3JksIfjj2lqyHq6umXFC9dT?= =?us-ascii?Q?prG06m0V3SLhE25Vgqqw57/a9s7jLqWTAaGEOq87JCHk9B0tksG5JbD9ipnl?= =?us-ascii?Q?QLeCL/0OGLfnAd7EMm0xso96R4OgX7jjJJDtkGtr7DBxjQ7myVE0Dq2Bjv5B?= =?us-ascii?Q?gcupAdFZNCkvcYsxc5PN5HBl6mzVyzGmYRyohHapEz3TgKVwrmhsPSYBSS0d?= =?us-ascii?Q?QF99w=3D=3D?= X-Microsoft-Antispam-Message-Info: Ybt1/GolJebpoVe9vbkzj3HAgXO461wNNv0CV3s9Ofpa/q06uqr8voEizBnuttU+Jz47Lh63DKsHal7vn6QWWR5LcToi7p4pB3IVPU7sJ/ROgEu42i9HdDC1qPkKtn6VnnP3mA3y4TTA75359+zmn7mFnCbFf/FaVTxB6WK6ABkOuBG8JemlkAp+852X21rW X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4588; 6:6ZVWQo1ov/x5Ttc4WOI5souM21UrpiyWU6uEVI2sEZp5slKv+6Iw7+faF0TPBm0pkCXUK9Kc7HX4W9VuWYA+Efm4j3SUn/MmDs8s2zJ5NQ49MG7H93w0gNQrxkwW+M8L0G+968bp6YCln1lG8eYas7zIzWs1UTuFvoSZdBJ/TSJFlFlExwvPDenwqYJFm94RVFybmRhs610as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office365-Filtering-Correlation-Id: 46980001-6003-4d69-4c49-08d5c0bd315c X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2018 14:55:14.5558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46980001-6003-4d69-4c49-08d5c0bd315c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4588 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 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We have had problems displaying fbdev after a resume and as a workaround we have had to call vmw_fb_refresh(). This has had a number of unwanted side-effects. The root of the problem was, however that the coalesced fbdev dirty region was not empty on the first dirty_mark() after a resume, so a flush was never scheduled. Fix this by force scheduling an fbdev flush after resume, and remove the workaround. Signed-off-by: Thomas Hellstrom Reviewed-by: Brian Paul Reviewed-by: Deepak Rawat --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 ----- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 - drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 22 +++++++--------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 70e1a8820a7c..8b770a8e02cd 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -1278,8 +1278,6 @@ static void vmw_master_drop(struct drm_device *dev, dev_priv->active_master = &dev_priv->fbdev_master; ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM); ttm_vt_unlock(&dev_priv->fbdev_master.lock); - - vmw_fb_refresh(dev_priv); } /** @@ -1483,7 +1481,6 @@ static int vmw_pm_freeze(struct device *kdev) vmw_kms_resume(dev); if (dev_priv->enable_fb) vmw_fb_on(dev_priv); - vmw_fb_refresh(dev_priv); return -EBUSY; } @@ -1523,8 +1520,6 @@ static int vmw_pm_restore(struct device *kdev) if (dev_priv->enable_fb) vmw_fb_on(dev_priv); - 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 f34f368c1a2e..5fcbe1620d50 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -910,7 +910,6 @@ int vmw_fb_init(struct vmw_private *vmw_priv); int vmw_fb_close(struct vmw_private *dev_priv); int vmw_fb_off(struct vmw_private *vmw_priv); int vmw_fb_on(struct vmw_private *vmw_priv); -void vmw_fb_refresh(struct vmw_private *vmw_priv); /** * Kernel modesetting - vmwgfx_kms.c diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index ba0cdb743c3e..54e300365a5c 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -866,21 +866,13 @@ int vmw_fb_on(struct vmw_private *vmw_priv) spin_lock_irqsave(&par->dirty.lock, flags); par->dirty.active = true; spin_unlock_irqrestore(&par->dirty.lock, flags); - - return 0; -} -/** - * vmw_fb_refresh - Refresh fb display - * - * @vmw_priv: Pointer to device private - * - * Call into kms to show the fbdev display(s). - */ -void vmw_fb_refresh(struct vmw_private *vmw_priv) -{ - if (!vmw_priv->fb_info) - return; + /* + * Need to reschedule a dirty update, because otherwise that's + * only done in dirty_mark() if the previous coalesced + * dirty region was empty. + */ + schedule_delayed_work(&par->local_work, 0); - vmw_fb_set_par(vmw_priv->fb_info); + return 0; }