From patchwork Thu Nov 23 06:12:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenyu Wang X-Patchwork-Id: 10072383 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 F074760353 for ; Thu, 23 Nov 2017 06:18:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFDA728B77 for ; Thu, 23 Nov 2017 06:18:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4B0B29E9B; Thu, 23 Nov 2017 06:18:07 +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=-4.2 required=2.0 tests=BAYES_00, 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 4428B28B77 for ; Thu, 23 Nov 2017 06:18:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C05F96E6FD; Thu, 23 Nov 2017 06:18:04 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B85F6E6F9; Thu, 23 Nov 2017 06:18:02 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Nov 2017 22:18:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,440,1505804400"; d="asc'?scan'208";a="176837972" Received: from zhen-hp.sh.intel.com (HELO zhen-hp) ([10.239.159.159]) by orsmga005.jf.intel.com with ESMTP; 22 Nov 2017 22:17:58 -0800 Date: Thu, 23 Nov 2017 14:12:32 +0800 From: Zhenyu Wang To: Gerd Hoffmann Message-ID: <20171123061232.7kfquhnlkdctfsdp@zhen-hp.sh.intel.com> References: <1510737115-4258-1-git-send-email-tina.zhang@intel.com> <20171115104900.kcjpva33wfo7aurn@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: <20171115104900.kcjpva33wfo7aurn@sirius.home.kraxel.org> User-Agent: NeoMutt/20170609 (1.8.3) Cc: intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, kwankhede@nvidia.com, zhiyuan.lv@intel.com, intel-gvt-dev@lists.freedesktop.org, hang.yuan@intel.com Subject: Re: [Intel-gfx] [PATCH v18 0/6] drm/i915/gvt: Dma-buf support for GVT-g X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Zhenyu Wang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On 2017.11.15 11:49:00 +0100, Gerd Hoffmann wrote: > On Wed, Nov 15, 2017 at 05:11:49PM +0800, Tina Zhang wrote: > > v17->v18: > > 1) unmap vgpu's opregion when destroying vgpu. > > 2) update comments for VFIO_DEVICE_GET_GFX_DMABUF. (Alex) > > > This patch set adds the dma-buf support for intel GVT-g. > > > > dma-buf is an uniform mechanism to share DMA buffers across different > > devices and subsystems. dma-buf for intel GVT-g is mainly used to share > > the vgpu's framebuffer to userspace to leverage userspace graphics stacks > > to render the framebuffer to the display monitor. > > > > The main idea is that we create a gem object and set vgpu's framebuffer as > > its backing storage. Then, export a dma-buf associated with this gem object. > > With the fd of this dma-buf, userspace can directly handle this buffer. > > > > This patch set can be tried with the following example: > > git://git.kraxel.org/qemu branch: work/intel-vgpu > > > > A topic branch with the latest patch set is: > > https://github.com/intel/gvt-linux.git branch: topic/dmabuf > > Tested-by: Gerd Hoffmann > After debugging with Tina on one left race that fixed by https://lists.freedesktop.org/archives/intel-gvt-dev/2017-November/002505.html I still need below qemu fix for proper cursor handling, otherwise qemu just crashed when I click in my terminal program which hides cursor then. And with these it seems pretty fine now that I'll queue them up for -next pull. thanks diff --git a/hw/vfio/display.c b/hw/vfio/display.c index e500ec2cb1..d9a044b080 100644 --- a/hw/vfio/display.c +++ b/hw/vfio/display.c @@ -169,8 +169,9 @@ static void vfio_display_dmabuf_update(void *opaque) cursor = vfio_display_get_dmabuf(vdev, DRM_PLANE_TYPE_CURSOR); if (vdev->cursor != cursor) { vdev->cursor = cursor; - dpy_gl_cursor_dmabuf(vdev->display_con, - &cursor->buf); + if (cursor) + dpy_gl_cursor_dmabuf(vdev->display_con, + &cursor->buf); free_bufs = true; } if (cursor != NULL) {