From patchwork Wed Jul 4 15:57:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 10507297 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 AA62D6028F for ; Wed, 4 Jul 2018 15:58:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95B1328BAE for ; Wed, 4 Jul 2018 15:58:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89F0C28BD5; Wed, 4 Jul 2018 15:58:53 +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 2F27728BAE for ; Wed, 4 Jul 2018 15:58:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EF3E6EC24; 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 608736EC1C for ; Wed, 4 Jul 2018 15:58:40 +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:35 +0000 From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH -next 2/9] drm/vmwgfx: Add CAP2 support in vmwgfx Date: Wed, 4 Jul 2018 17:57:43 +0200 Message-Id: <20180704155750.2749-3-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: 0b3c99ae-7055-4e04-f272-08d5e1c70077 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:REMJLntTch+N29SHLn3lgP6tMkLyNVul7IEp27ZaQvIKoCksewM7xm6N8PA/3uo+DHmFEcZ7Lu4HOiv8SFx04ZgTIonNlWAQ7Gg3QeIM5tuhsPytTdAmgPSoHroIss8udJs265l9ItL3ctK/WGbh7uY96SZnfnvFxGCYiAMLvhDZctzYnuc1jNBEUn/NjmTHHjNBFJf9XhJPEjsNREPDBccy2HWr2TnJ3fDhHgHvfy2bDE+tHnY9gU94cjWGU1dJ; 25:PUnN1EVqwzZ5bYzh9pXf1qg9J+k38oFtaNye+OH8qquAk1sgvrrylOTDTndj4PUtrmWxy0d4mcLDcLaIrT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EG6m/VpYzWBCFP4PlwQMOsmOrA2A5RTfvEY5oDVb1AlGmzI+aK15l6HnHEZIXspYizXe; 4:jX8cShH5W42EO7eTd9XkO9p/5XxKxWHbQ7o6nLFhXU+ooaqLIK8mR4wBgMTYwdSnluuU/kGVhCmJjWF7Nonvj3S3SVcWcrGHB4+lrhbVJHOpQvaNJULVSxzlN+Vs5OD7oT7C8dZqLpVey3ym5HG6qp7LdXzkOisA7vqVgscbaOW5cLTWDAX4Wq/ii9lGW0LBMhyT3+Mmz2E06G1SANo0Oe8rbIUzExvrlqBYGQ/bytpM0GGgSc5DV/aqAL6h5++7Kp2zrFlRXVRvGEdoP9I08aDn0z+aRaf538NxNmrPgHvzDJfczOs+9G+nvN4hmSPV 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)(54906003)(3846002)(6116002)(129583001)(17423001)(156123004); 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:U9O92D3JFFxtjDqrL7Xq4bLdMLYahU1HsNDjYqxdu?= =?us-ascii?Q?3czTENzSfGIXUyilD2kDaKrAdEQ7+2xR+P5zCHFyH/DowoE8jkQmgtkisiyO?= =?us-ascii?Q?cGJykSh103BNzhdq0tZfnvjstrJ7fhvqWmn/e5cgpuFBOYUIBKO795hJ3IW8?= =?us-ascii?Q?9mPIhk8Ias6QJWJpyvZoDYqHAP994ckQo6NAMQmX3BfMyevjU8gmhPj85tj8?= =?us-ascii?Q?4HEjKGv8eZ/UaMPlrSQxGslwKSn4vYH2FSWJSaSupcTN0wKDo4Imo+yU18hs?= =?us-ascii?Q?5ek/MVzmkreoAfWXVCkLbOEzWOjP0XjZg21czQobfe/GwvmrSpaUd0jSDysD?= =?us-ascii?Q?NEDJdjRFDH8D2fmgOWMcjXTtuuOsciYULfBJzoEVXq8ErtvZmrpoTSKGgklm?= =?us-ascii?Q?ieZCDky/GsqXjG7d1NDmAnAcKAZAPIBWdw8oeV4PzdLyUXVaH+PmaLYkLBd+?= =?us-ascii?Q?iPwixa6qJ3424qOXbk/zasjvOKoskE2X7RYCYe75oh8Br0EyUTOaZEDGLVrJ?= =?us-ascii?Q?/RPYCftXx/F8XPSY7wvP6RyjA9UkIrdtyL11Sh5arcUW7wFmUnJIxKwyrD4d?= =?us-ascii?Q?esKWVOjL3tXjgALkkpsUOi1mmUx9B4bZ91kaDDFjOJIusN9kaCeyw1Vcv4A5?= =?us-ascii?Q?74uNh84XKCwUMRrIycSyaX2LoId7ybUax731csquxxmngGnhOlbxan9aAvPh?= =?us-ascii?Q?IL2ESX+40StAP7XMNAsVx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QNMrN4a8/WV6AKYSy70b8VVbJo1/U74Bp/FYgW52TJZL+6iqc8PUGOFVOGE+eHcdIks5yAtmUOrrfUTj2wCqiFaN6Ocho0/cU0bf09BzueTGeo= X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 6:qCvvvAVb/YDuq0R0uo9JeXMGPPHrx3X1z8eCbltIwLtLMbTk6Su6Iim090pQ/5EV00txNyjDRoP3cQsT2L2XWka2vv1nOvhpdxrlYDCpekLFDBXRKkB8meFt5yEtOC5ENKz1m7EWsUy+JYB9/MhB+uvkda2u2jZEjGvu5OWUsxaRfWvAo6rO9qqiIg6oXEFe2Xu2+0O252AUC7P9XOwebdCq3zmMyn8U4396TUdN9vyUe0lt1hAEgiAnjZmrP5+wy94/fsjxf3aLl8LTwrKOaS9dfEhW8MaIzwigZvB0mnlUGLTtzKLMSH2103M7/cQiC6LjAvH5Cu/gQVFfbHdgR1yt09mBHZ4BpWRbqcEzN9GgxHekvmLAzyeUa4purNlvhyt2IKqvrO3HQAR+pRSfXy2jibCCAyqQtjLjxUnQRGRQtpJngdSsodInSHGiRV52fErAt7gmV4GzxZ1Dmr+xnQ==; 5:GNRHwdeFrPxKsMse4z/JzKgOlCF4phtkPUr360cuLamerNL8iy02OiTDAuK83caDhrMzGbDRNZ9mZUAdJbOae/peETcBszOUe82TCy97aZa8q7372RjF3dX6/bIRiMSVYk99BGrQk1Use3zVdYmwmnOU9Y6A3LM/ZCEzdGyMKm0=; 24:MyZl60VoW9T9wAitiGywBNJFHbAS7hjgHE9xLqsQeP9ve1lr60VesJYpU5JNu9ZVwRA3inLaPnfVBtYjJWjlI6GDBABPEGhSowI+v8+b5vw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM6PR05MB4586; 7:X/w/qwNiOB1XEEZOELQDp9bJ0GArHaqfZe1H6kOq6w+FD/HYEd0lHvmXDWgT57ugoWwtX922NNXNlEOcQ5HRAfI8cVnKoI0M7b4frtndJqaTr0gNQqFNOIC7r/u1+BRLwOyD6iEY5NtjtpAMTzAm0V9xysiQJaCBBz1dD3oZxqSxObG926kXevj5o8NUGiFhKjMui7jtXE8KDbZfyt6KxffoWyBTUJSOHTtsKt44onBzGGL9gl7iQk8qZF7mL25L; 20:6ZK8IJTBVPzL+iG1Miomy0NAKSD4P0vLifWuHUAJu7iTFFG3ezgpT1/EvMuX/oHDm4rH9xoL2umkdjSopOImcU3dtxF/dUzLJvYzyJFAIy4U2yattfykpoNBi3pHzvIJQwAl1pLY6o2h6jRZ6ODrROa48jLMnB5A0vW1rfd7RUQ= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2018 15:58:35.6749 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b3c99ae-7055-4e04-f272-08d5e1c70077 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 The device exposes a new capability register. Add upport for it. Signed-off-by: Neha Bhende Reviewed-by: Thomas Hellstrom Signed-off-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 17 +++++++++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c | 3 +++ include/uapi/drm/vmwgfx_drm.h | 1 + 4 files changed, 22 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 1128420de2c0..f2fad88e4c54 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -258,6 +258,15 @@ MODULE_PARM_DESC(assume_16bpp, "Assume 16-bpp when filtering modes"); module_param_named(assume_16bpp, vmw_assume_16bpp, int, 0600); +static void vmw_print_capabilities2(uint32_t capabilities2) +{ + DRM_INFO("Capabilities2:\n"); + if (capabilities2 & SVGA_CAP2_GROW_OTABLE) + DRM_INFO(" Grow oTable.\n"); + if (capabilities2 & SVGA_CAP2_INTRA_SURFACE_COPY) + DRM_INFO(" IntraSurface copy.\n"); +} + static void vmw_print_capabilities(uint32_t capabilities) { DRM_INFO("Capabilities:\n"); @@ -684,6 +693,12 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) } dev_priv->capabilities = vmw_read(dev_priv, SVGA_REG_CAPABILITIES); + + if (dev_priv->capabilities & SVGA_CAP_CAP2_REGISTER) { + dev_priv->capabilities2 = vmw_read(dev_priv, SVGA_REG_CAP2); + } + + ret = vmw_dma_select_mode(dev_priv); if (unlikely(ret != 0)) { DRM_INFO("Restricting capabilities due to IOMMU setup.\n"); @@ -752,6 +767,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) } vmw_print_capabilities(dev_priv->capabilities); + if (dev_priv->capabilities & SVGA_CAP_CAP2_REGISTER) + vmw_print_capabilities2(dev_priv->capabilities2); ret = vmw_dma_masks(dev_priv); if (unlikely(ret != 0)) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index a3a0826958a1..920365c0e9ab 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -386,6 +386,7 @@ struct vmw_private { uint32_t initial_height; u32 *mmio_virt; uint32_t capabilities; + uint32_t capabilities2; uint32_t max_gmr_ids; uint32_t max_gmr_pages; uint32_t max_mob_pages; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c index 6872c7ee8a08..ac6da0da2824 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c @@ -56,6 +56,9 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, case DRM_VMW_PARAM_HW_CAPS: param->value = dev_priv->capabilities; break; + case DRM_VMW_PARAM_HW_CAPS2: + param->value = dev_priv->capabilities2; + break; case DRM_VMW_PARAM_FIFO_CAPS: param->value = dev_priv->fifo.capabilities; break; diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h index 57115a5fe61a..84e81b38ca18 100644 --- a/include/uapi/drm/vmwgfx_drm.h +++ b/include/uapi/drm/vmwgfx_drm.h @@ -95,6 +95,7 @@ extern "C" { #define DRM_VMW_PARAM_MAX_MOB_SIZE 10 #define DRM_VMW_PARAM_SCREEN_TARGET 11 #define DRM_VMW_PARAM_DX 12 +#define DRM_VMW_PARAM_HW_CAPS2 13 /** * enum drm_vmw_handle_type - handle type for ref ioctls