Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752023AbdFTNfg (ORCPT ); Tue, 20 Jun 2017 09:35:36 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:19189 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056AbdFTNff (ORCPT ); Tue, 20 Jun 2017 09:35:35 -0400 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Tue, 20 Jun 2017 06:35:33 -0700 Subject: Re: [PATCH v9 5/7] vfio: Define vfio based dma-buf operations To: Alex Williamson , Gerd Hoffmann CC: Xiaoguang Chen , , , , , , , , References: <1497513611-2814-1-git-send-email-xiaoguang.chen@intel.com> <1497513611-2814-6-git-send-email-xiaoguang.chen@intel.com> <1497542438.29252.1.camel@redhat.com> <20170615143833.7526351b@w520.home> <24c4880b-24f5-ea07-834c-c77d3e895c78@nvidia.com> <1497854312.4207.4.camel@redhat.com> <20170619085530.1f5e46dc@w520.home> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <5cf2c46d-3d3b-5b7a-227f-8bb26a6c835a@nvidia.com> Date: Tue, 20 Jun 2017 19:05:19 +0530 MIME-Version: 1.0 In-Reply-To: <20170619085530.1f5e46dc@w520.home> X-Originating-IP: [10.24.70.186] X-ClientProxiedBy: DRBGMAIL103.nvidia.com (10.18.16.22) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1087 Lines: 39 On 6/19/2017 8:25 PM, Alex Williamson wrote: > On Mon, 19 Jun 2017 08:38:32 +0200 > Gerd Hoffmann wrote: > >> Hi, >> >>> My suggestion was to use vfio device fd for this ioctl and have >>> dmabuf >>> mgr fd as member in above query_plane structure, for region type it >>> would be set to 0. >> >> Region type should be DRM_PLANE_TYPE_PRIMARY >> >>> Can't mmap that page to get surface information. There is no way to >>> synchronize between QEMU reading this mmapped region and vendor >>> driver >>> writing it. There could be race condition in these two operations. >>> Read >>> on this page should be trapped and blocking, so that surface in that >>> region is only updated when its asked for. >> >> Does it make sense to have a "generation" field in the plane_info >> struct (which gets increased each time the struct changes) ? > > It seems less cumbersome than checking each field to see if it has > changed. Thanks, > Looks good. And vendor driver should take care of rounding up the value when it reaches its max limit. Thanks, Kirti > Alex >