Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3553795yba; Mon, 8 Apr 2019 23:07:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzC7uWdwYlfASRe287I4nWIarvX2cy4/MypOlwpd+DUNodZghJPNH6+saAXxGMDVqWxx/Ln X-Received: by 2002:a17:902:d24:: with SMTP id 33mr35743469plu.246.1554790045197; Mon, 08 Apr 2019 23:07:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554790045; cv=none; d=google.com; s=arc-20160816; b=Pzq/9VE06yy8hMBzx9LVAqHVTxzMG0qeXVOxo0j9FhDTiC3BeW//Z8eN2Um1se2gSZ 4rrF+xMqKhZbxFJRye7TfUJchsd9ICDh3kZ0ByXGjrWHFM2ky/8vu+z4Ev9m6dI9JQnT ymMuQURXvNodqrQt/UoIc1vWBfr27ryheuku1cW0c3zPzi8l/g+OqFHxEoFC8MX7TBLJ tScNwriSjHjPS+hVEXfG0g2bp21dUUyk2imnjpcz/YRfdcL4YtZs2ZUk/z7n07DvMgo8 xJe/ocUMEauMw8Bfkn0ouTJh4JkPwYr0ZjnvXcMSMJNKk7tpt57PQ7vKutscCZrbMk0X IUYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=QghUGeU0lUIj1ypciruVkJezIKMuwoGPNeUayMnA2X0=; b=C19JC4JYGYnB6lnJ2Dtz085O8NmgKV2sSUBgX0MXrUpL48HvZqsYYTsY5XAuKWwqvs lYWzo1RTN0FXHBFAywPpNtcFmuF6db3l8HzI/Zn29HvHvzdzDzHCUs+QivAo4Dfp6Zpo d41z9/A0Vt1scWCcYyFmhP794ix1m1jpdX3SKHD43VOLGjmKOcvimM+i5YLZRc72GGhg sOtpRPyaESOfgbph+8ZndJuTRAvf/RMdC0rci7Bo8ZAvcVZ3uLEYdwMuTQJWG/di6IvP 4tDnIcS6uRcFJQuFPlnZQVRGhzHAFL/GnRefhUWRXgCBkT7pDeRXZR2NnYrHCKnLVXzU 8QnQ== 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 h3si29905246pfe.90.2019.04.08.23.07.09; Mon, 08 Apr 2019 23:07:25 -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 S1726479AbfDIGGd (ORCPT + 99 others); Tue, 9 Apr 2019 02:06:33 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:44784 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfDIGGc (ORCPT ); Tue, 9 Apr 2019 02:06:32 -0400 Received: by mail-vs1-f66.google.com with SMTP id j184so9081698vsd.11 for ; Mon, 08 Apr 2019 23:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QghUGeU0lUIj1ypciruVkJezIKMuwoGPNeUayMnA2X0=; b=MVDjLZXfobAw9Y5aWvc7vaa6UbnUNiowUaWXeK4YUCb3clyep93QzwemxnskfPI0g9 7aClz1VHKBfhqkUX1DEBuHMeUgHsfTI9QpH7lPkqBxQXczwuBgVVcT4tzLCm7V9K5YaU Jn/ODdphokIAGcdazkkAIT0o1YeMy3t2NJn7spH2ItvY0apa0YmC0hDjl7TirzS+etMC Xk6ZSPKpi5PL93Jx3KsTudVDG4qEP/+zjgewgfy2pqI8HsbpBZfhahfIJ0VYc2nzqv0a 2t2p1IEz+iUjC90EIyl7IKUNqFHO84OEmXGj3LTeB0Q0ct/fvYUx7/Rffik1WRe/o6fT 9+fQ== X-Gm-Message-State: APjAAAWmGJzVp5w2IawUA7mHHY0geKV+KDi1/Iw4qX4zVDUkDUExsLuz noXvfGuK/4jIkWKDJealTY+X3ktWDJKjJ+jJ+2i9iA== X-Received: by 2002:a67:ec47:: with SMTP id z7mr17098629vso.142.1554789990778; Mon, 08 Apr 2019 23:06:30 -0700 (PDT) MIME-Version: 1.0 References: <20190110081750.11358-1-kraxel@redhat.com> <20190409060323.xrw3fwj3yvcxsx3t@sirius.home.kraxel.org> In-Reply-To: <20190409060323.xrw3fwj3yvcxsx3t@sirius.home.kraxel.org> From: David Airlie Date: Tue, 9 Apr 2019 16:06:19 +1000 Message-ID: Subject: Re: [PATCH] drm/qxl: drop prime import/export callbacks To: Gerd Hoffmann Cc: Dave Airlie , dri-devel , David Airlie , open list , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , "open list:DRM DRIVER FOR QXL VIRTUAL GPU" , Dave Airlie Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 9, 2019 at 4:03 PM Gerd Hoffmann wrote: > > 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? Yeah I expect we need some sort of same device only capability, so that dri3 userspace can work. If we just fail importing in these cases what happens? userspace just gets confused, I know we used to print a backtrace if we hit the mmap path, but if we didn't do that what happens? Dave.