From patchwork Wed Feb 19 15:00:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13982429 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D4CE0C021AA for ; Wed, 19 Feb 2025 15:00:55 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tklYr-0004VW-5A; Wed, 19 Feb 2025 10:00:29 -0500 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 1tklYf-0004Nd-Sk for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:18 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tklYa-00012w-OH for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:16 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-abb7f539c35so869627566b.1 for ; Wed, 19 Feb 2025 07:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739977211; x=1740582011; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HUERxSl/WBxSscDB+7xF2k4R+kzCld+g2R+w6slJd/U=; b=wuhxwDh8vmwuw5U7hX6hN1oFfcPBCfMRZts0+bPdkwx12vjQXJmsDFLCKFQo0qjplZ 9SDhSXee8U/idre8eH+JeV8+lH49eIbjMV08LUW1YqitBKHR26HxsuyiL5dcLJlMiqRF 6AZlC4hBIN3iO1cL2xDkLeDakQOux4jWqAY2X2Qz+IoKa+fAbwLxgMkYVGGFitAa6OBz OFsz+nlKs6f7y//bs4i6nkLHsK187FSgOoaPWBnairi5cFdtouiBI06yaVGPiq8GCGNK EtdjObI6N0IaqB94X6uGDdYTMvDwYCjRFxd8ax/VBgzpOyrlD8mIez/sEsA2kX7aUobl q7zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739977211; x=1740582011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HUERxSl/WBxSscDB+7xF2k4R+kzCld+g2R+w6slJd/U=; b=lOOIgKoU/zx+yc/S+GPNwl6oZm2s0F6gpl96wS+ifUDA0cKZpyM+zl7kQ5pZRpxSru HSl+M3dr2aViyeCSYiMRmsW0RvlWOLDXZjlgBbSG9w/BQBuzUAQLFmCQPGu3H/RoDnx4 qdvzfQNfesv2NCJZlRWBH5WgvI/3poPB9RAVK6dCNQtxcaa/nf9WO8blX0LOJxjW2N6H KYcFQHxAuSkDCOYaFWHQDXt/l1Y2ewbTWKXUSwFync0JjPgKOirh2gxH/zu5pn6jty7J jHfpDNNss+PeiMK/DlV0o1rPbky3XOiLApyAT67Pd0gcJtuoXEnvDoLQU9TJgt8wM023 xN5g== X-Gm-Message-State: AOJu0YwznbZLla7pn0FpIL6mLjbgII2wy+qNwuPaN8o5Vbb/IU83qsZ3 //m3sWAB41DiGQcQ0OWER+95JdCcsqkv0tabfp6ufUjACMkSGwR9cB/pSApo4jU= X-Gm-Gg: ASbGncuCZZxhbuOQtUl41YOygSQMNy1Tvc/5IGd4SKNo9aH0FhqTXxQjAcWp2LSIrvY EktvYY5V1i7760o4NJw1If7k5G3o7BeOdPHMvrrhsYSeWMadKMCseUw2s11rXRDtm2g3eopM/wT IEgJrKrMuWinZPA3mZ7bxPFUthuYPghlQQ1wnF9BIZH3P8bFzvRwwkGdjyrozuC2kgqL+oJ3NAg HBYkEQ9tZhyN4y91cW08R1unK9tJGGKziTQdp2J4W5iTNVNdrgjDALrIJv146i7FuWx07DB97oa eq0TOP4IUG/p9fA3+Q== X-Google-Smtp-Source: AGHT+IFeg/M8fHvcX9OD5OMt0BGq+NiuBCJyQTwjb4zgf2gnuyn2rtouoWFHbwl5eELDWTth8VaQcQ== X-Received: by 2002:a17:907:d9e:b0:ab3:2b85:5d5 with SMTP id a640c23a62f3a-abb70df3417mr2019133666b.49.1739977210756; Wed, 19 Feb 2025 07:00:10 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abba278e1b1sm549131466b.99.2025.02.19.07.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 07:00:09 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 36F39619B1; Wed, 19 Feb 2025 15:00:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= Subject: [PATCH 1/4] tests/functional: move aarch64 GPU test into own file Date: Wed, 19 Feb 2025 15:00:06 +0000 Message-Id: <20250219150009.1662688-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250219150009.1662688-1-alex.bennee@linaro.org> References: <20250219150009.1662688-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org I want to expand the number of tests to cover a wide range of configurations. That starts with splitting off from the normal virt test from which it doesn't really share much code. Signed-off-by: Alex Bennée --- tests/functional/meson.build | 2 + tests/functional/test_aarch64_virt.py | 71 --------------- tests/functional/test_aarch64_virt_gpu.py | 102 ++++++++++++++++++++++ 3 files changed, 104 insertions(+), 71 deletions(-) create mode 100755 tests/functional/test_aarch64_virt_gpu.py diff --git a/tests/functional/meson.build b/tests/functional/meson.build index b516d21cba..11b7ca1577 100644 --- a/tests/functional/meson.build +++ b/tests/functional/meson.build @@ -19,6 +19,7 @@ test_timeouts = { 'aarch64_sbsaref_freebsd' : 720, 'aarch64_tuxrun' : 240, 'aarch64_virt' : 720, + 'aarch64_virt_gpu' : 720, 'acpi_bits' : 420, 'arm_aspeed_palmetto' : 120, 'arm_aspeed_romulus' : 120, @@ -77,6 +78,7 @@ tests_aarch64_system_thorough = [ 'aarch64_tcg_plugins', 'aarch64_tuxrun', 'aarch64_virt', + 'aarch64_virt_gpu', 'aarch64_xen', 'aarch64_xlnx_versal', 'multiprocess', diff --git a/tests/functional/test_aarch64_virt.py b/tests/functional/test_aarch64_virt.py index 95f5ce8b4c..884aad7af6 100755 --- a/tests/functional/test_aarch64_virt.py +++ b/tests/functional/test_aarch64_virt.py @@ -134,77 +134,6 @@ def test_aarch64_virt_gicv2(self): self.common_aarch64_virt("virt,gic-version=2") - ASSET_VIRT_GPU_KERNEL = Asset( - 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' - 'download?path=%2F&files=' - 'Image', - '89e5099d26166204cc5ca4bb6d1a11b92c217e1f82ec67e3ba363d09157462f6') - - ASSET_VIRT_GPU_ROOTFS = Asset( - 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' - 'download?path=%2F&files=' - 'rootfs.ext4.zstd', - '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') - - @skipIfMissingCommands('zstd') - def test_aarch64_virt_with_gpu(self): - # This tests boots with a buildroot test image that contains - # vkmark and other GPU exercising tools. We run a headless - # weston that nevertheless still exercises the virtio-gpu - # backend. - - self.set_machine('virt') - self.require_accelerator("tcg") - - kernel_path = self.ASSET_VIRT_GPU_KERNEL.fetch() - image_path = self.uncompress(self.ASSET_VIRT_GPU_ROOTFS, format="zstd") - - self.vm.set_console() - kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + - 'console=ttyAMA0 root=/dev/vda') - - self.vm.add_args("-accel", "tcg") - self.vm.add_args("-cpu", "neoverse-v1,pauth-impdef=on") - self.vm.add_args("-machine", "virt,gic-version=max", - '-kernel', kernel_path, - '-append', kernel_command_line) - self.vm.add_args("-smp", "2", "-m", "2048") - self.vm.add_args("-device", - "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") - self.vm.add_args("-display", "egl-headless") - self.vm.add_args("-display", "dbus,gl=on") - self.vm.add_args("-device", "virtio-blk-device,drive=hd0") - self.vm.add_args("-blockdev", - "driver=raw,file.driver=file," - "node-name=hd0,read-only=on," - f"file.filename={image_path}") - self.vm.add_args("-snapshot") - - try: - self.vm.launch() - except VMLaunchFailure as excp: - if "old virglrenderer, blob resources unsupported" in excp.output: - self.skipTest("No blob support for virtio-gpu") - elif "old virglrenderer, venus unsupported" in excp.output: - self.skipTest("No venus support for virtio-gpu") - elif "egl: no drm render node available" in excp.output: - self.skipTest("Can't access host DRM render node") - elif "'type' does not accept value 'egl-headless'" in excp.output: - self.skipTest("egl-headless support is not available") - else: - self.log.info(f"unhandled launch failure: {excp.output}") - raise excp - - self.wait_for_console_pattern('buildroot login:') - exec_command(self, 'root') - exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') - exec_command_and_wait_for_pattern(self, - "weston -B headless " - "--renderer gl " - "--shell kiosk " - "-- vkmark -b:duration=1.0", - "vkmark Score") - if __name__ == '__main__': QemuSystemTest.main() diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py new file mode 100755 index 0000000000..f21ae18392 --- /dev/null +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python3 +# +# Functional tests for the various graphics modes we can support. +# +# Copyright (c) 2024, 2025 Linaro Ltd. +# +# Author: +# Alex Bennée +# +# SPDX-License-Identifier: GPL-2.0-or-later + +import logging + +from qemu.machine.machine import VMLaunchFailure + +from qemu_test import QemuSystemTest, Asset +from qemu_test import exec_command, exec_command_and_wait_for_pattern +from qemu_test import wait_for_console_pattern +from qemu_test import skipIfMissingCommands + +class Aarch64VirtGPUMachine(QemuSystemTest): + KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 ' + timeout = 360 + + def wait_for_console_pattern(self, success_message, vm=None): + wait_for_console_pattern(self, success_message, + failure_message='Kernel panic - not syncing', + vm=vm) + + ASSET_VIRT_GPU_KERNEL = Asset( + 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' + 'download?path=%2F&files=' + 'Image', + '89e5099d26166204cc5ca4bb6d1a11b92c217e1f82ec67e3ba363d09157462f6') + + ASSET_VIRT_GPU_ROOTFS = Asset( + 'https://fileserver.linaro.org/s/ce5jXBFinPxtEdx/' + 'download?path=%2F&files=' + 'rootfs.ext4.zstd', + '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') + + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_vulkan_gpu(self): + # This tests boots with a buildroot test image that contains + # vkmark and other GPU exercising tools. We run a headless + # weston that nevertheless still exercises the virtio-gpu + # backend. + + self.set_machine('virt') + self.require_accelerator("tcg") + + kernel_path = self.ASSET_VIRT_GPU_KERNEL.fetch() + image_path = self.uncompress(self.ASSET_VIRT_GPU_ROOTFS, format="zstd") + + self.vm.set_console() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + + 'console=ttyAMA0 root=/dev/vda') + + self.vm.add_args("-accel", "tcg") + self.vm.add_args("-cpu", "neoverse-v1,pauth-impdef=on") + self.vm.add_args("-machine", "virt,gic-version=max", + '-kernel', kernel_path, + '-append', kernel_command_line) + self.vm.add_args("-smp", "2", "-m", "2048") + self.vm.add_args("-device", + "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") + self.vm.add_args("-display", "egl-headless") + self.vm.add_args("-display", "dbus,gl=on") + self.vm.add_args("-device", "virtio-blk-device,drive=hd0") + self.vm.add_args("-blockdev", + "driver=raw,file.driver=file," + "node-name=hd0,read-only=on," + f"file.filename={image_path}") + self.vm.add_args("-snapshot") + + try: + self.vm.launch() + except VMLaunchFailure as excp: + if "old virglrenderer, blob resources unsupported" in excp.output: + self.skipTest("No blob support for virtio-gpu") + elif "old virglrenderer, venus unsupported" in excp.output: + self.skipTest("No venus support for virtio-gpu") + elif "egl: no drm render node available" in excp.output: + self.skipTest("Can't access host DRM render node") + elif "'type' does not accept value 'egl-headless'" in excp.output: + self.skipTest("egl-headless support is not available") + else: + self.log.info(f"unhandled launch failure: {excp.output}") + raise excp + + self.wait_for_console_pattern('buildroot login:') + exec_command(self, 'root') + exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') + exec_command_and_wait_for_pattern(self, + "weston -B headless " + "--renderer gl " + "--shell kiosk " + "-- vkmark -b:duration=1.0", + "vkmark Score") + +if __name__ == '__main__': + QemuSystemTest.main() From patchwork Wed Feb 19 15:00:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13982430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id DE91EC021AA for ; Wed, 19 Feb 2025 15:01:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tklYv-0004Y8-Ro; Wed, 19 Feb 2025 10:00:34 -0500 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 1tklYg-0004P6-Nb for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:20 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tklYc-00013Z-DN for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:18 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-abb81285d33so777158266b.0 for ; Wed, 19 Feb 2025 07:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739977212; x=1740582012; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LZ0Ad8q73aLBySL6ollEIfx4rPD1OsbtsagYMD1pCOs=; b=d4DJca9Um77NyYDruy9Ou6xpwEO/p7wMPv19eJc8eb+gDczYr5fWm7eeaMjd3Ud0nX KYDRNGw08z65BZzOftZFPLu9i/1m92zxgsKbLdOktKQ316dX8J8FBxu5EonfZ8vaYpQR 4Zhxjs7OjI9aZM4HLv8xoXVPdz+DSoU+BVB7wxFMysPvIdfVkXNG4IYjazA3M5i6f59Q 4jfppH84mfG2l+bX5cAR+MMjENIyR7w5C7lXIXLKhVk6MkAn2OVN57vqYrnH+PV1gEbQ tY3+luw/t+kj0F+gXSFxbrpCsN+uIq5Td9smZocdpr27rccn0Ye3AtIYEIYPrt30nd7+ g6Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739977212; x=1740582012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LZ0Ad8q73aLBySL6ollEIfx4rPD1OsbtsagYMD1pCOs=; b=Qhh63tuvNIqV2Kxm/Ux3rm4F4QmOmqSMVIGGZaFlzKF4/0H3K10FK4PVns3HfhkWrX 1VAz9vtlw9a7Foo/g3aRTNoJwifVucREwHUG6gpou2rgpga8xArry104zcafcqK1s+nA i3jq3GZ25VHnZybnQplfdsnVpUFyZbspPBUlmc8YD5pStrge/WR3xsL90AkyQmnE4QgM bRVdb0pu3FjpNh5fG+RItEHA5eOqhwp8gfsBqv+jL/3aCp7naM0cita+jIv8EimhPg6N QFk/CNstrWBInAjSk618hFVJBW2WFk5mW0tSjSGrrSEABJxLQOtZzPZEXniuoW8GPRuF XEag== X-Gm-Message-State: AOJu0Ywq1K++DdTxNJn2zRf7W1Htr6QroSHuCD+c9SqtJUTjvK+E1Zc+ DUQWKyzMMcKvcr5fEYZ9LTNYVb3opZcGcX2o4js9vpdkUmoRDvld6eUnpgZabNs= X-Gm-Gg: ASbGncvIGyZznJI/ywjqVY/ZVKM8SwVpwPHO0qrFraP5qLNIKXvAK2nIADPOH9NWUm8 AK2KSLky+NQNVWH0tREscbqQRVo8CPDR32pLz2e1JJUKHkvK8tvTn2DW+ngLHK9SoODLepx2qH/ OgqGcalhRoV6TGlFmSNznAzUofIdm15YHI0YM90GvDjhQNoUXYafJTH+R+bIiovsYV3bZ7Nxl5Q 73bXyItN7EwHeEzhe6hq+YrCwvIklzuspM4au4Dm0mX2PEYFJyVDlP+QfKGWnhKgzBq+Sai19z1 gjQF2HOv+ZHJNdTL4g== X-Google-Smtp-Source: AGHT+IHvAkv6fFG09NRsN/r+rHOkT01L3V4RCgy9iezjQMCFTpliYNqoQOul+kDGEEqNy2ys5EyPpA== X-Received: by 2002:a17:906:c154:b0:aaf:74dc:5dbc with SMTP id a640c23a62f3a-abb70bbe128mr2133723366b.29.1739977212350; Wed, 19 Feb 2025 07:00:12 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aba5323202dsm1280699166b.6.2025.02.19.07.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 07:00:10 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4C384619BA; Wed, 19 Feb 2025 15:00:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= Subject: [PATCH 2/4] tests/functional: factor out common code in gpu test Date: Wed, 19 Feb 2025 15:00:07 +0000 Message-Id: <20250219150009.1662688-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250219150009.1662688-1-alex.bennee@linaro.org> References: <20250219150009.1662688-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In preparation for handling more tests split out the common machine setup details from the test specific stuff. Signed-off-by: Alex Bennée --- tests/functional/test_aarch64_virt_gpu.py | 30 +++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py index f21ae18392..06093c6b60 100755 --- a/tests/functional/test_aarch64_virt_gpu.py +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -39,12 +39,7 @@ def wait_for_console_pattern(self, success_message, vm=None): 'rootfs.ext4.zstd', '792da7573f5dc2913ddb7c638151d4a6b2d028a4cb2afb38add513c1924bdad4') - @skipIfMissingCommands('zstd') - def test_aarch64_virt_with_vulkan_gpu(self): - # This tests boots with a buildroot test image that contains - # vkmark and other GPU exercising tools. We run a headless - # weston that nevertheless still exercises the virtio-gpu - # backend. + def _run_virt_gpu_test(self, gpu_device, weston_cmd, weston_pattern): self.set_machine('virt') self.require_accelerator("tcg") @@ -62,10 +57,10 @@ def test_aarch64_virt_with_vulkan_gpu(self): '-kernel', kernel_path, '-append', kernel_command_line) self.vm.add_args("-smp", "2", "-m", "2048") - self.vm.add_args("-device", - "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on") - self.vm.add_args("-display", "egl-headless") - self.vm.add_args("-display", "dbus,gl=on") + self.vm.add_args("-device", gpu_device) + for opt in ["egl-headless", "dbus,gl=on"]: + self.vm.add_args("-display", opt) + self.vm.add_args("-device", "virtio-blk-device,drive=hd0") self.vm.add_args("-blockdev", "driver=raw,file.driver=file," @@ -91,12 +86,15 @@ def test_aarch64_virt_with_vulkan_gpu(self): self.wait_for_console_pattern('buildroot login:') exec_command(self, 'root') exec_command(self, 'export XDG_RUNTIME_DIR=/tmp') - exec_command_and_wait_for_pattern(self, - "weston -B headless " - "--renderer gl " - "--shell kiosk " - "-- vkmark -b:duration=1.0", - "vkmark Score") + full_cmd = f"weston -B headless --renderer gl --shell kiosk -- {weston_cmd}" + exec_command_and_wait_for_pattern(self, full_cmd, weston_pattern) + + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_vulkan_gpu(self): + gpu_device = "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on" + weston_cmd = "vkmark -b:duration=1.0" + weston_pattern = "vkmark Score" + self._run_virt_gpu_test(gpu_device, weston_cmd, weston_pattern) if __name__ == '__main__': QemuSystemTest.main() From patchwork Wed Feb 19 15:00:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13982423 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0DBE6C021AA for ; Wed, 19 Feb 2025 15:00:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tklYo-0004TG-FB; Wed, 19 Feb 2025 10:00:26 -0500 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 1tklYf-0004OL-CD for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:18 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tklYb-000134-S0 for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:16 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5e0573a84fcso5843594a12.2 for ; Wed, 19 Feb 2025 07:00:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739977211; x=1740582011; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VMpR8AXA7xfQaFhSLKNadFqD4qPYuFkWfolZ2f9L0LI=; b=UNywPUUSqCkwVTQIWlDytUjljJ2vIFnA0xe4BTw6cxd+XYVfmUIq6YwxOtzavGDucU DlaTwtFUN7/t7yJpvbQP/DCta537ZyyzbRtjpzsaIroxNGoSLOSKd0guQAgZF6BEYzr0 /xf8gFzbhsi59soST4b42kGFskHuGcRwUCGyzvWCMIQIif413Wh65bBMMcQIDYnjtjGV m4tRXaYF4Q/q5UT++uk8QpZ7U6H/3X1Aw64Dc3du3cE0Uu1ktt7Ek39POYVZOrr+NAeF vlnMKv89+Obm/DCek1EAIOHFuyNRqP6soJGeVD1WmpB3RQ3U5AFsX+86JvADdWhLFq6H alpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739977211; x=1740582011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VMpR8AXA7xfQaFhSLKNadFqD4qPYuFkWfolZ2f9L0LI=; b=BJIJ8unKcK4iF33YGejH5HEAwSde/mT8jnVoJ2WwPrkVWp4QeVhVwJg1g7ZudmBYa5 ogSP2Gd8SM3iyf7nZBwV7I7GU0Pb16JY2U/O6LXJEMZWEqwA6cQaLJTGdXd4pTYHBY8z ZGn1Q2ad3+ZEEvj6G9th7why1YuJAfDgdbtSoPFB0RPqzcvs3cTfcklgpzcXyfnHylW/ axcpjS66UddcqpnHdlM+1haS3KbUjOoBCTSG8LA5PFL40vIMCLQs+HP4Ni6AC4BHaI52 kCMie5GdhPWl2hV47drAkdqckxZIk+OBFmaRwyqzz9T9j6Q4gewYlhQ0YCJzArt063NT siHA== X-Gm-Message-State: AOJu0YwhYRLQWRAI3/Ebh6dPmS9b+SDFaAyJNDbR6TcDU4N9imTqB32r 8S+HdNHI2jGvuqd9V+RGhhXOX/Af/twMJAMAcNPNpDu1ftREN3/2h2bLqSuWVvg= X-Gm-Gg: ASbGncthUYM8aBE33U8yiR/4c1Xw7mgW1edbEFKjF/eLqEM5stzTWG0VwQh496YTlT4 xsCZ3xioU+QfEH38+mwkexu4advh9YCTuZIGwRrhflrsJJKMA9K6UhWTJdYSkYSMyChkhUP4dMh caKh31C5pw0A4JogmlBe9oJtF3J7XqMnOWk8kMBM9JRmQnwz9wrOTWgLjEduH15x30xIhAJwW5j 5AuFA/xn1Sa6BLg2CjoYXp/oni8W2t9gXJSwB+S1CmJ8rG2KK5XjMy77Z2p8kJMhVghAS0miCB4 XQT8z1nqD8I1uc610A== X-Google-Smtp-Source: AGHT+IFndkPE54WvwrVqpb6/WEB14JuiqcZTjRNleOGsUkPLJW3q1epdL/G7oLqOOV364qUyPWbVkA== X-Received: by 2002:a17:907:7842:b0:ab7:cfe7:116f with SMTP id a640c23a62f3a-abb70d96544mr1839915166b.46.1739977211081; Wed, 19 Feb 2025 07:00:11 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abb72b519c5sm904303866b.173.2025.02.19.07.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 07:00:10 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 61E84619C2; Wed, 19 Feb 2025 15:00:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= Subject: [PATCH 3/4] tests/functional: ensure we have a GPU device for tests Date: Wed, 19 Feb 2025 15:00:08 +0000 Message-Id: <20250219150009.1662688-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250219150009.1662688-1-alex.bennee@linaro.org> References: <20250219150009.1662688-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org It's possible to build QEMU without support for the GL enabled GPU devices and we can catch that earlier with an explicit check. Signed-off-by: Alex Bennée --- tests/functional/test_aarch64_virt_gpu.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py index 06093c6b60..c9463d7285 100755 --- a/tests/functional/test_aarch64_virt_gpu.py +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -91,6 +91,9 @@ def _run_virt_gpu_test(self, gpu_device, weston_cmd, weston_pattern): @skipIfMissingCommands('zstd') def test_aarch64_virt_with_vulkan_gpu(self): + + self.require_device('virtio-gpu-gl-pci') + gpu_device = "virtio-gpu-gl-pci,hostmem=4G,blob=on,venus=on" weston_cmd = "vkmark -b:duration=1.0" weston_pattern = "vkmark Score" From patchwork Wed Feb 19 15:00:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 13982431 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 86018C021AA for ; Wed, 19 Feb 2025 15:02:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tklYv-0004XQ-54; Wed, 19 Feb 2025 10:00:33 -0500 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 1tklYg-0004PH-Po for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:20 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tklYc-00013l-E9 for qemu-devel@nongnu.org; Wed, 19 Feb 2025 10:00:18 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso1028755166b.3 for ; Wed, 19 Feb 2025 07:00:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739977213; x=1740582013; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=poeknxWi50g64JDj5A78TCHXdGRSIYJF5+UH+RyZNs4=; b=DQLm1A1b0P/WmzEQ9fhNRs4u7yf1vLOB7EhJlwVGOnHmvoN+qmRU8+H8867nRPm0CV MQyOwRkrhwXVYDfX0pt4k/CnkPOKx+bmRb7aDdNLsb7R+Al7W/5cXVFFt+sCLMFxymuS E6EScUh00YkHPA7ppagaup67mnTepcCBiVjH9QVUFXOgikorpLEGs5K9yqxxkVKJLOus aBdMbbE4wCZlg1gjoEPFatesT65GUaKm6y6l51ilnWI5ErRR7QAP2TIDs7C81m/OgnXM sCd9ENuCLr949JSBgakLjbxhuTMmtcdSIyjdeeZYUeDGHP83TR27ygITc12AkeO096VJ jPhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739977213; x=1740582013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=poeknxWi50g64JDj5A78TCHXdGRSIYJF5+UH+RyZNs4=; b=bkWDtikAVfvgAarsC3rn9/x6+/4g8+Lsyuj8kTXAszrwaqfZZa6hDP6IUSnvWZHlY9 i/Wz3eMlazwB0+1vXFgsDpKiAKSgo4HctG0pC1jKubbmxboDZ1vY/tRaPoUkJMfUm/fz uMjzmzaXiFDHtBlp6EHUq6IE5MQFqHlD/jG+xJCKJ+Ou3uzOsoztGIRTWyQNzIKqaGtw S8hxvZlOaUiq8Ni8aG8Uaj7pC1QMSdxvJVhaRX++PqmKPxFhGQpq+44wUSzhGQKtTXjR C4M8BQqKqp1EyM+2/8WGSmGKXE+NtvkdnLVRUatjEfAchl5rb3HfmnTiCtDsKEL6HWKD EZJQ== X-Gm-Message-State: AOJu0YwWtSs4bT4K5bg9CnJ3WGf5HO+pCOwbePN1cIxrhYFVz705vtNb Zqhpj/TJXU9BKEto1ALVy/WkqW9zj4Xusqe2b4Nt+puldStIW8tHtqtZyz5V2viQoTn4eGwoLq7 VouQ= X-Gm-Gg: ASbGnctwtlkMgGiD/eG6TUSWxWyMDWx4eIkirMSSZg0Dh2W9lNe6bZIJH/8ub4LRN8P pKevKD0HEguNhFVrRs2H0Qz1/pmVRqaY8rCmjdlEl+fAvdKICJUFECuAr9L2oLhw+yHSjYsieh/ BzLvmOVwQe/PouBC9KgErTjO7u3HxPTOhK0EAGTXER5QjuLd4m0rv118NWwHJkzFCg4nh8CYCZc N+QgXPbQ8z1ZkDiW/KN8kxxF5cV+yXB8EOXxdgzy21iVXxg0NPvI6iUwK4795IYLBscuxZMY7bB begU4TcprN7haIifgQ== X-Google-Smtp-Source: AGHT+IEbTW/LckbUhR2a1qrKFxTB42wG0pp1HKBb1VTi8lkagUCiOMQSDEKltfYxtPjCgeaEjX3rLw== X-Received: by 2002:a17:907:9709:b0:ab7:d87f:665b with SMTP id a640c23a62f3a-abb70de2845mr1743803266b.48.1739977212695; Wed, 19 Feb 2025 07:00:12 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abb7e29be33sm843467366b.94.2025.02.19.07.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 07:00:10 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 76844619C8; Wed, 19 Feb 2025 15:00:09 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Thomas Huth , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= Subject: [PATCH 4/4] tests/functional: expand tests to cover virgl Date: Wed, 19 Feb 2025 15:00:09 +0000 Message-Id: <20250219150009.1662688-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250219150009.1662688-1-alex.bennee@linaro.org> References: <20250219150009.1662688-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add two more test modes using glmark2-wayland to exercise the OpenGL pass-through modes with virgl. Virgl can run with or without the hostmem blob support. We might want to eventually add more directed tests and individual features later on but the glmark/vkmark tests are a good general smoke test for accelerated 3D. Signed-off-by: Alex Bennée --- tests/functional/test_aarch64_virt_gpu.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/functional/test_aarch64_virt_gpu.py b/tests/functional/test_aarch64_virt_gpu.py index c9463d7285..7a8471d1ca 100755 --- a/tests/functional/test_aarch64_virt_gpu.py +++ b/tests/functional/test_aarch64_virt_gpu.py @@ -89,6 +89,26 @@ def _run_virt_gpu_test(self, gpu_device, weston_cmd, weston_pattern): full_cmd = f"weston -B headless --renderer gl --shell kiosk -- {weston_cmd}" exec_command_and_wait_for_pattern(self, full_cmd, weston_pattern) + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_virgl_gpu(self): + + self.require_device('virtio-gpu-gl-pci') + + gpu_device = "virtio-gpu-gl-pci" + weston_cmd = "glmark2-wayland -b:duration=1.0" + weston_pattern = "glmark2 Score" + self._run_virt_gpu_test(gpu_device, weston_cmd, weston_pattern) + + @skipIfMissingCommands('zstd') + def test_aarch64_virt_with_virgl_blobs_gpu(self): + + self.require_device('virtio-gpu-gl-pci') + + gpu_device = "virtio-gpu-gl-pci,hostmem=4G,blob=on" + weston_cmd = "glmark2-wayland -b:duration=1.0" + weston_pattern = "glmark2 Score" + self._run_virt_gpu_test(gpu_device, weston_cmd, weston_pattern) + @skipIfMissingCommands('zstd') def test_aarch64_virt_with_vulkan_gpu(self):