From patchwork Wed Jul 4 15:57:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10507295 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 12374601D7 for ; Wed, 4 Jul 2018 15:58:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F14BF28BAE for ; Wed, 4 Jul 2018 15:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5C2328BD5; Wed, 4 Jul 2018 15:58:50 +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 99F5C28BAE for ; Wed, 4 Jul 2018 15:58:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2817C6EC25; Wed, 4 Jul 2018 15:58:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-dm3nam05on060b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe51::60b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 038FB6EC1C for ; Wed, 4 Jul 2018 15:58:41 +0000 (UTC) Received: from fedoratest.localdomain (155.4.205.56) by DM6PR05MB4586.namprd05.prod.outlook.com (2603:10b6:5:9f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.13; Wed, 4 Jul 2018 15:58:36 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH -next 3/9] drm/vmwgfx: Add support for SVGA3dCmdIntraSurfaceCopy command Date: Wed, 4 Jul 2018 17:57:44 +0200 Message-Id: <20180704155750.2749-4-thellstrom@vmware.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20180704155750.2749-1-thellstrom@vmware.com> References: <20180704155750.2749-1-thellstrom@vmware.com> MIME-Version: 1.0 X-Originating-IP: [155.4.205.56] X-ClientProxiedBy: PR2P264CA0007.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101::19) To DM6PR05MB4586.namprd05.prod.outlook.com (2603:10b6:5:9f::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 38ddcad5-4995-42d8-2566-08d5e1c7013e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:DM6PR05MB4586; X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 3:l5RnSVLJQxBWwEWv2ZD/jqgsjHFtjbzfzkiXHwGbOhr8kIBOYTCYDEKtU4/0bzUqomoV3+/YgoKuQy8TYLPfPmkA4OBLNGbhQMLQ52KtskQpXEbq5KkHZU7bxpbmA529nl6qCC84J4v9VQKlq2hdfIMF/j6kA57tp0+RM8aROjzdjBc7OJiBpr34k8k2tkU4gFqXO78AkhTiX0BvFgVH61NfteBTYe9+ItwJBjFaUBOWR7wR8L+CyUw9Qy9VEMWA; 25:R23GGo0A57xfGVeb7mdLq9xuTGG0yxCGL96PsZRyEQfdnJ+22YZvpCRk68TvBTUmBet5cR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GJGmI8ZAhvDFTDvLh0VuCcJ0YHrrd/qQGBw7RyUowxnaSiYWpXZv4CWVVQ8gT13; 4:mIF4ljejLDrz4PxNMHJ0vuZriRN43N/TsgWQUJGkZX9JU2lkP1xZlNl/b1p3Z0c7HsZz2EzficF965ox1sKqV0s4APNpbeWsegjVECD0x7bxUgnqaPYVrCFbhpy/OFtbEv2qd0OEMRRo4XRV04px5jS9sQh+QGq7/fOdv2pXeeU/2SlpU+U1+iB6v8K/yWSNzKy1FWMutePxThQYyiON+nLJtTLn6B5qZEtF5tyhRrKXQVaCW2H+aQ6O+FEH11UZtqGMNxD2/J8bFJv9iUy7KPcRNVYl0vbBw9RZn4VZXdppGbWNvO4AV1RHCYAEhn4e 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)(3231254)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DM6PR05MB4586; BCL:0; PCL:0; RULEID:; SRVR:DM6PR05MB4586; X-Forefront-PRVS: 0723A02764 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(346002)(366004)(376002)(396003)(199004)(189003)(1076002)(48376002)(8676002)(478600001)(16586007)(2906002)(446003)(486006)(11346002)(81156014)(476003)(956004)(316002)(6486002)(2616005)(305945005)(81166006)(51416003)(7736002)(86362001)(6512007)(52116002)(68736007)(107886003)(53936002)(76176011)(2351001)(97736004)(6506007)(2361001)(105586002)(4326008)(25786009)(66066001)(47776003)(36756003)(186003)(50466002)(6916009)(26005)(6666003)(106356001)(8936002)(386003)(50226002)(16526019)(5660300001)(15760500003)(14444005)(54906003)(3846002)(6116002)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR05MB4586; 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; DM6PR05MB4586; 23:lhU2+KexCEPutWaCDFYWuHF4//xGnAnlBNHN1kI3O?= =?us-ascii?Q?FHObrs5V9sT1SKf0UzIxshXmmVa+yud7KoKen0U3nOnyiU2rUA2rwlSdwHyt?= =?us-ascii?Q?SuDnbGvM1Vu6Ar4OPz98aHTN2c8dMD7OT7rrMUFbd7tdGNB8DdT2nF4Ne3GJ?= =?us-ascii?Q?871YvnEHHfvyo1eK8qlfeqRrQYK78G1EYm5OYQ8tTUDtJVNFpK+iOFU/wDt7?= =?us-ascii?Q?Lj6bx/bf/1tQgT7L8wuqnNdUckXPwctiYGZWQ3HW9E/xjyM/2Sgtb8fwY5F+?= =?us-ascii?Q?pTd5Y7F7wHPL2k14v5G2QA5zu8t8uS1ANGunzaw4/nKhCmnPadmiUw3cqgFb?= =?us-ascii?Q?WITr/2JU5SbWcaNsQGu2ix987O/Ekyrv/ldpmqBp8qWQZWQScgfgpeWAo5Eh?= =?us-ascii?Q?IBSIDMDZg0SLUbOL/KbjOGxg9HNMSK2gTkG4NM5pAmnTjh33hSHBMK7BogSP?= =?us-ascii?Q?0msiuMgxZdbonJlYhFfqiM/FDtHrNILvn4ygAmTjzdC27pFWyzZbyWh/116j?= =?us-ascii?Q?x6nh7xetC6z9vYtTd7sz5vPIS9jGVZi+MRGMSa7tVe/YqSM4nxXTYZN5j8kc?= =?us-ascii?Q?pp6iMDpZi2ngdClTZF4cjrEOA6Ythy5aTJRHXUWv8r6bBXucfd1sTfv01ztL?= =?us-ascii?Q?vLnUbVbBapIEGojK+ONAA3n1K/Tna2plbU0lj+acOiVbYNPESHqHvmr161eE?= =?us-ascii?Q?g0XKuJgaHd5ct50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vstnh1f8DDe2iQG9xRdxh1znN3JzTYI17qxP1UqbELBsNtWJ04WjJk03HgZ6/Z3/u6sj2/Tt/aUeEVzsNz3vftjOLpNvIX8r1fI= X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 6:ChpvwgXbulBew1oYaawo4UMgaeYHsP937CIRmguEUiOCow/n4/QHP2Uz4L5wO1p8qZhW/gRRy3AO2v6/kLtal267Yf8dyaDIsJvc/nAsZ9PaCYaDnGktgXuWchsFCNQ6D5x6Zv62SuJf8s/9QGx2UHWEl12NQ11wT7inuQICJ3yIByEbIy8VzarudAKgAfTWep8qze/j0X5krW6OOwvxKwERGm5XJbChyFkQDe+Q6dbM2b4a95j1MJ06nUKQYwzD0QXs0JWEbzsc0Xa5xrQrh2aQkvjAZZjzcNyUUrUiB4hjAZLbhsYyylzQlBx1HGACLpsfK2ZoBVvavvmYm2IFH8eJN1bFjU2NAUw28JP7XBti5tkiSr8WbZfkSeEtFpciGD9pWxq4SghJgji5AAVZBXgzb+TaU8RVP9mTBTQC6BhfR5TCutZULsG9Kp4ewYtQT9fIf88Oh3fvxCqO1wtPlA==; 5:xfegVBh9eUQtTEN+khUBye3PhrPzfEv3IM0bEA4GmMbHaG7qKzzNUZ/nkdkVibZW7kU38v+BPtPw6E1fXse97ANSarF1c2MTLCtawV73dMS2D1Pjxvb66TJ1KM7NNQmnq5Zy5r1nLHs4nk6TIzo6bJRWSmzsrHY1zfUWKGE92XY=; 24:iATDdFMc9+6Clfj8xd/tSucgO/AHPOynOuxdd0Wl1sBlmmMk4UHl65/1tUaZpJE+Kz059CDYziKbjcgSyRcHfd14KmwX5l0up4NusZskbB4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 7:VIuG5i4SaS4D79AkQd6sslVnylGj8Y8A19rFy7Gb6HE8B+REICh3OALP+rUesBVf8cWN1HBZxMazarKOfzrpfPI2RUmBpbN6GqZohiS3PDxp5rjy8CojHlHT27bSXtfWOrCiRsv2YPC68X9E3/xmpU2j6Ia9A1T5utgdecwiXpLq7yMud7flFvQ2tAYdA2Wm2n6demoQl+qCO+fcoIh7XJrxf5e11RtbcOZGjomzcoMmb8TRuqnYVE5+1vnALiz8; 20:dkIqGi7xkPeIPXSDWJhFBvjyTlJesEbkytBshYtx1ByIhMMphj8nW4XsmC37oXwVPmsWYwSJhUqpzmKp6fmNCTJ7H6zUYORjxlv4nJ8Q9oILpv6gftJES09dO8UBCAUYLnpz9WgwJ6xdI69sCYmqJnD8j93vK7ucLMTQa7l8Bnw= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 15:58:36.9748 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38ddcad5-4995-42d8-2566-08d5e1c7013e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4586 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 , Neha Bhende , linux-graphics-maintainer@vmware.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Neha Bhende A new command to support Intra-Surface-Copy. Signed-off-by: Neha Bhende Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 28 +++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 2d6efc36288f..8b8386cb9893 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c @@ -3116,6 +3116,32 @@ static int vmw_cmd_dx_transfer_from_buffer(struct vmw_private *dev_priv, &cmd->body.destSid, NULL); } +/** + * vmw_cmd_intra_surface_copy - + * Validate an SVGA_3D_CMD_INTRA_SURFACE_COPY command + * + * @dev_priv: Pointer to a device private struct. + * @sw_context: The software context being used for this batch. + * @header: Pointer to the command header in the command stream. + */ +static int vmw_cmd_intra_surface_copy(struct vmw_private *dev_priv, + struct vmw_sw_context *sw_context, + SVGA3dCmdHeader *header) +{ + struct { + SVGA3dCmdHeader header; + SVGA3dCmdIntraSurfaceCopy body; + } *cmd = container_of(header, typeof(*cmd), header); + + if (!(dev_priv->capabilities2 & SVGA_CAP2_INTRA_SURFACE_COPY)) + return -EINVAL; + + return vmw_cmd_res_check(dev_priv, sw_context, vmw_res_surface, + user_surface_converter, + &cmd->body.surface.sid, NULL); +} + + static int vmw_cmd_check_not_3d(struct vmw_private *dev_priv, struct vmw_sw_context *sw_context, void *buf, uint32_t *size) @@ -3471,6 +3497,8 @@ static const struct vmw_cmd_entry vmw_cmd_entries[SVGA_3D_CMD_MAX] = { VMW_CMD_DEF(SVGA_3D_CMD_DX_TRANSFER_FROM_BUFFER, &vmw_cmd_dx_transfer_from_buffer, true, false, true), + VMW_CMD_DEF(SVGA_3D_CMD_INTRA_SURFACE_COPY, &vmw_cmd_intra_surface_copy, + true, false, true), }; bool vmw_cmd_describe(const void *buf, u32 *size, char const **cmd)