From nobody Sun May 5 00:48:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685549274; cv=none; d=zohomail.com; s=zohoarc; b=oB/pD2RuOYL51kpp/EFyZX6J+YV3sqUje3trFELRNAej+Uz7S17S8+DFGoW5JgKXi5kYWfjFG/VG88S+mp5ReYXVi7nnEa7MsMeBZY/kdkRn6Lf9xGCeCs+DkJu2mihHfko2VssKtmpf2kAqh+RnNNuqJyPfUKMlkkna3u7EjFw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685549274; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SVoMp3+5Oq/xn+gjsVsNm8rlyUbbwZcVPcLIKO5cNbI=; b=AW5TcWo3t7MQ5fqYKbgsTUN7czOBxXmtBvq0G081XZIswZvaxyVWPmXaQf5mZ3AXrnJio9fj0Ayhy0i+kbm0s1lWdRWQrca+UJ+nIIn6jTuN0gBLfeqJ/LrlgjHsK3m2o+MCRrgBN7F/biQx/GVHeP3xxRV46D/dCig/dSefRDw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685549274744758.7848978606072; Wed, 31 May 2023 09:07:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4OLg-0000WY-Mz; Wed, 31 May 2023 12:06:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLe-0000Vg-Dc for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLZ-0007gV-1q for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-uO_bJESCNmukvcX_F7Rd8g-1; Wed, 31 May 2023 12:06:46 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 80147185A794 for ; Wed, 31 May 2023 16:06:46 +0000 (UTC) Received: from centennial.enunes.eu (unknown [10.43.17.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14427140E962; Wed, 31 May 2023 16:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685549208; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SVoMp3+5Oq/xn+gjsVsNm8rlyUbbwZcVPcLIKO5cNbI=; b=ba2c4eIeG29i/miTw/4K1S+FK4tJb8JEgQ5IML3w5yNvCFo5W+MWOai3jMRCNNHAvG5tAX KBF6zST/8b+X0JHmX1rGS/2KmA6ceMVvephvu2Af9iYkZfwjmRYsU0OrNBclCQChcMbGHa Bpr+tIamjehWdOqZ9+lwmlDU1V0bdxw= X-MC-Unique: uO_bJESCNmukvcX_F7Rd8g-1 From: Erico Nunes To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mst@redhat.com, kraxel@redhat.com, Erico Nunes Subject: [PATCH v2 1/4] virtio-gpu: refactor generate_edid function to virtio_gpu_base Date: Wed, 31 May 2023 18:06:28 +0200 Message-Id: <20230531160631.612893-2-ernunes@redhat.com> In-Reply-To: <20230531160631.612893-1-ernunes@redhat.com> References: <20230531160631.612893-1-ernunes@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=ernunes@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.163, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685549276077100008 Content-Type: text/plain; charset="utf-8" This functionality can be shared with upcoming use in vhost-user-gpu, so move it to the shared file to avoid duplicating it. Signed-off-by: Erico Nunes --- hw/display/virtio-gpu-base.c | 17 +++++++++++++++++ hw/display/virtio-gpu.c | 20 +------------------- include/hw/virtio/virtio-gpu.h | 2 ++ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c index a29f191aa8..7ab7d08d0a 100644 --- a/hw/display/virtio-gpu-base.c +++ b/hw/display/virtio-gpu-base.c @@ -17,6 +17,7 @@ #include "migration/blocker.h" #include "qapi/error.h" #include "qemu/error-report.h" +#include "hw/display/edid.h" #include "trace.h" =20 void @@ -51,6 +52,22 @@ virtio_gpu_base_fill_display_info(VirtIOGPUBase *g, } } =20 +void +virtio_gpu_base_generate_edid(VirtIOGPUBase *g, int scanout, + struct virtio_gpu_resp_edid *edid) +{ + qemu_edid_info info =3D { + .width_mm =3D g->req_state[scanout].width_mm, + .height_mm =3D g->req_state[scanout].height_mm, + .prefx =3D g->req_state[scanout].width, + .prefy =3D g->req_state[scanout].height, + .refresh_rate =3D g->req_state[scanout].refresh_rate, + }; + + edid->size =3D cpu_to_le32(sizeof(edid->edid)); + qemu_edid_generate(edid->edid, sizeof(edid->edid), &info); +} + static void virtio_gpu_invalidate_display(void *opaque) { } diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 66cddd94d9..9ff1a43353 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -24,7 +24,6 @@ #include "hw/virtio/virtio-gpu-bswap.h" #include "hw/virtio/virtio-gpu-pixman.h" #include "hw/virtio/virtio-bus.h" -#include "hw/display/edid.h" #include "hw/qdev-properties.h" #include "qemu/log.h" #include "qemu/module.h" @@ -207,23 +206,6 @@ void virtio_gpu_get_display_info(VirtIOGPU *g, sizeof(display_info)); } =20 -static void -virtio_gpu_generate_edid(VirtIOGPU *g, int scanout, - struct virtio_gpu_resp_edid *edid) -{ - VirtIOGPUBase *b =3D VIRTIO_GPU_BASE(g); - qemu_edid_info info =3D { - .width_mm =3D b->req_state[scanout].width_mm, - .height_mm =3D b->req_state[scanout].height_mm, - .prefx =3D b->req_state[scanout].width, - .prefy =3D b->req_state[scanout].height, - .refresh_rate =3D b->req_state[scanout].refresh_rate, - }; - - edid->size =3D cpu_to_le32(sizeof(edid->edid)); - qemu_edid_generate(edid->edid, sizeof(edid->edid), &info); -} - void virtio_gpu_get_edid(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd) { @@ -242,7 +224,7 @@ void virtio_gpu_get_edid(VirtIOGPU *g, trace_virtio_gpu_cmd_get_edid(get_edid.scanout); memset(&edid, 0, sizeof(edid)); edid.hdr.type =3D VIRTIO_GPU_RESP_OK_EDID; - virtio_gpu_generate_edid(g, get_edid.scanout, &edid); + virtio_gpu_base_generate_edid(VIRTIO_GPU_BASE(g), get_edid.scanout, &e= did); virtio_gpu_ctrl_response(g, cmd, &edid.hdr, sizeof(edid)); } =20 diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 2e28507efe..39c1a6a6ea 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -239,6 +239,8 @@ void virtio_gpu_base_reset(VirtIOGPUBase *g); void virtio_gpu_base_fill_display_info(VirtIOGPUBase *g, struct virtio_gpu_resp_display_info *dpy_info); =20 +void virtio_gpu_base_generate_edid(VirtIOGPUBase *g, int scanout, + struct virtio_gpu_resp_edid *edid); /* virtio-gpu.c */ void virtio_gpu_ctrl_response(VirtIOGPU *g, struct virtio_gpu_ctrl_command *cmd, --=20 2.40.1 From nobody Sun May 5 00:48:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685549274; cv=none; d=zohomail.com; s=zohoarc; b=cau4SE6CmGfen5Ch7/TnRvBBl3bkNaQhFQL/pXgS2x0o0ZITlBJvCDLFXIiZ17ocHwglu+QZbKFx3zZp2/5lZ1hLrjGkv5Rq/m8YX2jatuhE/iCD0deY5uYPmo5aiq84oS8WYgH5/6ZdF4nUBqRnNe+8UlmjH4IZEs6uMPvUBrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685549274; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bf2sHhgZGWQXlAzH983B6qQs4keGsmyObix75oEDmPg=; b=EsHcAeZzs8rK5EfDRj42+jtI/s76OeMv3XpV3v8p8f076SKxyz0sGG+jMbJT0aAXnpFeSHNLH6JrKl5DRRrJpqxyvSj8eDcPc2zzcocpw0kU3ZVscgbpXHeykN3xCUthFkSqtmPTxOCmCycqiCUE9HSYUhhCxqj8yugL02csoWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16855492745385.575409640590237; Wed, 31 May 2023 09:07:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4OLg-0000WA-3o; Wed, 31 May 2023 12:06:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLe-0000Vi-F2 for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLZ-0007gg-O5 for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:50 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-594-lU8IFAw3PECq_DOReRqblQ-1; Wed, 31 May 2023 12:06:47 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9452D8037AD for ; Wed, 31 May 2023 16:06:47 +0000 (UTC) Received: from centennial.enunes.eu (unknown [10.43.17.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6DEC140E962; Wed, 31 May 2023 16:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685549209; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bf2sHhgZGWQXlAzH983B6qQs4keGsmyObix75oEDmPg=; b=QgB7PYLSPL894IfKr+7aAQwLZEoxtWOhfb4Z21cwEac9abLp1u13XThSDtVjLJM7rqdFRH p5ZnHBQCrq/3PrhYpghKy0cvBoAbtSj1hOcrLHa7/hU0C8YS+CSU+R9xvokBwmynG/BtaE SD3t/ATJYCydcXyUrsPBmqMKximAK0w= X-MC-Unique: lU8IFAw3PECq_DOReRqblQ-1 From: Erico Nunes To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mst@redhat.com, kraxel@redhat.com, Erico Nunes Subject: [PATCH v2 2/4] docs: vhost-user-gpu: add protocol changes for EDID Date: Wed, 31 May 2023 18:06:29 +0200 Message-Id: <20230531160631.612893-3-ernunes@redhat.com> In-Reply-To: <20230531160631.612893-1-ernunes@redhat.com> References: <20230531160631.612893-1-ernunes@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=ernunes@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.163, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685549276061100007 Content-Type: text/plain; charset="utf-8" VHOST_USER_GPU_GET_EDID is defined as a message from the backend to the frontend to retrieve the EDID data for a given scanout. The VHOST_USER_GPU_PROTOCOL_F_EDID protocol feature is defined as a way to check whether this new message is supported or not. Signed-off-by: Erico Nunes --- docs/interop/vhost-user-gpu.rst | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/interop/vhost-user-gpu.rst b/docs/interop/vhost-user-gpu.= rst index 1640553729..ab86391aee 100644 --- a/docs/interop/vhost-user-gpu.rst +++ b/docs/interop/vhost-user-gpu.rst @@ -141,6 +141,8 @@ In QEMU the vhost-user-gpu message is implemented with = the following struct: VhostUserGpuScanout scanout; VhostUserGpuUpdate update; VhostUserGpuDMABUFScanout dmabuf_scanout; + VhostUserGpuEdidRequest edid_req; + struct virtio_gpu_resp_edid resp_edid; struct virtio_gpu_resp_display_info display_info; uint64_t u64; } payload; @@ -149,10 +151,11 @@ In QEMU the vhost-user-gpu message is implemented wit= h the following struct: Protocol features ----------------- =20 -None yet. +.. code:: c + + #define VHOST_USER_GPU_PROTOCOL_F_EDID 0 =20 -As the protocol may need to evolve, new messages and communication -changes are negotiated thanks to preliminary +New messages and communication changes are negotiated thanks to the ``VHOST_USER_GPU_GET_PROTOCOL_FEATURES`` and ``VHOST_USER_GPU_SET_PROTOCOL_FEATURES`` requests. =20 @@ -241,3 +244,12 @@ Message types Note: there is no data payload, since the scanout is shared thanks to DMABUF, that must have been set previously with ``VHOST_USER_GPU_DMABUF_SCANOUT``. + +``VHOST_USER_GPU_GET_EDID`` + :id: 11 + :request payload: ``struct VhostUserGpuEdidRequest`` + :reply payload: ``struct virtio_gpu_resp_edid`` (from virtio specificati= on) + + Retrieve the EDID data for a given scanout. + This message requires the ``VHOST_USER_GPU_PROTOCOL_F_EDID`` protocol + feature to be supported. --=20 2.40.1 From nobody Sun May 5 00:48:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685549275; cv=none; d=zohomail.com; s=zohoarc; b=jS6gXrvodsaG1pOnkWo1Yz/aUZ18S5vtPLiqe4m7pg4HScYdAF9dxpghzytx2Oso+D+mHNY9BMIBjmKV8Ngu7R+CstsuT1Pd9SGNFlQ7NEFG/rDC67f2V8JVYUsDldOU4BuIaVPfeA1RPOeTZCnZOkHzKzuPb+CUzw2pqliLpik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685549275; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+0ijUtrQUgMaTwxJC9EAHZIQh7t1gmekhF15e9vcEro=; b=csOb/2Le4PMWq0O8b2Kc/Y748ZZXzzEREbxnR2qSlqOLrb24gjR/xRLMjKTOoa+z7M6mP7o37myB6o0tejy8q/8m6B0qHuwiYtcjbnrjbxyKlxIChTQpnoKw2bOo7RwBmCZTvps9CZF+Bebau/hOCuICMuwvA6Ce0gM8oCh2Zww= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685549275230794.5999370949642; Wed, 31 May 2023 09:07:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4OLi-0000XK-QJ; Wed, 31 May 2023 12:06:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLg-0000Wb-Ve for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLe-0007gy-6M for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:56 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-KhutTfM2OFKP7LITkFrRKg-1; Wed, 31 May 2023 12:06:49 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A914C296A60C for ; Wed, 31 May 2023 16:06:48 +0000 (UTC) Received: from centennial.enunes.eu (unknown [10.43.17.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAE7A140E963; Wed, 31 May 2023 16:06:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685549210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+0ijUtrQUgMaTwxJC9EAHZIQh7t1gmekhF15e9vcEro=; b=JK0TGVscLDmMNog2FXIhU8jMI/GB+OAalAOedUGazPCKtjhKoZIA0aNzLTuQUfrass6AKI sgNVALuOG1TBvuelylzGILVw0y0TtqaSA5WBrqNk+F9tF6SYMYwT2oCQtfbHKXUYZw2g6/ y7FBphI2SsT+uqpUR7tw01TtOkqjIlE= X-MC-Unique: KhutTfM2OFKP7LITkFrRKg-1 From: Erico Nunes To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mst@redhat.com, kraxel@redhat.com, Erico Nunes Subject: [PATCH v2 3/4] contrib/vhost-user-gpu: implement get_edid feature Date: Wed, 31 May 2023 18:06:30 +0200 Message-Id: <20230531160631.612893-4-ernunes@redhat.com> In-Reply-To: <20230531160631.612893-1-ernunes@redhat.com> References: <20230531160631.612893-1-ernunes@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=ernunes@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.163, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685549275746100004 Content-Type: text/plain; charset="utf-8" Implement the virtio-gpu feature in contrib/vhost-user-gpu, which was unsupported until now. In this implementation, the feature is enabled inconditionally to avoid creating another optional config argument. Similarly to get_display_info, vhost-user-gpu sends a message back to the frontend to have access to all the display information. In the case of get_edid, it also needs to pass which scanout we should retrieve the edid for. The VHOST_USER_GPU_PROTOCOL_F_EDID protocol feature is required if the frontend sets the VIRTIO_GPU_F_EDID virtio-gpu feature. If the frontend sets the virtio-gpu feature but does not support the protocol feature, the backend will abort with an error. Signed-off-by: Erico Nunes --- contrib/vhost-user-gpu/vhost-user-gpu.c | 67 +++++++++++++++++++++++-- contrib/vhost-user-gpu/virgl.c | 3 ++ contrib/vhost-user-gpu/vugpu.h | 11 ++++ 3 files changed, 77 insertions(+), 4 deletions(-) diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-g= pu/vhost-user-gpu.c index bfb8d93cf8..8035dc71d7 100644 --- a/contrib/vhost-user-gpu/vhost-user-gpu.c +++ b/contrib/vhost-user-gpu/vhost-user-gpu.c @@ -303,6 +303,53 @@ vg_get_display_info(VuGpu *vg, struct virtio_gpu_ctrl_= command *cmd) cmd->state =3D VG_CMD_STATE_PENDING; } =20 +static gboolean +get_edid_cb(gint fd, GIOCondition condition, gpointer user_data) +{ + struct virtio_gpu_resp_edid resp_edid; + VuGpu *vg =3D user_data; + struct virtio_gpu_ctrl_command *cmd =3D QTAILQ_LAST(&vg->fenceq); + + g_debug("get edid cb"); + assert(cmd->cmd_hdr.type =3D=3D VIRTIO_GPU_CMD_GET_EDID); + if (!vg_recv_msg(vg, VHOST_USER_GPU_GET_EDID, + sizeof(resp_edid), &resp_edid)) { + return G_SOURCE_CONTINUE; + } + + QTAILQ_REMOVE(&vg->fenceq, cmd, next); + vg_ctrl_response(vg, cmd, &resp_edid.hdr, sizeof(resp_edid)); + + vg->wait_in =3D 0; + vg_handle_ctrl(&vg->dev.parent, 0); + + return G_SOURCE_REMOVE; +} + +void +vg_get_edid(VuGpu *vg, struct virtio_gpu_ctrl_command *cmd) +{ + struct virtio_gpu_cmd_get_edid get_edid; + + VUGPU_FILL_CMD(get_edid); + virtio_gpu_bswap_32(&get_edid, sizeof(get_edid)); + + VhostUserGpuMsg msg =3D { + .request =3D VHOST_USER_GPU_GET_EDID, + .size =3D sizeof(VhostUserGpuEdidRequest), + .payload.edid_req =3D { + .scanout_id =3D get_edid.scanout, + }, + }; + + assert(vg->wait_in =3D=3D 0); + + vg_send_msg(vg, &msg, -1); + vg->wait_in =3D g_unix_fd_add(vg->sock_fd, G_IO_IN | G_IO_HUP, + get_edid_cb, vg); + cmd->state =3D VG_CMD_STATE_PENDING; +} + static void vg_resource_create_2d(VuGpu *g, struct virtio_gpu_ctrl_command *cmd) @@ -837,8 +884,9 @@ vg_process_cmd(VuGpu *vg, struct virtio_gpu_ctrl_comman= d *cmd) case VIRTIO_GPU_CMD_RESOURCE_DETACH_BACKING: vg_resource_detach_backing(vg, cmd); break; - /* case VIRTIO_GPU_CMD_GET_EDID: */ - /* break */ + case VIRTIO_GPU_CMD_GET_EDID: + vg_get_edid(vg, cmd); + break; default: g_warning("TODO handle ctrl %x\n", cmd->cmd_hdr.type); cmd->error =3D VIRTIO_GPU_RESP_ERR_UNSPEC; @@ -1022,6 +1070,7 @@ vg_queue_set_started(VuDev *dev, int qidx, bool start= ed) static gboolean protocol_features_cb(gint fd, GIOCondition condition, gpointer user_data) { + const uint64_t protocol_edid =3D (1 << VHOST_USER_GPU_PROTOCOL_F_EDID); VuGpu *g =3D user_data; uint64_t u64; VhostUserGpuMsg msg =3D { @@ -1035,13 +1084,19 @@ protocol_features_cb(gint fd, GIOCondition conditio= n, gpointer user_data) msg =3D (VhostUserGpuMsg) { .request =3D VHOST_USER_GPU_SET_PROTOCOL_FEATURES, .size =3D sizeof(uint64_t), - .payload.u64 =3D 0 + .payload.u64 =3D protocol_edid, }; vg_send_msg(g, &msg, -1); =20 g->wait_in =3D 0; vg_handle_ctrl(&g->dev.parent, 0); =20 + if (g->edid_inited && !(u64 & protocol_edid)) { + g_printerr("EDID feature set by the frontend but it does not suppo= rt " + "the EDID vhost-user-gpu protocol.\n"); + exit(EXIT_FAILURE); + } + return G_SOURCE_REMOVE; } =20 @@ -1049,7 +1104,8 @@ static void set_gpu_protocol_features(VuGpu *g) { VhostUserGpuMsg msg =3D { - .request =3D VHOST_USER_GPU_GET_PROTOCOL_FEATURES + .request =3D VHOST_USER_GPU_GET_PROTOCOL_FEATURES, + .size =3D sizeof(uint64_t), }; =20 vg_send_msg(g, &msg, -1); @@ -1086,6 +1142,7 @@ vg_get_features(VuDev *dev) if (opt_virgl) { features |=3D 1 << VIRTIO_GPU_F_VIRGL; } + features |=3D 1 << VIRTIO_GPU_F_EDID; =20 return features; } @@ -1103,6 +1160,8 @@ vg_set_features(VuDev *dev, uint64_t features) g->virgl_inited =3D true; } =20 + g->edid_inited =3D !!(features & (1 << VIRTIO_GPU_F_EDID)); + g->virgl =3D virgl; } =20 diff --git a/contrib/vhost-user-gpu/virgl.c b/contrib/vhost-user-gpu/virgl.c index 3e45e1bd33..211aa110a9 100644 --- a/contrib/vhost-user-gpu/virgl.c +++ b/contrib/vhost-user-gpu/virgl.c @@ -495,6 +495,9 @@ void vg_virgl_process_cmd(VuGpu *g, struct virtio_gpu_c= trl_command *cmd) case VIRTIO_GPU_CMD_GET_DISPLAY_INFO: vg_get_display_info(g, cmd); break; + case VIRTIO_GPU_CMD_GET_EDID: + vg_get_edid(g, cmd); + break; default: g_debug("TODO handle ctrl %x\n", cmd->cmd_hdr.type); cmd->error =3D VIRTIO_GPU_RESP_ERR_UNSPEC; diff --git a/contrib/vhost-user-gpu/vugpu.h b/contrib/vhost-user-gpu/vugpu.h index e2864bba68..f0f2069c47 100644 --- a/contrib/vhost-user-gpu/vugpu.h +++ b/contrib/vhost-user-gpu/vugpu.h @@ -36,6 +36,7 @@ typedef enum VhostUserGpuRequest { VHOST_USER_GPU_UPDATE, VHOST_USER_GPU_DMABUF_SCANOUT, VHOST_USER_GPU_DMABUF_UPDATE, + VHOST_USER_GPU_GET_EDID, } VhostUserGpuRequest; =20 typedef struct VhostUserGpuDisplayInfoReply { @@ -83,6 +84,10 @@ typedef struct VhostUserGpuDMABUFScanout { int fd_drm_fourcc; } QEMU_PACKED VhostUserGpuDMABUFScanout; =20 +typedef struct VhostUserGpuEdidRequest { + uint32_t scanout_id; +} QEMU_PACKED VhostUserGpuEdidRequest; + typedef struct VhostUserGpuMsg { uint32_t request; /* VhostUserGpuRequest */ uint32_t flags; @@ -93,6 +98,8 @@ typedef struct VhostUserGpuMsg { VhostUserGpuScanout scanout; VhostUserGpuUpdate update; VhostUserGpuDMABUFScanout dmabuf_scanout; + VhostUserGpuEdidRequest edid_req; + struct virtio_gpu_resp_edid resp_edid; struct virtio_gpu_resp_display_info display_info; uint64_t u64; } payload; @@ -104,6 +111,8 @@ static VhostUserGpuMsg m __attribute__ ((unused)); =20 #define VHOST_USER_GPU_MSG_FLAG_REPLY 0x4 =20 +#define VHOST_USER_GPU_PROTOCOL_F_EDID 0 + struct virtio_gpu_scanout { uint32_t width, height; int x, y; @@ -122,6 +131,7 @@ typedef struct VuGpu { =20 bool virgl; bool virgl_inited; + bool edid_inited; uint32_t inflight; =20 struct virtio_gpu_scanout scanout[VIRTIO_GPU_MAX_SCANOUTS]; @@ -171,6 +181,7 @@ int vg_create_mapping_iov(VuGpu *g, struct iovec **iov); void vg_cleanup_mapping_iov(VuGpu *g, struct iovec *iov, uint32_t count= ); void vg_get_display_info(VuGpu *vg, struct virtio_gpu_ctrl_command *cmd= ); +void vg_get_edid(VuGpu *vg, struct virtio_gpu_ctrl_command *cmd); =20 void vg_wait_ok(VuGpu *g); =20 --=20 2.40.1 From nobody Sun May 5 00:48:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685549293; cv=none; d=zohomail.com; s=zohoarc; b=UShcc/oBhOVA5DdAv7gEp9I2peOFN+j2JtN+6DRGVO7rTqPpFKTg16sWY07GjFz/L3jOmW7pwJYyfnqpKoth1JGeXIEhiVFh/1JC43g/whVrE8ivUV8Xyxp2XEGy90TdECjkh5k5LVun5iVDC2bUOHdApGaV97umv7hoY/dftBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685549293; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VJOHfeBDCbOPQEpXgKsK2PsREly38FRBmVtvU1vQ0qg=; b=N/kRpd3emAT5yZ3sqAd7De+l3qHVAUTuPCC8D9phjbAY6eHcGT9OX5/A4gLvSem8xntzpBLvFqXC39+qiqzLjNtcW5ZUl1ZedH+Y1slP7I6F7oL7ebbJh4kJna1cL4uggxz2szLUHDgZrHfbuJxQqPdJhmIxaVFAr2o3P77kesY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685549293808202.57772083380678; Wed, 31 May 2023 09:08:13 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4OLh-0000Wi-8j; Wed, 31 May 2023 12:06:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLg-0000WK-E8 for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4OLe-0007h4-6l for qemu-devel@nongnu.org; Wed, 31 May 2023 12:06:55 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-6QDe8CJuOFWQmSWhTefX8g-1; Wed, 31 May 2023 12:06:50 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC4BD3C14111 for ; Wed, 31 May 2023 16:06:49 +0000 (UTC) Received: from centennial.enunes.eu (unknown [10.43.17.57]) by smtp.corp.redhat.com (Postfix) with ESMTP id DDEFC140E962; Wed, 31 May 2023 16:06:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685549211; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VJOHfeBDCbOPQEpXgKsK2PsREly38FRBmVtvU1vQ0qg=; b=VPTaHMevj6nrQTi66uWBKmul48FeGp1rydhm5TCVYbiw7jG8fUMaAHvs0n4ChWO/sPte6x r2DPB/vyz/io17AAYkj/I97kwkS+IdqQsCHUtNoXI/ezS2mXprzM9oFuJUfPvsMpeaWyiN Ohiq2OVYovrBNDP1y5CCKEY1bHzddrc= X-MC-Unique: 6QDe8CJuOFWQmSWhTefX8g-1 From: Erico Nunes To: qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mst@redhat.com, kraxel@redhat.com, Erico Nunes Subject: [PATCH v2 4/4] vhost-user-gpu: implement get_edid frontend feature Date: Wed, 31 May 2023 18:06:31 +0200 Message-Id: <20230531160631.612893-5-ernunes@redhat.com> In-Reply-To: <20230531160631.612893-1-ernunes@redhat.com> References: <20230531160631.612893-1-ernunes@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=ernunes@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.163, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685549295369100003 Content-Type: text/plain; charset="utf-8" Implement the frontend side of the get_edid feature in the qemu vhost-user-gpu frontend device. Signed-off-by: Erico Nunes --- hw/display/vhost-user-gpu.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c index 71dfd956b8..184e57dfc7 100644 --- a/hw/display/vhost-user-gpu.c +++ b/hw/display/vhost-user-gpu.c @@ -31,6 +31,7 @@ typedef enum VhostUserGpuRequest { VHOST_USER_GPU_UPDATE, VHOST_USER_GPU_DMABUF_SCANOUT, VHOST_USER_GPU_DMABUF_UPDATE, + VHOST_USER_GPU_GET_EDID, } VhostUserGpuRequest; =20 typedef struct VhostUserGpuDisplayInfoReply { @@ -78,6 +79,10 @@ typedef struct VhostUserGpuDMABUFScanout { int fd_drm_fourcc; } QEMU_PACKED VhostUserGpuDMABUFScanout; =20 +typedef struct VhostUserGpuEdidRequest { + uint32_t scanout_id; +} QEMU_PACKED VhostUserGpuEdidRequest; + typedef struct VhostUserGpuMsg { uint32_t request; /* VhostUserGpuRequest */ uint32_t flags; @@ -88,6 +93,8 @@ typedef struct VhostUserGpuMsg { VhostUserGpuScanout scanout; VhostUserGpuUpdate update; VhostUserGpuDMABUFScanout dmabuf_scanout; + VhostUserGpuEdidRequest edid_req; + struct virtio_gpu_resp_edid resp_edid; struct virtio_gpu_resp_display_info display_info; uint64_t u64; } payload; @@ -99,6 +106,8 @@ static VhostUserGpuMsg m __attribute__ ((unused)); =20 #define VHOST_USER_GPU_MSG_FLAG_REPLY 0x4 =20 +#define VHOST_USER_GPU_PROTOCOL_F_EDID 0 + static void vhost_user_gpu_update_blocked(VhostUserGPU *g, bool blocked); =20 static void @@ -161,6 +170,9 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUse= rGpuMsg *msg) .request =3D msg->request, .flags =3D VHOST_USER_GPU_MSG_FLAG_REPLY, .size =3D sizeof(uint64_t), + .payload =3D { + .u64 =3D (1 << VHOST_USER_GPU_PROTOCOL_F_EDID) + } }; =20 vhost_user_gpu_send_msg(g, &reply); @@ -184,6 +196,30 @@ vhost_user_gpu_handle_display(VhostUserGPU *g, VhostUs= erGpuMsg *msg) vhost_user_gpu_send_msg(g, &reply); break; } + case VHOST_USER_GPU_GET_EDID: { + VhostUserGpuEdidRequest *m =3D &msg->payload.edid_req; + struct virtio_gpu_resp_edid resp =3D { {} }; + int fd =3D qemu_chr_fe_get_msgfd(&g->vhost_chr); + VhostUserGpuMsg reply =3D { + .request =3D msg->request, + .flags =3D VHOST_USER_GPU_MSG_FLAG_REPLY, + .size =3D sizeof(reply.payload.resp_edid), + }; + + if (m->scanout_id >=3D g->parent_obj.conf.max_outputs) { + error_report("invalid scanout: %d", m->scanout_id); + if (fd >=3D 0) { + close(fd); + } + break; + } + + resp.hdr.type =3D VIRTIO_GPU_RESP_OK_EDID; + virtio_gpu_base_generate_edid(VIRTIO_GPU_BASE(g), m->scanout_id, &= resp); + memcpy(&reply.payload.resp_edid, &resp, sizeof(resp)); + vhost_user_gpu_send_msg(g, &reply); + break; + } case VHOST_USER_GPU_SCANOUT: { VhostUserGpuScanout *m =3D &msg->payload.scanout; =20 --=20 2.40.1