From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.3398.1649406222988409676 for ; Fri, 08 Apr 2022 01:23:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HPjE1Ys3; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649406222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9cdSnGsg8KgWaYrVBb70qAy6BgYKIHcDUkZ++UTxyeY=; b=HPjE1Ys3pW9q/iOfYaMTHaYMfdtZeqcbdEz2ucJmpyHPFRiiQtsh71vswIX8eBOwRiL7vM zwsQDJUV2BaWozVJZxQgLgtrfG05VWk1KGi3zT8NUpfIcbBwyeqnIYRya/tVolTiVvUf5i YQ/th0y6cLktG2wd24tYDHYpfDKbgz4= 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-308-AOoWvD8gPuCWWhV78qXRLA-1; Fri, 08 Apr 2022 04:23:41 -0400 X-MC-Unique: AOoWvD8gPuCWWhV78qXRLA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BD05328EA6FB; Fri, 8 Apr 2022 08:23:40 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C531A9D42; Fri, 8 Apr 2022 08:23:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CEB541800987; Fri, 8 Apr 2022 10:23:33 +0200 (CEST) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Jordan Justen , Gerd Hoffmann , Jiewen Yao , Pawel Polawski , Oliver Steffen , Ard Biesheuvel Subject: [PATCH v3 3/6] OvmfPkg/VirtioGpuDxe: add VirtioGpuGetDisplayInfo Date: Fri, 8 Apr 2022 10:23:30 +0200 Message-Id: <20220408082333.3023758-4-kraxel@redhat.com> In-Reply-To: <20220408082333.3023758-1-kraxel@redhat.com> References: <20220408082333.3023758-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Add support for sending a GetDisplayInfo command. Signed-off-by: Gerd Hoffmann --- OvmfPkg/VirtioGpuDxe/VirtioGpu.h | 6 ++++++ OvmfPkg/VirtioGpuDxe/Commands.c | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h b/OvmfPkg/VirtioGpuDxe/VirtioGpu.h index 2155b261d43e..1d781088bb3f 100644 --- a/OvmfPkg/VirtioGpuDxe/VirtioGpu.h +++ b/OvmfPkg/VirtioGpuDxe/VirtioGpu.h @@ -366,6 +366,12 @@ VirtioGpuResourceFlush ( IN UINT32 ResourceId ); +EFI_STATUS +VirtioGpuGetDisplayInfo ( + IN OUT VGPU_DEV *VgpuDev, + volatile VIRTIO_GPU_RESP_DISPLAY_INFO *Response + ); + /** Release guest-side and host-side resources that are related to an initialized VGPU_GOP.Gop. diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c index b9a3ea923021..4318d3d771c5 100644 --- a/OvmfPkg/VirtioGpuDxe/Commands.c +++ b/OvmfPkg/VirtioGpuDxe/Commands.c @@ -828,3 +828,23 @@ VirtioGpuResourceFlush ( sizeof Request ); } + +EFI_STATUS +VirtioGpuGetDisplayInfo ( + IN OUT VGPU_DEV *VgpuDev, + volatile VIRTIO_GPU_RESP_DISPLAY_INFO *Response + ) +{ + volatile VIRTIO_GPU_CONTROL_HEADER Request; + + return VirtioGpuSendCommandWithReply ( + VgpuDev, + VirtioGpuCmdGetDisplayInfo, + FALSE, // Fence + &Request, + sizeof Request, + VirtioGpuRespOkDisplayInfo, + &Response->Header, + sizeof *Response + ); +} -- 2.35.1