Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp69849ybs; Tue, 26 May 2020 04:01:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoyodejsYZ9R9ywbHRx/bhWtAyUrXiPgUy0E9Qfr18VlJyZbyhUoSjBi/bL3XNsEjhpsam X-Received: by 2002:a17:906:3b4f:: with SMTP id h15mr645382ejf.408.1590490907991; Tue, 26 May 2020 04:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590490907; cv=none; d=google.com; s=arc-20160816; b=XQJ9IRtbU/80CQIjOK/V4XaFwsoXeGvbsli5xRt5JiCD3xQXp6p29/Yi5FFfPi+rwR IuhNY0qfd73eGV/50ugzeDKBmZ2as1gTUV1PTj/eXIU4L3RitZeC8W8N5NwYXVQyLvwL ZWKSxItMf8PPhPEmrdFqkl+ZaWjJyfvHWoq3fSEXl5l9tqo9RXBUGm6Z+hTGjgytjfmk DL+aPEwh6VTlFY4gk3/rPrx+T4DmeL86no+DToxVtD4so9wVWjA1yLNxnh0S8SNo+YSN 4YgjFF7a0NzmVhLqxAV5bx/8HY56GOT8Y9zRGMd79OaxMLJTlKQrDUyQgsrAgK/Zk5fw NlQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9Ou0qlu1mCa7PnwmjPJaB3DW9DwrRU3q8YGJo9GcDus=; b=ZRrX1+9ByrxwXx2DOseM1KawRC/Ir30IYNkMHmtC86E/BjSfTOKp/qqOW8Fc9X2PFb D2Qq9jknL1FHzgMCQqURue7BWGqGVEm4Fyv+LM94TJq0nVsyC4PZUiJKE7X9lG/BbT6e mOkD3BkjMLYL5dsMBF1ZxfJ11TIYMB2gHz7tnHnCKPacaLvajJsIBZb3hQyEzDzL4NzL Yd2Wmg/vMmNd49uKVvRDKXJJ3sGg9qcfvuitvbk2M7cCjE2gWNjDNTduoeF6iDmgXJTN 53e1u96biGOtG98PCVs+0Rh43cDiVbiuBFkB1DEZTP+HcIeox5ijVM/wMyDjImFYE5VQ jnoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K3VhsR5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pg8si10898604ejb.607.2020.05.26.04.01.24; Tue, 26 May 2020 04:01:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=K3VhsR5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388799AbgEZK72 (ORCPT + 99 others); Tue, 26 May 2020 06:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388680AbgEZK71 (ORCPT ); Tue, 26 May 2020 06:59:27 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C53AAC08C5C1 for ; Tue, 26 May 2020 03:59:26 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id j21so9922083pgb.7 for ; Tue, 26 May 2020 03:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9Ou0qlu1mCa7PnwmjPJaB3DW9DwrRU3q8YGJo9GcDus=; b=K3VhsR5LEfuu1zhCWSX8ZDiZ3ZxIlG7BA/03u2JIL4mG0pKb21JzuhyouVbtkkWOxd zJS6OCY+FQ6P+e3aeiFTRfUQmzH3/gsnFD50DgO5tGr1qoja2y1HvgRC2Pw7TqGI63LP 4TJzSsDw/kvWPaVNrvmgbUvep6sybaicYksX0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9Ou0qlu1mCa7PnwmjPJaB3DW9DwrRU3q8YGJo9GcDus=; b=JGVsY/Xw6TiO+yXZPQ2uMyJhqxfW24paY0s0LVbxEEaKwWLmjuEdyTg70kKOqlhr8V b0EvtL/bxv9JP/gZ4LCQibQiVp5wPr/VJ6IA14+id6SHwgFO4SROvtIhZbciY58or7J4 QjLwsgmAnLgsY9B/0AmeighqZDxSX0CK5KvgFrQnyi0oG6GhcbDnH9On3NngTs9IhLyp 6EaND7YL5b7S/m//jYEVXkZBTAH3JgegkQn3TE1TPjHEOCFqtzlaWA0UxrhgCKogX3YF 22nH76O0AtChsRHzwKRGhJe6jP4rAW1YVKzauMZovqG18QFEE5gi9b7uIqPyP/KxYgst rdQA== X-Gm-Message-State: AOAM533FDO8FCOnRFud++TuDaAcwEtSn2+y9srPBhLkov5DtJZT5LapD uP5QfV/m2eFnFpDCP760GLvzLw== X-Received: by 2002:a63:2246:: with SMTP id t6mr502754pgm.211.1590490766229; Tue, 26 May 2020 03:59:26 -0700 (PDT) Received: from localhost ([2401:fa00:8f:203:30f2:7a9c:387e:6c7]) by smtp.gmail.com with ESMTPSA id x13sm14637864pjr.20.2020.05.26.03.59.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2020 03:59:25 -0700 (PDT) From: David Stevens To: Gerd Hoffmann , David Airlie , Daniel Vetter , Sumit Semwal Cc: "Michael S . Tsirkin" , Jason Wang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Stevens , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, virtio-dev@lists.oasis-open.org Subject: [PATCH v4 0/3] Support virtio cross-device resources Date: Tue, 26 May 2020 19:58:08 +0900 Message-Id: <20200526105811.30784-1-stevensd@chromium.org> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset implements the current proposal for virtio cross-device resource sharing [1]. It will be used to import virtio resources into the virtio-video driver currently under discussion [2]. The patch under consideration to add support in the virtio-video driver is [3]. It uses the APIs from v3 of this series, but the changes to update it are relatively minor. This patchset adds a new flavor of dma-bufs that supports querying the underlying virtio object UUID, as well as adding support for exporting resources from virtgpu. [1] https://markmail.org/thread/2ypjt5cfeu3m6lxu [2] https://markmail.org/thread/p5d3k566srtdtute [3] https://markmail.org/thread/j4xlqaaim266qpks v3 -> v4 changes: - Replace dma-buf hooks with virtio dma-buf from v1. - Remove virtio_attach callback, as the work that had been done in that callback is now done on dma-buf export. The documented requirement that get_uuid only be called on attached virtio dma-bufs is also removed. - Rebase and add call to virtio_gpu_notify for ASSIGN_UUID. David Stevens (3): virtio: add dma-buf support for exported objects virtio-gpu: add VIRTIO_GPU_F_RESOURCE_UUID feature drm/virtio: Support virtgpu exported resources drivers/gpu/drm/virtio/virtgpu_drv.c | 3 + drivers/gpu/drm/virtio/virtgpu_drv.h | 20 ++++++ drivers/gpu/drm/virtio/virtgpu_kms.c | 4 ++ drivers/gpu/drm/virtio/virtgpu_prime.c | 98 +++++++++++++++++++++++++- drivers/gpu/drm/virtio/virtgpu_vq.c | 55 +++++++++++++++ drivers/virtio/Makefile | 2 +- drivers/virtio/virtio.c | 6 ++ drivers/virtio/virtio_dma_buf.c | 91 ++++++++++++++++++++++++ include/linux/virtio.h | 1 + include/linux/virtio_dma_buf.h | 58 +++++++++++++++ include/uapi/linux/virtio_gpu.h | 19 +++++ 11 files changed, 353 insertions(+), 4 deletions(-) create mode 100644 drivers/virtio/virtio_dma_buf.c create mode 100644 include/linux/virtio_dma_buf.h -- 2.27.0.rc0.183.gde8f92d652-goog