From patchwork Tue Jan 16 13:34:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10166959 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 0E9A8601E7 for ; Tue, 16 Jan 2018 13:35:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02E17280B0 for ; Tue, 16 Jan 2018 13:35:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB1872834A; Tue, 16 Jan 2018 13:35:33 +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 90A3B280B0 for ; Tue, 16 Jan 2018 13:35:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4FA989815; Tue, 16 Jan 2018 13:35:29 +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-co1nam03on0083.outbound.protection.outlook.com [104.47.40.83]) by gabe.freedesktop.org (Postfix) with ESMTPS id 47552894D4 for ; Tue, 16 Jan 2018 13:35:24 +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=Gmu19MPCNDBfDJJcFxRbAvzy0wmgXUQKMAx87MUn0WQ=; b=UC+mByxpNKxkZfKrEMWO0MoboxCDnncN2SIM0ZXkf9ZXXH5qm71BmX1+k4PAD2CGxpngUKl/E08Yde5pQti7RzenTG6EAwuT9oo/rVDArejOMwykNpUF2qayYlAb998iFoHFxb5Pdxl8VX6tfk91++V58yiNifTwNjr5lCKIkqM= Received: from ubuntu.localdomain (155.4.205.56) by BLUPR05MB755.namprd05.prod.outlook.com (10.141.208.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.9; Tue, 16 Jan 2018 13:35:22 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/7] drm/vmwgfx: Move surface copy cmd to atomic function Date: Tue, 16 Jan 2018 14:34:29 +0100 Message-Id: <1516109674-10087-3-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516109674-10087-1-git-send-email-thellstrom@vmware.com> References: <1516109674-10087-1-git-send-email-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: DB6PR07CA0086.eurprd07.prod.outlook.com (10.175.238.24) To BLUPR05MB755.namprd05.prod.outlook.com (10.141.208.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18f9f94a-6d05-4347-d080-08d55ce5fe72 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:BLUPR05MB755; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 3:YMjkfzXx8wgzCfJQuq2+NxIYyPw6EAsCIjzNuOelexULab3UapFHl3CBi8b9OQhmtLplPZ49R4qT85F9oQbwFfaaE5pFIeoCu3CNw/oKJ20bqxWt6o2icCpb0+pz7yrBLYQwiDrItSlRIxDVA4acYUoTZPiBQityMjuTU4lHmmcWlDdyFn50V3+PbXQu2aevTDHFe2wmR6wNAdxM9H3kJwuuloKYN7+EL/EhNQJSdoUmu0JwzBOdCoGHme1OE/k8; 25:j7ZLh4oBs5k5uP7HQMtB05MgUTLtfnXQJ8IV7HtwDGuGfaEYgVpE0MU2vSoiDRQXOejZPGSJ/LTOKwnb2g8b91UIHZ5yeZBEiR3SfSoTRfssL4U//UupO0akygWUIXBE0yNSLf22zoUAb2tPodz/y3NfaXiF8Ssxw0TjHlYu0Fv8pLGvxneDNTOO6P2PUiAtYhahIvYw/b2hRLiQKhVLX7Waf4J6A3PxG/WveU1oPHCRQUY2KR6dNkFwNaRhpa8B490ED9DRMxMqUepMSTX/rmsNGEhGua1Nhn5DqDtgyrGEPB9j6yRAQCLeR55V5LnuDDB+OMJw2SHksI0ZzsgUNg==; 31:LjRt7Y7Ckg0RLMliDUXPEfZ+eCWgTbtRWeO2GazU//hDZFeWuf5EAp82rVpSocphOsPB3myyUJPrCyxn972vphB4RFgNRXoXyLn3zV5R1Bjo/04tOLoXyAvAmAkcYVZRzqw4L6tZh7LIEdR7JY6o+CNYV9Fhs//jBphrcvl8WGFC4I5SAshhWhyNWk73Qx5G58YzAdTOPgY6bGxEy2reT4QW1uwdoU9ZKZnfebF6N7U= X-MS-TrafficTypeDiagnostic: BLUPR05MB755: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=thellstrom@vmware.com; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 20:QgZDI0unUMlV45ogmWBle/xDfbLWCYUEcFSDXynSyBHFjvk3gImFW4hYVMCnsMHrKmyYBjUuipA6RewqzmG/L4xryln+DS7UbH5TXG8DlP6EcFYeToRyo7zb2BfF3CGEgv2chGlaIxoZOgmhiO363wgll5mvdShCKGoFQFRuc5QxaL2C3r/l+CFDg20484IYl7911QmALFLU80wsAcTKryLnOwwZdftjDEwfDhWbyLwHInJ/W1Q3L3LvmUwtxnWDVFOXA1qYG0sum9D26YMOmx8wOrSb4O7/QNkpEPkuwI380O/FRC2lvF+XwDzN62TEPUVfzn98z03LB/MZ9bXwmKdtBd0BuUTjBxT3RxAWJj9lmnPRXhXRdMNQZC+oBti1jtYwYcr2pCRn/4TYQTAdqAQiLPbtBS7ne7TwZexF1inDbGSbAm8mb/voxwCrotwn8unIapGPiQmJ+ku/PAHn2YS44Fh3qaYJ+h0F+TPeq2F1tUm8AVOVTJWvKWNVcQHg; 4:SiVDSf+RvWPAW7KNaq4+E7BGs647vNQEBMhclOX5wGTbVhlSEhdMJ+jCF0KyMQraFvqWfu8iJ5TxtFMWSthQ9ke1tk8rh93HStTCbdKW9AeRG75wDIupWZLuM1IyIJ/+PqPCgjXmImeCPrTLItq3WPcNuWhWwM1mmKsH2V2cVi85g8yhp5a7xo1GTuKwYuFLKmFYzGfyhEGaM754c/d7PkWpsw1A5dpdi1eh+66FmyAQcWK7jQJdzl44cyrs3pLEf+gbJjeaWrDAPocaUNaVAJH7JeNKP4da3CHbDvoC6iUH/vcooPpgx3ZDJLDS3FJq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(3231023)(2400035)(944501161)(10201501046)(93006095)(93001095)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:BLUPR05MB755; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR05MB755; X-Forefront-PRVS: 0554B1F54F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(39380400002)(376002)(39860400002)(189003)(199004)(50466002)(7736002)(6916009)(97736004)(106356001)(305945005)(6486002)(2950100002)(107886003)(478600001)(105586002)(2361001)(2351001)(5660300001)(3846002)(86362001)(6512007)(59450400001)(26005)(386003)(6116002)(76176011)(52116002)(6506007)(53936002)(51416003)(2906002)(68736007)(8936002)(316002)(16526018)(16586007)(8676002)(81166006)(81156014)(36756003)(25786009)(47776003)(4326008)(66066001)(48376002)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR05MB755; H:ubuntu.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:XKPEIdQdp0mTOK508hSdPuh5K7EUQI0+RSeQhEjs8K?= =?us-ascii?Q?EhGAcqVsHeHi7zKeph3yR8boVBf6V/ZjTLNeQnK7g8eiN4iVA9sY+ug7TnJ0?= =?us-ascii?Q?/DRJALvNQ1RaSl+bn00+F4G/vWsX+z973oOcNuXb20hvxQBMJN0mZexlb97s?= =?us-ascii?Q?wVp3wmZjKIlaRj8W16LsTm3V9q6z7DWpfSG8YjdDevYxRuJPnq35qttd8nID?= =?us-ascii?Q?pApZkmYeTk0wVwIE0j6ho3/qceTqABeNSP8x/77u8eEVDYTob4brZfFsll11?= =?us-ascii?Q?Qq1ONOnn1BPwa4wo71GJ39YKxS71HEe1h+7tTsDdzcj7F368s8O7KhX3xbDb?= =?us-ascii?Q?TIytKzS4Mx/r5iLeb583wZeGW44blq/+vsXs1rqkHdMsAkhOfPCZG7kQRDNj?= =?us-ascii?Q?+VO0ieDi0if+luVRzzpRWIuridNBYBzz10HOldG6aHuxorSAmFf3Z6DE0m/n?= =?us-ascii?Q?lDkvWE5yiwIAc8S/q9N9PbKAeYyaUg+zS36h6jPnphbQEFeBF1+bco4fRuu0?= =?us-ascii?Q?rIu9SHvMCmc1BRCwW/uDVIe83rP/5qXQDpukLk1gddFivJtIu+sEnBDKvn+m?= =?us-ascii?Q?y86/AsFN9Uj0M1la8M139nirPgjoashxxjnKdssoO9NWHi3cP74IfOqkzRVX?= =?us-ascii?Q?uc499BHup4gNll4inZLg7vElF/JGe1lhnsyefqQmLTku6PMtHh0XQw8nlX64?= =?us-ascii?Q?/+54zy9ZIvHx0+GDfFuY+xCW/ThILVltxmj9gNxE/pFxu1f7bwxpUyg637Sb?= =?us-ascii?Q?crRAQwzMCThI2ZJ+6eHRl/EdOILdykC64cdPfCbVkrFTcwgh19XcZbXE/V5j?= =?us-ascii?Q?5OnTfKzxUE3LuDOWWeIa4818BjepFAslP9cMk2hzJ7C+K9MfJxsWpIL9RlDw?= =?us-ascii?Q?iasmwihlfDr9O8vyyqV+ZY2qIdYwj8wiWujB/Oja16dlch1ayVCKpHjPQxE8?= =?us-ascii?Q?nJ3XOW3Rys7fm9BxfgcNXYnu0W7GB7bI3jK5288KTBfpw3zYolWG438mOwaR?= =?us-ascii?Q?n/iTmzVkCD1kUJpLs27aLqaX18kPbHEWyaRkMj6wizbmGaDagbUuN5z2qiTc?= =?us-ascii?Q?Mn9opURJBAFH7ASB5nQbi12MJX6toZmL7Rj6G1zwcWZOVlswfSlUV1q4lW9/?= =?us-ascii?Q?OSMPYkFDQ0w8YgHdrJouNkurMOPxKx?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 6:yk2uF2KBYbg74GqCm+umgOT3c4tt25Apb8Kf2S+Laqu0tTvW7u5Pf7XRyFQhQTlH8uOFJMWWC86MWviTJl1hifH8EXXGj+Xk16tFgZfdaJm4KxIKJclxnYD4Z9ISevPYScxZBYxZgrQ1AxEYm60RnbXwCFWYLlN8sbbSO2JIOEuqNUsoRduWfe58OgJMHTXxPe4l1BwZ3QyxYmSdNeT8d8hndZlOG8kNVlNlYfc5wXwDhhER7AELKvw8zd+mLOthnjiJbxSVS9qi/QIEknarf42D1gpMSHf4hS3xUBjVxPwtRhjYwe1kyPSdqwA4/4J4T73WVNZR3tIqyn4TdGcafq/3CxEcykYXAAiku2oNqLs=; 5:3cGJ68TThcUGHFHB1cHKo4pYnfp5X9zFt6JRryLKbS1x7UC8Ob5u7o8BtA7Ullhl+BAhup+M+MywdJYj2Xrmc/gsripJxxY4VO+fZt60QrWF5BiyOBq+e7SpdRry3qWmHgAzNsAu9Uwf9fC42y+8wSrbBuXfh5Taq1tYRsdO/e0=; 24:2uhYntW/AXsrj0slS2Ljr+GAeBDpD0c1E9c9Wm1rMPlMpbOMc1vSYBg9POQnaJWrUTL4pC60K93KVdg1UKNU4AZ17+kRqwY8gRWklxAoh/8=; 7:2C1hPWIyEATgUZuXGsOz2dzcYAK7f/2g8C1FhS5D8cSnG6+s3kFfzd8NinGBhMF3rNZtXqyRJsFVyzqev3f7wVetmu9i6lmi+KpMttVo/CS6SgFh2XX6PfhMiIyb+9QmiDxAY8OICn3BX4i1Snh9QJ5PPH32sgOlVlZBeBMS54vLm+s5ZkeIm0bTxFBv1ZAaokii3TSP++14ECRFiK7I9an09KZ3OjOGAql3DHOsn6/uoepr64hLgxG6tyQKhktY SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB755; 20:1q6zpYGAUrf0slDxGTbRQn/uMlbtHrxGL4oHuUzlQCocYQvvXuNmIwF5Qt4nA77UN0j7x8TNiDNNvUFDU3dHQN+OmPaw+ai3W2lHA53ppzJ4C9lRLcdEqmrgd/CdbL7pyAAtaqIOtm4AmiPceyGBvJXPXC8iPe6b2CCfQNDKBbE= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 13:35:22.3840 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 18f9f94a-6d05-4347-d080-08d55ce5fe72 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR05MB755 Cc: Deepak Rawat X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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 From: Deepak Rawat When display surface is different than the framebuffer surface, atomic path do not copy the surface data. This commit moved the code to copy surface from legacy to atomic path. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 47 +++++++++++++++++------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index b2f7db6..c86cec1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -492,8 +492,6 @@ static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc, { struct vmw_private *dev_priv = vmw_priv(crtc->dev); struct vmw_screen_target_display_unit *stdu = vmw_crtc_to_stdu(crtc); - struct vmw_framebuffer *vfb = vmw_framebuffer_to_vfb(new_fb); - struct drm_vmw_rect vclips; int ret; dev_priv = vmw_priv(crtc->dev); @@ -519,26 +517,6 @@ static int vmw_stdu_crtc_page_flip(struct drm_crtc *crtc, if (stdu->base.is_implicit) vmw_kms_update_implicit_fb(dev_priv, crtc); - /* - * Now that we've bound a new surface to the screen target, - * update the contents. - */ - vclips.x = crtc->x; - vclips.y = crtc->y; - vclips.w = crtc->mode.hdisplay; - vclips.h = crtc->mode.vdisplay; - - if (vfb->dmabuf) - ret = vmw_kms_stdu_dma(dev_priv, NULL, vfb, NULL, NULL, &vclips, - 1, 1, true, false, crtc); - else - ret = vmw_kms_stdu_surface_dirty(dev_priv, vfb, NULL, &vclips, - NULL, 0, 0, 1, 1, NULL, crtc); - if (ret) { - DRM_ERROR("Page flip update error %d.\n", ret); - return ret; - } - if (event) { struct vmw_fence_obj *fence = NULL; struct drm_file *file_priv = event->base.file_priv; @@ -1349,6 +1327,7 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, struct vmw_screen_target_display_unit *stdu; struct vmw_plane_state *vps = vmw_plane_state_to_vps(plane->state); struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc; + struct vmw_framebuffer *vfb = NULL; int ret; stdu = vmw_crtc_to_stdu(crtc); @@ -1363,9 +1342,10 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, if (!stdu->defined) return; - if (plane->state->fb) + if (plane->state->fb) { + vfb = vmw_framebuffer_to_vfb(plane->state->fb); ret = vmw_stdu_bind_st(dev_priv, stdu, &stdu->display_srf->res); - else + } else ret = vmw_stdu_bind_st(dev_priv, stdu, NULL); /* @@ -1377,7 +1357,24 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, else crtc->primary->fb = plane->state->fb; - ret = vmw_stdu_update_st(dev_priv, stdu); + if (vfb) { + struct drm_vmw_rect vclips; + + vclips.x = crtc->x; + vclips.y = crtc->y; + vclips.w = crtc->mode.hdisplay; + vclips.h = crtc->mode.vdisplay; + + if (vfb->dmabuf) + ret = vmw_kms_stdu_dma(dev_priv, NULL, vfb, NULL, NULL, + &vclips, 1, 1, true, false, + crtc); + else + ret = vmw_kms_stdu_surface_dirty(dev_priv, vfb, NULL, + &vclips, NULL, 0, 0, + 1, 1, NULL, crtc); + } else + ret = vmw_stdu_update_st(dev_priv, stdu); if (ret) DRM_ERROR("Failed to update STDU.\n");