From patchwork Wed Mar 31 03:09:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Kasireddy, Vivek" X-Patchwork-Id: 12174275 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0FB9C433C1 for ; Wed, 31 Mar 2021 03:25:36 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2FB676146B for ; Wed, 31 Mar 2021 03:25:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2FB676146B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:49058 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRRU7-0007dL-7c for qemu-devel@archiver.kernel.org; Tue, 30 Mar 2021 23:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRRQU-0002Yp-W2 for qemu-devel@nongnu.org; Tue, 30 Mar 2021 23:21:51 -0400 Received: from mga18.intel.com ([134.134.136.126]:53068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRRQL-000572-Mm for qemu-devel@nongnu.org; Tue, 30 Mar 2021 23:21:49 -0400 IronPort-SDR: SVsEfLbW3jkmyAJvIe8HSlyJdprf+y71vQDJiL7Kt3Mvq+Qpst4dfJP0YHF85YAMxg4ER284nb QAD/pWkUmAIQ== X-IronPort-AV: E=McAfee;i="6000,8403,9939"; a="179449758" X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="179449758" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 20:21:33 -0700 IronPort-SDR: tCmxw7Cq/duvfpBVoOO51s8w8pp7tUkCzoGm8M3+Unl/7S7DxqVJbwbFFS8lHEcAI6XHfsU3Sd gGoqSgZUgThA== X-IronPort-AV: E=Sophos;i="5.81,291,1610438400"; d="scan'208";a="418454102" Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2021 20:21:32 -0700 From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [PATCH 00/11] Add support for Blob resources feature Date: Tue, 30 Mar 2021 20:09:50 -0700 Message-Id: <20210331031001.1564125-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Received-SPF: pass client-ip=134.134.136.126; envelope-from=vivek.kasireddy@intel.com; helo=mga18.intel.com X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Dongwon Kim , Tina Zhang , Vivek Kasireddy , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Enabling this feature would eliminate data copies from the resource object in the Guest to the shadow resource in Qemu. This patch series however adds support only for Blobs of type VIRTIO_GPU_BLOB_MEM_GUEST with property VIRTIO_GPU_BLOB_FLAG_USE_SHAREABLE. Most of the patches in this series are a rebased, refactored and bugfixed versions of Gerd Hoffmann's patches located here: https://gitlab.freedesktop.org/virgl/qemu/-/commits/virtio-gpu-next TODO: - Enable the combination virgl + blob resources - Add support for VIRTGPU_BLOB_MEM_HOST3D blobs Cc: Gerd Hoffmann Cc: Marc-André Lureau Cc: Dongwon Kim Cc: Tina Zhang Vivek Kasireddy (11): ui: Get the fd associated with udmabuf driver ui/pixman: Add qemu_pixman_to_drm_format() virtio-gpu: Add udmabuf helpers virtio-gpu: Add virtio_gpu_find_check_resource virtio-gpu: Refactor virtio_gpu_set_scanout virtio-gpu: Refactor virtio_gpu_create_mapping_iov virtio-gpu: Add initial definitions for blob resources virtio-gpu: Add virtio_gpu_resource_create_blob virtio-gpu: Add helpers to create and destroy dmabuf objects virtio-gpu: Add virtio_gpu_set_scanout_blob virtio-gpu: Update cursor data using blob hw/display/meson.build | 2 +- hw/display/trace-events | 2 + hw/display/virtio-gpu-3d.c | 3 +- hw/display/virtio-gpu-base.c | 3 + hw/display/virtio-gpu-udmabuf.c | 276 +++++++++++++ hw/display/virtio-gpu.c | 423 +++++++++++++++----- include/hw/virtio/virtio-gpu-bswap.h | 16 + include/hw/virtio/virtio-gpu.h | 41 +- include/standard-headers/linux/udmabuf.h | 32 ++ include/standard-headers/linux/virtio_gpu.h | 1 + include/ui/console.h | 3 + include/ui/qemu-pixman.h | 1 + scripts/update-linux-headers.sh | 3 + ui/meson.build | 1 + ui/qemu-pixman.c | 35 +- ui/udmabuf.c | 40 ++ 16 files changed, 772 insertions(+), 110 deletions(-) create mode 100644 hw/display/virtio-gpu-udmabuf.c create mode 100644 include/standard-headers/linux/udmabuf.h create mode 100644 ui/udmabuf.c