Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3551725yba; Mon, 8 Apr 2019 23:04:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQNK2qEF3vCJNbW2ZTb5M3pCtAv5AIX4q6NK3+QQ+TptHonEidk0TWk/tNwb/n7MFrjOd+ X-Received: by 2002:a17:902:864b:: with SMTP id y11mr34856466plt.1.1554789862069; Mon, 08 Apr 2019 23:04:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554789862; cv=none; d=google.com; s=arc-20160816; b=KareF29D6cDvXEuoZlG+8BBsjmzq4/66fv/7z4WNZiX2UZyvN3wbYo+Fp+AU6RW5kP RhmGPho75e1+ZiBCO/rRzy3KdY/3dIoklz+jKWRFlxOeh0bCqg+UBMiN3dy+7G7G3fj4 nYnLBvhh0mA5C5G9euvFIm79+PpgTgIV1jL9ZSqpcORKXfeP12TKq8PoTz6eNRl2gTBB GJ8rKhUrfOQitgSd5JZcD1tgsINsU0bfLnPnpSbr5y3JO/YLjwjM2amVmCDvmgNZvdyW cqBiU9bYcWwxojO26inRsyKASUK1OuZgd+RpEtrQFVSs5YaURtkYT/9TcJzjauaKxeTJ 2cNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/icd95qsxJ1qrymH2pGrspYv3wZdJtnis68P3p+o66k=; b=zIzrn53AxuVD/vr31OknJtYQRZzRWPE1XvBgbP7tpSnDGVFsDpmswV9kCjePoQaLzB 5/fYrYb894RXtQU0YuG31MBPClApnvwEjMCMHB9lUYARRwSP9TPrLfcDmeCZmQ5Pm284 32rbMzl80OW5nUwEs/jUymhvkhOwVCU825JDOzfVfVyATgGG7VLR06cOQWzjLwIrPb1C tGHyysNzbKjlPLkqt6N9h93HXsnci66g15yzQwNbbaVBhT2qP8vCNUsF5Na8lKEMXzr2 B7vSfuVMw2gXpzAI9hRUp9PK5BgOA2sglX6JR54SpBtPFQSQv/NyMmS8g8oVVDpiD3gv bERQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i195si28553799pgd.521.2019.04.08.23.04.06; Mon, 08 Apr 2019 23:04:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726383AbfDIGDY (ORCPT + 99 others); Tue, 9 Apr 2019 02:03:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45328 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfDIGDY (ORCPT ); Tue, 9 Apr 2019 02:03:24 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 245A83082291; Tue, 9 Apr 2019 06:03:24 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFEA460185; Tue, 9 Apr 2019 06:03:23 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 06C5B16E03; Tue, 9 Apr 2019 08:03:23 +0200 (CEST) Date: Tue, 9 Apr 2019 08:03:23 +0200 From: Gerd Hoffmann To: Dave Airlie Cc: dri-devel , David Airlie , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , Dave Airlie Subject: Re: [PATCH] drm/qxl: drop prime import/export callbacks Message-ID: <20190409060323.xrw3fwj3yvcxsx3t@sirius.home.kraxel.org> References: <20190110081750.11358-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 09 Apr 2019 06:03:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 09, 2019 at 02:01:33PM +1000, Dave Airlie wrote: > On Sat, 12 Jan 2019 at 07:13, Dave Airlie wrote: > > > > On Thu, 10 Jan 2019 at 18:17, Gerd Hoffmann wrote: > > > > > > Also set prime_handle_to_fd and prime_fd_to_handle to NULL, > > > so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to > > > userspace. > > It's been pointed out to me that disables DRI3 for these devices, I'm > not sure that is the solution we actually wanted. > > any ideas? Well. Lets have a look at where we stand: * drm_gem_prime_export() works with qxl, you'll get a dma-buf handle. * Other drivers trying to map that dma-buf (drm_gem_map_dma_buf() callback) will not work, due to the ->gem_prime_get_sg_table() callback not being there. * drm_gem_prime_import() will work with buffers from the same qxl device, there is a shortcut for this special case. Otherwise it will not work, due to the ->gem_prime_import_sg_table() callback not being there. Bottom line: you can use prime to pass qxl object handles from one application to another. But you can't actually export/import qxl buffer objects from/to other devices. Problem is that we have no way to signal to userspace that prime can be used that way. Setting DRM_PRIME_CAP_{IMPORT,EXPORT} even though the driver can't do that leads to other problems. Userspace thinks it can have other devices (intel vgpu for example) handle the rendering, then import the rendered buffer into qxl for scanout. Should we add something like DRM_PRIME_CAP_SAME_DEVICE? cheers, Gerd