From patchwork Wed Jul 4 15:57:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10507291 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 2283D6028F for ; Wed, 4 Jul 2018 15:58:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E06D28BBF for ; Wed, 4 Jul 2018 15:58:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0276D28C07; Wed, 4 Jul 2018 15:58:47 +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 A9ABD28BBF for ; Wed, 4 Jul 2018 15:58:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C4A4F6EC1C; Wed, 4 Jul 2018 15:58:42 +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 75C516EC1C 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:38 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH -next 4/9] drm/vmwgfx: Add SM4_1 flag Date: Wed, 4 Jul 2018 17:57:45 +0200 Message-Id: <20180704155750.2749-5-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: 7abf84a8-dda7-40a3-b86a-08d5e1c70205 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:0EwozAeLgXuNmZy2fBCd3b2YnQmtJBFWzbMe5yFQnxTI6zprUs0+GEMkEPkacEGWbSgvexFLAYq64ZHK0/FtywAHBxkQkC+nsG3EneFExlGKz7momWao5NujQja804N9yTC61JEl6trOYA/gukEmc0I6LF+zhmVV+xo8/MoB8HyYm4SQ0iWFzjAxetFwfnqUz9e52CL92dAz/wnjmmoannY1cbTjoWbyIc41yfm3Z02TcmPs5TRecU7nn6/ZC2+W; 25:CBujcZtnYFLQtWtKIuMxGLVCcpKFFKbpMrazNJjADovQWB+zp9G0xN/Rc4nK4QDWX67vAdfSoM6/j49QwfrVv6XkTGL2Kaml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OyqXQdrphijQ/Eb7+yYk2qk+d53kr44+sDYX/; 4:WtuhU1zr59rVEeyOZBlKpaPU0CKrGuQlD6y5+qhWYn3i11+9j/0SV7ZVBO7Ijs7cFkKJHBQfh7xr7NXXacDuMsO0GhZrIHRR3PwdZ47A+zzUa2qVBUSaT3JI7R8Eqf4D8EhL2KRvDuO6jk1Jw4HZH5D6+R7aXVeb43rnDiAXaaUVuOXt1f427AbBdnBL087ZLz/Yy4laOIvjG1h41SmSwy7Y8aO4PR2tdRQK5yRqr1P9l4n//99WI/Ditp9/ckQj6IzbWBGQFQJ1CI34sFyYm+xFHd/2rXViSzLpoot0C7Vqv8AN8JYe6bsu3wY6SU1c 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)(575784001)(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)(14444005)(54906003)(3846002)(6116002); 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:NySooCIjgQji/4uscj5ueK9dEnCvKTWk36FNLKWiI?= =?us-ascii?Q?o0OCLZ4Zn3lcOO3v1oZFHc8NNULzbfkcPikoL924PzZ8QC5JUrp1MpgD/FRF?= =?us-ascii?Q?U08DMzY55Ih8nSNwYowAbnyBzEq/DV1pywhZABbEvXrNZHBiFFJ55+xwlcay?= =?us-ascii?Q?MD2HeZnH8LLWk1KslVZsENx4qpJjw4iCROtvqR6tEPRbT4xemtiOGplF+F8k?= =?us-ascii?Q?l72zn5wYUI1x35s0nj8rbgsHSffunF484eQX+/R+Ev0z8Wut2B/PeBsXewir?= =?us-ascii?Q?RCzBTndHDAMfE7yWAUD0f/io1kYa4CVdCs+ybVVGudQtSXFuSZtyBzsyXofH?= =?us-ascii?Q?6LIPgqJWaZYZ1uMEV/IpTAhcG75IMDIEZCvXTZV2d2oPlSIv3sjnlKkeAIrC?= =?us-ascii?Q?cuQiu5yDDC375BtB2gSpL/Mp1jah67FRJSmXHOFzP3sJHGTHvworcp5YSCWc?= =?us-ascii?Q?gICVOHigYRxrj+rHBRaphzZ9UHbgIpIwaGtpNFZDLac61fnDyJ3U56lEunVp?= =?us-ascii?Q?LFONJ6al04COfUhyn6ZONcOFMXqO6Z1cfo2ORBDScuMnrTIgVtS/lFcCKx06?= =?us-ascii?Q?3kDz+ckWrZelDByCtavyFPStpFbwnmB4XQHB8V2PZNXoOpHlKNXW189xRkg3?= =?us-ascii?Q?3YHwtol1GaRraoqoUZP7q8AVnNE7oznaQQMwuwp0jKQfiqqi6YyrfxlvzV2d?= =?us-ascii?Q?MlLqwOqWdJUSQumIw3xVcH/+A87pKm7URKQzw5j/Lq+htAPHmHo1iBkTUVP3?= =?us-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= X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 6:t7JYteT8Cr8k8Np6vXOA/JTVOuZDvnP1FLgBw/dG7ytIV2JYtAgM6OdKovW+GfuxcW1tVvWp+xCL/8I6a95MNpT3IlHAVtIBgVZwBz12XFjz6xiYCPBwuURboz7zHcYB6SOEDB3QaEL7rE1+I0brX62pdnIJzjTYsB3a4DdOp7gzTT+5sfpqx+wAZTQeexx2UsOgDuEzK5btj1dSXDOAm7ukr/8LkfaP3BmtxmMjY0atEPiCJ7k+17iJL2V/lN4U3kiovapkgFakg3cP++DXEcCJyQ8ODMKqewqXNyDC8q2z7p/GYx7r7Dh/66y9DWvpbdwULBbCWA34+jWGtc9UUfHPtLF9wYTYL6kGMLnHbKJHhh0DrHupehtwyWI2FMyR6/fyjX9LzEvlbWU3ACkVs0SeSODoDOObDC2WSet/xd5RxkDO/2sWYiSiHrdscVEBt5Y/uEhweGrM23CIJpGfjQ==; 5:P38fCe8Rr2RBLAj3zHTp8FDO6NROLy4y1OoTwlcKQ336bOg83IvxIOXzAKckXgjkKQWC9HtbJtgNDs92Nb9W6YhK8j2dUwxioIWFor9q69mWBzWOMz+vs7em0T9TIWMjPVRTD5jZkZudnnuuiV9AJJQrE1Ry+1wVORi9AzwHrSg=; 24:YJIFxkMwOvnyqHML/B4wQsbXw95a2YDbLs+JUZamuG5+vlcUeAB6SS65Ru5Gs6LcKqblY8SQrE6W3DRsuG2DOvkHt0eh3M+PKVSCeebrWSc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 7:lr/97VmM5DH1eWJpCnMfBhDi/VSkiRSo7MkBMP59oyofsY1S6DYaIsnknuikPWxk8JNzA2aeht/X8CVaYgxe67IIi8bYFQZdDcUwV8n5jj1PbZCAWFE26eFLdOu8d/Sb9Beb6Pu1e0r2fgElD6xMdglLQ/XlpO38ECC+1uOxsAbO+dwY74tdPnrXKTViRUg7OYB5GObmdAGa/Q8TareBqUeJCQXFm4eQ14U2U1y8HrZOtqBIvz0b3tREyPUFaA1n; 20:cKtDDuBmMopC2PyxuCdnIqyP2TP7aXP3gBUMnP/zr5nr2oHLiHLjR92pwbEVT9CFA0nfFEDCpYzOufKXfYR4INRyrdccjg9mRyCTOPoEp3vy5rIJBw17hnZ05atfhmdFHh3XMjHQ3vmXlM7UGV8MlpB6y8pWX4IDxxetsxTq8rg= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 15:58:38.2837 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7abf84a8-dda7-40a3-b86a-08d5e1c70205 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 , 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 A boolean flag in device private structure to specify if the device support SM4_1. Signed-off-by: Deepak Rawat Reviewed-by: Sinclair Yeh Reviewed-by: Brian Paul Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 18 ++++++++++++++++-- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index f2fad88e4c54..6cf81e19182f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -916,9 +916,23 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) if (ret) goto out_no_fifo; + if (dev_priv->has_dx) { + /* + * SVGA_CAP2_DX2 (DefineGBSurface_v3) is needed for SM4_1 + * support + */ + if ((dev_priv->capabilities2 & SVGA_CAP2_DX2) != 0) { + vmw_write(dev_priv, SVGA_REG_DEV_CAP, + SVGA3D_DEVCAP_SM41); + dev_priv->has_sm4_1 = vmw_read(dev_priv, + SVGA_REG_DEV_CAP); + } + } + DRM_INFO("DX: %s\n", dev_priv->has_dx ? "yes." : "no."); - DRM_INFO("Atomic: %s\n", - (dev->driver->driver_features & DRIVER_ATOMIC) ? "yes" : "no"); + DRM_INFO("Atomic: %s\n", (dev->driver->driver_features & DRIVER_ATOMIC) + ? "yes." : "no."); + DRM_INFO("SM4_1: %s\n", dev_priv->has_sm4_1 ? "yes." : "no."); snprintf(host_log, sizeof(host_log), "vmwgfx: %s-%s", VMWGFX_REPO, VMWGFX_GIT_VERSION); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 920365c0e9ab..7bb08bac728e 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -398,6 +398,7 @@ struct vmw_private { spinlock_t cap_lock; bool has_dx; bool assume_16bpp; + bool has_sm4_1; /* * VGA registers.