Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751783AbdFEI1E (ORCPT ); Mon, 5 Jun 2017 04:27:04 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:7475 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751483AbdFEI1B (ORCPT ); Mon, 5 Jun 2017 04:27:01 -0400 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 05 Jun 2017 01:27:01 -0700 Subject: Re: [PATCH v6 4/6] vfio: Define vfio based vgpu's dma-buf operations To: Gerd Hoffmann , Alex Williamson , "Chen, Xiaoguang" CC: "chris@chris-wilson.co.uk" , "intel-gfx@lists.freedesktop.org" , "linux-kernel@vger.kernel.org" , "zhenyuw@linux.intel.com" , "Lv, Zhiyuan" , "intel-gvt-dev@lists.freedesktop.org" , "Wang, Zhi A" , "Tian, Kevin" References: <1495874332-2851-1-git-send-email-xiaoguang.chen@intel.com> <1495874332-2851-5-git-send-email-xiaoguang.chen@intel.com> <1496042420.21582.3.camel@redhat.com> <93758f79-8076-9644-a8a7-6e2ebfd91fee@nvidia.com> <20170601103853.5ead4d39@w520.home> <1496392692.16895.1.camel@redhat.com> X-Nvconfidentiality: public From: Kirti Wankhede Message-ID: <3dd898eb-2d4d-18e1-1f82-5a5dcdeb7c9c@nvidia.com> Date: Mon, 5 Jun 2017 13:56:40 +0530 MIME-Version: 1.0 In-Reply-To: <1496392692.16895.1.camel@redhat.com> X-Originating-IP: [10.24.205.12] X-ClientProxiedBy: DRBGMAIL104.nvidia.com (10.18.16.23) 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: 1105 Lines: 36 On 6/2/2017 2:08 PM, Gerd Hoffmann wrote: > >> struct vfio_vgpu_surface_info { >> __u64 start; >> __u32 width; >> __u32 height; >> __u32 stride; >> __u32 size; >> __u32 x_pos; >> __u32 y_pos; >> __u32 padding; >> /* Only used when VFIO_VGPU_SURFACE_DMABUF_* flags set */ >> __u64 drm_format_mod; >> __u32 drm_format; > > Why for dmabufs only? Shouldn't the region specify the format too? > Even in case you are using a fixed one (say DRM_FORMAT_XRGB8888) you > can explicitly say so in drm_format (and set drm_format_mod to zero). > Definitions for PIXMAN formats and DRM formats are different. I think we need a flag to specify the format of surface that vendor driver is going to provide, PIXMAN or DRM. If surface is provided through region in PIXMAN format, existing functions in QEMU can be used to get format from bpp value, qemu_default_pixman_format(). Similarly, display surface can be updated by QEMU using qemu_create_displaysurface_from() from mmaped region. Thanks, Kirti > cheers, > Gerd >