Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp529433pxb; Thu, 25 Feb 2021 08:29:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKaIhHAaONqUdDhvw6XjeqPb0jPnJNIzygEei4LkFoxsEZLrfS3p0QUNKdWQp5HZfCNuc1 X-Received: by 2002:a17:906:86c2:: with SMTP id j2mr3425318ejy.439.1614270558662; Thu, 25 Feb 2021 08:29:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1614270558; cv=pass; d=google.com; s=arc-20160816; b=N0acg8r5bB9NOTl2LcgHwi6RGCb1dJ2r52ZYA536FtakFi/vsohVmu9TkaDYsPdKia 17AqCd2KzZgWaHBp4GSvn6KnfSlEP8sokdP1x1Y7iMRHAmeNHVR1n3ebIVWa4Hfgmn89 2ZQTkTnpZv2sUZGW2SNIfs2tDGMTJE8jqJTKVrTksK27z18f5fE8VJN2eZxt7jHHjsJf untRDYC4AEEKx+28lbeJvqTEOWOtjDj44jvguNz7uoPUjsmak5tDHvQEb5t1TAlsoH4k W0FcRuO2zB6Q6dE3xKOiEKSU1PTzjzZ836QyYZqqoAUOW+Rma6/vnCqYyJorwJ/4vRM6 pgBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=ZlQpBwcFa8g4hdFkmp4h55I6QQbuM7a3dz4Dc28/XaI=; b=ka01xm+U89yBPr1eU5oO2UGQLvuxlGwYvOCbPyr92J7p6RPH9adFB3lyj3FkvVuoBo vJFhqJceT1VroRHbGNqAMm8fp7kLH52umddaRlyAJ8ql7mBBRGzVakr3y7xn2PDkk+ZF cRjiTHUKaRKYpq1JjMNuLVgAQXkeLYk3GucwflExQw8BVTKwSG7R5rMeGYfB3ixNce66 ozUXWXZyZCdivvsapsvaDF5O8jP6NL4E93GFMgE4YY0zrBe3ho6LZDZOATERfmeqGMYD JWi/nTEeGTR40l6kHhNYJSjy0xVqmxlxrIgIEaXdUks/i5VOkPLTrdhZ4dNVSPt5LYUT 4lGA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=r2c3bkUp; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i28si3467786edy.261.2021.02.25.08.28.55; Thu, 25 Feb 2021 08:29:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=r2c3bkUp; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233159AbhBYQ0X (ORCPT + 99 others); Thu, 25 Feb 2021 11:26:23 -0500 Received: from mail-bn8nam11on2063.outbound.protection.outlook.com ([40.107.236.63]:50785 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231721AbhBYQ0U (ORCPT ); Thu, 25 Feb 2021 11:26:20 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+rjMQm1sAFoz1LpcPhWfyZ5fqtd+Yrs9T2++jYnbugBg+y709M5h3udnd65oOn8bRDriOiCcFylsVmUDsuLrXWkyDP0bwTEQBOtsbIPsyONKO6RQbxwzjpr3RbDgBU1upLtYJXgL3iip/fKopXkAeU76+THuOASIKdCc9KtNCNtxiBukZWmYp9B5zz+D1/sitFpKUtSxthPMvm/7FqMVrWwMA6PA0BjntdBPgUDQy4CDjNSQpD6H8olHDqZOZ86G6hs3V2SLUYDXKrPwR4v6rnf/fjthzhfvG7spj5DHTy2vlBPNmCtxy7WmavaQDy0/oBHk16MGnjoagO3mjmfvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZlQpBwcFa8g4hdFkmp4h55I6QQbuM7a3dz4Dc28/XaI=; b=lJgb9SXHzQlZEozkJc0jtHhnSTd1aTst2eQIBTs4MAFU3nUs7SYWcR7EaYH+95iPuj7kcS+sL69KtIVUq2JpYgcOOKindyQQYNTXymT3BdXvZo3XSrAa7/iXLWE34XTlFPPFbaN4aZrl4yckOaFPwsKtlS8keYi8Vsqh6eWP1/OQwcnUtHqDld+K+Slgg8SlrqP6XQDn1h7NEFssS0y3hUPV/cZR79iIRwrvbQ/br7yFjEw1/Bq185+rrmiqyY0giu+lwcneLzsQs1vVvb6GvQKgXF0qA2WfZRA0UYpbHMTLYkpqfmdfsftae24s2K6YcxPbUDcUqyXbOBU/PMEpWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZlQpBwcFa8g4hdFkmp4h55I6QQbuM7a3dz4Dc28/XaI=; b=r2c3bkUpbRm+4w+LndzzGgNcYEc0bFgS0QRg9pf/SwxRkw8txwj16O7ygoG8E1E/VwnBhr5bPq2yTYOSnuVg8MIDVgkYhf7d5+f2AcRHh8QrNjmTk+SoGy7F09ddxaX8ez9MjPIUgGT/gMgQmCR3QMSPWgrGz6OLgr3/c+xdQTs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=vmware.com; Received: from MN2PR05MB6624.namprd05.prod.outlook.com (2603:10b6:208:d8::18) by MN2PR05MB6558.namprd05.prod.outlook.com (2603:10b6:208:e3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.18; Thu, 25 Feb 2021 16:25:25 +0000 Received: from MN2PR05MB6624.namprd05.prod.outlook.com ([fe80::88de:ad34:82d7:a02e]) by MN2PR05MB6624.namprd05.prod.outlook.com ([fe80::88de:ad34:82d7:a02e%6]) with mapi id 15.20.3912.009; Thu, 25 Feb 2021 16:25:25 +0000 Subject: Re: [RFC PATCH] drm/vkms: Add support for virtual hardware mode To: Daniel Vetter , Sumera Priyadarsini , Gerd Hoffmann Cc: Melissa Wen , Rodrigo Siqueira , Haneen Mohammed , Dave Airlie , dri-devel , Linux Kernel Mailing List References: <20210224105509.yzdimgbu2jwe3auf@adolin> From: Zack Rusin Message-ID: <9b1b55a6-dcea-db17-03ca-1dc52f4a8083@vmware.com> Date: Thu, 25 Feb 2021 11:25:24 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [71.175.59.246] X-ClientProxiedBy: BL0PR02CA0003.namprd02.prod.outlook.com (2603:10b6:207:3c::16) To MN2PR05MB6624.namprd05.prod.outlook.com (2603:10b6:208:d8::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.193] (71.175.59.246) by BL0PR02CA0003.namprd02.prod.outlook.com (2603:10b6:207:3c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.20 via Frontend Transport; Thu, 25 Feb 2021 16:25:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 25e466b0-ce1c-410b-fa40-08d8d9a9f4c7 X-MS-TrafficTypeDiagnostic: MN2PR05MB6558: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NgefEC6Qnsi0Ge3jjazgmP3bVr/drVDD3w65gDXKTyiLr3EPGnpEbPqv4U1RJNf/4GI8/PoyLGYd5TYsBlZyyjGpwuswHv3acPJafukuhm9iydZKvAGGGCetL+oWZr5XXnK3hASPDSU0HoTtgAyb2tX41LX0juODhvVPkM/CxIPCMJZcyivFkA0pSlFSZC6QrOdYsDWBgTHDh3YG+QZMm4UFRoHXHXf8TADoRkoROZt5rJZTu52mTCRROOdw9ceDvY7abjoUtgJvD9Nm/4eqaCZDAmO7jgPVrW2Mteu9ujoz3hPbB8yUFh5I7KAeqKmm5kFgW38nNq64rdh5pQZ3JaRV/8X/TfBbeJYCtteeXc+WnyQYsizacZn8V/lvwGV789vNFujM7hKx0QDwlJluJzqfVlRVJSIHVJpnHMke7cn9qbLDufj8lszKwZQx677Yf/gexep9M5IZd3/HQ3+bveQDmC7ziYORV+AJMj5qRmsTeXX2IYUba0jaRY/MAR70M6uco0gRDKEhn7ktI2I1ZOnVGJYwQvKtJn2xa+1MPrdur7oGUhbsZkkzG9i/9OQtp//JJZjMKI9xpVNI7ivFRmtFH1QyOELVgExtjhUqPxw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR05MB6624.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(376002)(366004)(136003)(396003)(39860400002)(4326008)(110136005)(86362001)(54906003)(8936002)(478600001)(66946007)(66556008)(16526019)(31696002)(316002)(5660300002)(2906002)(83380400001)(31686004)(956004)(6486002)(36756003)(2616005)(16576012)(26005)(8676002)(53546011)(186003)(66476007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?c2JKaWl4UlJIcG9tKzRxT2d1NVd1NzU5NGJmWUtTUVVTUERaMjdRZGczWEwz?= =?utf-8?B?NlkwNVIxUW1NbFcvYmNYejZCb3BNN2JYYm9rZ1VibmFCODRNTndkYlR2c3Iy?= =?utf-8?B?OVQ1NkRZcHBVZGJzNUdaS2RWclY0VTdCcGkzNC92cklvMTJKVE1OWEo5RXlZ?= =?utf-8?B?TGVraEpmWDhPWmVVYkh3bllqVjZjMXdtL1RzdTNnNHJMMW5zSEdJdWxGZ2ZW?= =?utf-8?B?UWxydjdtK2Q2aWVmd1REaVJLOE5ncnN2OGpUZ3A3QnhDaDR0V3UzUXAxbnNN?= =?utf-8?B?TVhkLzYyUVFoalNSZjB2OWJ6YWlacmNIU0RMeGttbTN2djZDL1A4a1QrOFM2?= =?utf-8?B?bXUzZkVXMHBUamNCOWVFbGF2ZlhtRWFPSFVjR2RMMEwzRm5CcEZhSmVteU90?= =?utf-8?B?YktiSEp2cUs4VGpUMzBKRG1ac0UxYlEvMTVVWEpObHA0MWpKZHFKQ3RyV1Yx?= =?utf-8?B?UHByOEpNK0hPMzhTY2E2Zlp2OGJ4Z0Y4RVNhb3NlR1NjZDVpMHpMK0w3V1Fs?= =?utf-8?B?ZmpHcHJZazNUMVA1cDMyRUdrN0g2d2JvcVZ0K0xhU3J6TnJkNVlMVExUSWZy?= =?utf-8?B?WVdtQkhsYVVQeC9CbHYvSHUwU2E0K3JLR2s4MlNUWTRLaVd2L0ZzM3E1Rk9q?= =?utf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YVNK?= =?utf-8?B?T3pvTzE1VCsrcWI2N3pER2I0ZzBtaU4veThWdWZ5bXBSbDNzNkVRVElubnlZ?= =?utf-8?B?b2l1MHZMd3ZmM0J6dEFCNmxoWHBjbmpiY2I3dytyQlZTN0xoVEVGOU1jREtU?= =?utf-8?B?a01pZWJYM0E0aFVZWjJTSnZBbG9yYWsvUElYN3lKRXRsQi9XMk5ScTRaL3dC?= =?utf-8?Q?BJLRaXzayS4Tfc7P/8+Um9tn6ryTdfxIPlPy5/5?= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25e466b0-ce1c-410b-fa40-08d8d9a9f4c7 X-MS-Exchange-CrossTenant-AuthSource: MN2PR05MB6624.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Feb 2021 16:25:25.5510 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TYBRSG4ZZDdRN2Yf2OrN6ODjxhXBfFIDgPn3v71viQi2Kp+6lUV+drgtWWIUKIzRNrvOMR3UgEwZAiWIolv5aA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR05MB6558 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/25/21 4:09 AM, Daniel Vetter wrote: > On Wed, Feb 24, 2021 at 11:55 AM Sumera Priyadarsini > wrote: >> >> Add a virtual hardware or vblank-less mode as a module to enable >> VKMS to emulate virtual graphic drivers. This mode can be enabled >> by setting enable_virtual_hw=1 at the time of loading VKMS. >> >> A new function vkms_crtc_composer() has been added to bypass the >> vblank mode and is called directly in the atomic hook in >> vkms_atomic_begin(). However, some crc captures still use vblanks >> which causes the crc-based igt tests to crash. Currently, I am unsure >> about how to approach one-shot implementation of crc reads so I am >> still working on that. > > Gerd, Zack: For virtual hw like virtio-gpu or vmwgfx that does > one-shot upload and damage tracking, what do you think is the best way > to capture crc for validation? Assuming that's even on the plans > anywhere ... > > Ideally it'd be a crc that the host side captures, so that we really > have end-to-end validation, including the damage uploads and all that. > > For vkms we're going for now with one-shot crc generation after each > atomic flip (or DIRTYFB ioctl call). Will need a pile of igt changes, > but seems like the most fitting model. > Other option would be that we'd wire up something on the kernel side > that generates a crc on-demand every time igt reads a new crc value > (maybe with some rate limiting). But that's not really how virtual hw > works when everything is pushed explicitly to the host side. Well, this is a bit tricky. With virtual gpu's the presentation is not necessarily well defined. Technically the presentation might not even happen (i.e. someone disconnected the screen to a running vm), or it could happen on a completely different machine (i.e. someone is remotely running a vm), etc. With recent vmwgfx the guest owns the presentation surface (i.e. screen targets), it's not a big deal to set software cursors and get the host to generate CRC but it's not too different from doing it inside the guest. Realistically we could provide anything, generating CRC's out of some block of memory is trivial and so is putting it in either some register or any dedicated guest memory. It's more about what kind of guarantees we could reasonable provide, or more precisely "what kind of presentation testing could we do for a GL/Vulkan/DX12 app that could be potentially running over vnc". For us the response to that has basically been "if the screen target memory in guest matches what the app thought it should be then we're done", but one of my pet peeves in our stack has been the difficulty of testing presentation fully so I'd be very excited to hear other ideas. My guess is that without GL/Vulkan/DX12 extensions which actually expose the underlying CRC info from the display engines we can't really provide very strong guarantees and we won't be able to provide much better support than just sharing the CRC of the in guest screen target memory. With that model in mind the design you mention above is basically as good as it gets for what we have. z