From patchwork Mon Sep 13 22:20:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vivek Kasireddy X-Patchwork-Id: 12490899 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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 E58F7C433F5 for ; Mon, 13 Sep 2021 22:35:07 +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 8D3DA61221 for ; Mon, 13 Sep 2021 22:35:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8D3DA61221 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:52616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mPuXa-0007NU-Bf for qemu-devel@archiver.kernel.org; Mon, 13 Sep 2021 18:35:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPuWa-0005Lx-QJ for qemu-devel@nongnu.org; Mon, 13 Sep 2021 18:34:04 -0400 Received: from mga01.intel.com ([192.55.52.88]:34057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mPuWX-0007zA-4g for qemu-devel@nongnu.org; Mon, 13 Sep 2021 18:34:04 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="244139497" X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="244139497" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 15:33:52 -0700 X-IronPort-AV: E=Sophos;i="5.85,290,1624345200"; d="scan'208";a="432749425" Received: from vkasired-desk2.fm.intel.com ([10.105.128.127]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Sep 2021 15:33:52 -0700 From: Vivek Kasireddy To: qemu-devel@nongnu.org Subject: [RFC v2 0/2] ui: Add a Wayland backend for Qemu UI (v2) Date: Mon, 13 Sep 2021 15:20:34 -0700 Message-Id: <20210913222036.3193732-1-vivek.kasireddy@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Received-SPF: pass client-ip=192.55.52.88; envelope-from=vivek.kasireddy@intel.com; helo=mga01.intel.com X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: Dongwon Kim , Satyeshwar Singh , Vivek Kasireddy , Tina Zhang , Gerd Hoffmann , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Why does Qemu need a new Wayland UI backend? The main reason why there needs to be a plain and simple Wayland backend for Qemu UI is to eliminate the Blit (aka GPU copy) that happens if using a toolkit like GTK or SDL (because they use EGL). The Blit can be eliminated by sharing the dmabuf fd -- associated with the Guest scanout buffer -- directly with the Host compositor via the linux-dmabuf (unstable) protocol. Once properly integrated, it would be potentially possible to have the scanout buffer created by the Guest compositor be placed directly on a hardware plane on the Host thereby improving performance. Only Guest compositors that use multiple back buffers (at-least 1 front and 1 back) and virtio-gpu would benefit from this work. v2: - Add support for handling/forwarding keyboard and mouse events. - Augment handling of events to ensure that they are not lost in a multi-threaded environment. - Rebase Cc: Gerd Hoffmann Cc: Marc-André Lureau Cc: Dongwon Kim Cc: Tina Zhang Cc: Satyeshwar Singh Vivek Kasireddy (2): virtio-gpu: Add support for VIRTIO_GPU_F_RELEASE_FENCE ui: Add a plain Wayland backend for Qemu UI configure | 8 +- hw/display/virtio-gpu-base.c | 3 + hw/display/virtio-gpu-udmabuf.c | 4 +- hw/display/virtio-gpu.c | 54 +- include/hw/virtio/virtio-gpu.h | 6 + include/standard-headers/linux/virtio_gpu.h | 2 + meson.build | 33 + meson_options.txt | 2 + qapi/ui.json | 3 + ui/meson.build | 52 ++ ui/wayland.c | 628 ++++++++++++++++++++ 11 files changed, 791 insertions(+), 4 deletions(-) create mode 100644 ui/wayland.c