From nobody Wed Nov 27 02:41:52 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1702003024; cv=none; d=zohomail.com; s=zohoarc; b=CImIqEHoyMNbU5DvmvEAdY6/A7fLHfYAeaAfJjM9nvQqOpOEfwlzwhBgzjMuRMfNdX/uOqg8lWp6tw9a6RguV64hWZNyQHsQJlfDWVWxG7S66AmbyvM0MBxCD7ghjyYFdy5kGS/7ZP6QQf3YUW0Y8ty7bC4ADfdKPWOxG9sLXa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1702003024; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QIUscvz7pf1VFtRN5hHqsbtj5B7mCmCi2M+oBvF9ZJ8=; b=J0lvRT7i/4gKje35EK4H/r6mUmZU8I/GelvrTOLdwpdS9NBeFtIA8r6fx7TljF28n3eZqU7FU0i+PpQ3/G8RbS2SDgPl6P8fyXqv4T5m/eE7DDB5AIdmJoKWBd/xt08KZGpwjAhSv/M/UkgP5hEsq/m4XoX1bu4RSPOVwPLr/cE= 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 1702003024013532.8218027178547; Thu, 7 Dec 2023 18:37:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBQhS-0002yP-An; Thu, 07 Dec 2023 21:34:46 -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 1rBQhB-0002HI-4D; Thu, 07 Dec 2023 21:34:29 -0500 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBQh8-0002rt-Rt; Thu, 07 Dec 2023 21:34:28 -0500 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2c9f62fca3bso20115971fa.0; Thu, 07 Dec 2023 18:34:26 -0800 (PST) Received: from localhost.localdomain ([185.200.240.39]) by smtp.gmail.com with ESMTPSA id r1-20020a2e94c1000000b002c9e6cbf78esm99062ljh.19.2023.12.07.18.34.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 18:34:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702002863; x=1702607663; 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=QIUscvz7pf1VFtRN5hHqsbtj5B7mCmCi2M+oBvF9ZJ8=; b=TuZOiwTwVgB/k5CqYMsZ27efZLDJCvNNCtyxMPjOzDoKushqMfXPs7myLH3PNWipWD Fe4cQTNqgiCm9TyCZ/ioMA/RYQbAg0gUJU6JYq2Yxs92IHWlyGwIHdiSzMs92ea9epe8 +EGvZ42hDp2EWTfl23RPI55185dfaoFYr6rI/sbLUMu1jrEjRZuuQ2C4mgQUx2mRTYDE AAzi70Jm/NpS1nD8hXU47bKSVmZorXpId8c7GT7W0Nkyw9Gt927jr7y78jWMczVeRcIR 1zuJwbKSiOFlI0xDrtqbh6eqWBik7FgdfR8NMZytuueLi17nKl7fEdSLmXhJO2VP7SGP f96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702002863; x=1702607663; 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=QIUscvz7pf1VFtRN5hHqsbtj5B7mCmCi2M+oBvF9ZJ8=; b=AbOBBdydgvPVoXJaCJ83DKxHfkVJBHROGqoz6PXzlpjouFnRIUGGn29qGa+0mDUFCu wwX4owi3NsbpSiYEUAlH7bunc5MuZueXVJmKhW5IGuqrtJSt8NdafITlCYfDEpi8A47F WKohQQiajs2XEwkY7EQMyST6wC2ejF+Cc8R6dGL8mwrfISzk8lAlJdNX3aq4gjpXyyB8 8uPzRaLXuZBQ0r6gQpJfv3db4Kta9MYBaok2V2A6j6t4mtMoRNTRSBlY5Uc8gDUIRryC gdM4BkNvpSVxQOUhM7czY/VfJqqKS8yFHqoKsa8FehX8qASEW2nweBPTQKMscc0uzdgK QqFg== X-Gm-Message-State: AOJu0YxEsk+TSJADsCcPf6y9u5+SALLBgcEzhb0JW2GAym8Ofc/OMm9D on7Wxca6p65yptkI6Gz6voLzsleqHDi34w== X-Google-Smtp-Source: AGHT+IHCMhuZi+mltC5Qq8rwwdHmby8v7yCcN/vq1j+oPjMqhgyfJrbtXd3HwIRnWt+Fl6xhNiw4Nw== X-Received: by 2002:a2e:bc25:0:b0:2ca:2802:3b6d with SMTP id b37-20020a2ebc25000000b002ca28023b6dmr2623124ljf.16.1702002863117; Thu, 07 Dec 2023 18:34:23 -0800 (PST) From: Sergey Kambalin X-Google-Original-From: Sergey Kambalin To: qemu-arm@nongnu.org Cc: qemu-devel@nongnu.org, Sergey Kambalin Subject: [PATCH v4 42/45] Add mailbox property tests. Part 3 Date: Thu, 7 Dec 2023 20:31:42 -0600 Message-Id: <20231208023145.1385775-43-sergey.kambalin@auriga.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231208023145.1385775-1-sergey.kambalin@auriga.com> References: <20231208023145.1385775-1-sergey.kambalin@auriga.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::230; envelope-from=serg.oker@gmail.com; helo=mail-lj1-x230.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, PDS_OTHER_BAD_TLD=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, UPPERCASE_50_75=0.008 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1702003024947100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Sergey Kambalin --- tests/qtest/bcm2838-mbox-property-test.c | 213 ++++++++++++++++++++++- 1 file changed, 212 insertions(+), 1 deletion(-) diff --git a/tests/qtest/bcm2838-mbox-property-test.c b/tests/qtest/bcm2838= -mbox-property-test.c index 5322c563a0..1b4a2ed9cb 100644 --- a/tests/qtest/bcm2838-mbox-property-test.c +++ b/tests/qtest/bcm2838-mbox-property-test.c @@ -361,7 +361,194 @@ DECLARE_TEST_CASE_SETUP(SET_FB_VIRT_WIDTH) { tag->request.value.height =3D 600; } =20 -//=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(TEST_FB_DEPTH) { + g_assert_cmpint(tag->response.value.bpp, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(TEST_FB_DEPTH) { + tag->request.value.bpp =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_FB_DEPTH) { + g_assert_cmpint(tag->response.value.bpp, =3D=3D, 16); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_FB_DEPTH) { + g_assert_cmpint(tag->response.value.bpp, =3D=3D, 24); +} +DECLARE_TEST_CASE_SETUP(SET_FB_DEPTH) { + tag->request.value.bpp =3D 24; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(TEST_PIXEL_ORDER) { + g_assert_cmphex(tag->response.value.pixel_order, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(TEST_PIXEL_ORDER) { + tag->request.value.pixel_order =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_PIXEL_ORDER) { + g_assert_cmphex(tag->response.value.pixel_order, =3D=3D, PIXEL_ORDER_R= GB); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_PIXEL_ORDER, BGR) { + g_assert_cmphex(tag->response.value.pixel_order, =3D=3D, PIXEL_ORDER_B= GR); +} +DECLARE_TEST_CASE_SETUP(SET_PIXEL_ORDER, BGR) { + tag->request.value.pixel_order =3D PIXEL_ORDER_BGR; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_PIXEL_ORDER, RGB) { + g_assert_cmphex(tag->response.value.pixel_order, =3D=3D, PIXEL_ORDER_B= GR); +} +DECLARE_TEST_CASE_SETUP(SET_PIXEL_ORDER, RGB) { + tag->request.value.pixel_order =3D PIXEL_ORDER_BGR; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(TEST_FB_ALPHA_MODE) { + g_assert_cmphex(tag->response.value.alpha_mode, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(TEST_FB_ALPHA_MODE) { + tag->request.value.alpha_mode =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_FB_ALPHA_MODE) { + g_assert_cmphex(tag->response.value.alpha_mode, =3D=3D, ALPHA_MODE_IGN= ORED); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_FB_ALPHA_MODE, ENABLED) { + g_assert_cmphex(tag->response.value.alpha_mode, =3D=3D, ALPHA_MODE_ENA= BLED); +} +DECLARE_TEST_CASE_SETUP(SET_FB_ALPHA_MODE, ENABLED) { + tag->request.value.alpha_mode =3D ALPHA_MODE_ENABLED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_FB_ALPHA_MODE, REVERSED) { + g_assert_cmphex(tag->response.value.alpha_mode, =3D=3D, ALPHA_MODE_REV= ERSED); +} +DECLARE_TEST_CASE_SETUP(SET_FB_ALPHA_MODE, REVERSED) { + tag->request.value.alpha_mode =3D ALPHA_MODE_REVERSED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_FB_ALPHA_MODE, IGNORED) { + g_assert_cmphex(tag->response.value.alpha_mode, =3D=3D, ALPHA_MODE_IGN= ORED); +} +DECLARE_TEST_CASE_SETUP(SET_FB_ALPHA_MODE, IGNORED) { + tag->request.value.alpha_mode =3D ALPHA_MODE_IGNORED; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_PITCH) { + g_assert_cmpint(tag->response.value.pitch, =3D=3D, 1280); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(TEST_VIRTUAL_OFFSET) { + g_assert_cmpint(tag->response.value.x, =3D=3D, DUMMY_VALUE); + g_assert_cmpint(tag->response.value.y, =3D=3D, DUMMY_VALUE); +} +DECLARE_TEST_CASE_SETUP(TEST_VIRTUAL_OFFSET) { + tag->request.value.x =3D DUMMY_VALUE; + tag->request.value.y =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_VIRTUAL_OFFSET) { + g_assert_cmpint(tag->response.value.x, =3D=3D, 0); + g_assert_cmpint(tag->response.value.y, =3D=3D, 0); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_VIRTUAL_OFFSET, _0_) { + g_assert_cmpint(tag->response.value.x, =3D=3D, 0); + g_assert_cmpint(tag->response.value.y, =3D=3D, 0); +} +DECLARE_TEST_CASE_SETUP(SET_VIRTUAL_OFFSET, _0_) { + tag->request.value.x =3D 0; + tag->request.value.y =3D 0; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_VIRTUAL_OFFSET, _42_) { + g_assert_cmpint(tag->response.value.x, =3D=3D, 42); + g_assert_cmpint(tag->response.value.y, =3D=3D, 42); +} +DECLARE_TEST_CASE_SETUP(SET_VIRTUAL_OFFSET, _42_) { + tag->request.value.x =3D 42; + tag->request.value.y =3D 42; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_OVERSCAN) { + g_assert_cmpint(tag->response.value.top, =3D=3D, 0); + g_assert_cmpint(tag->response.value.bottom, =3D=3D, 0); + g_assert_cmpint(tag->response.value.left, =3D=3D, 0); + g_assert_cmpint(tag->response.value.right, =3D=3D, 0); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(TEST_OVERSCAN) { + g_assert_cmpint(tag->response.value.top, =3D=3D, 0); + g_assert_cmpint(tag->response.value.bottom, =3D=3D, 0); + g_assert_cmpint(tag->response.value.left, =3D=3D, 0); + g_assert_cmpint(tag->response.value.right, =3D=3D, 0); +} +DECLARE_TEST_CASE_SETUP(TEST_OVERSCAN) { + tag->request.value.top =3D DUMMY_VALUE; + tag->request.value.bottom =3D DUMMY_VALUE; + tag->request.value.left =3D DUMMY_VALUE; + tag->request.value.right =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_OVERSCAN) { + g_assert_cmpint(tag->response.value.top, =3D=3D, 0); + g_assert_cmpint(tag->response.value.bottom, =3D=3D, 0); + g_assert_cmpint(tag->response.value.left, =3D=3D, 0); + g_assert_cmpint(tag->response.value.right, =3D=3D, 0); +} +DECLARE_TEST_CASE_SETUP(SET_OVERSCAN) { + tag->request.value.top =3D DUMMY_VALUE; + tag->request.value.bottom =3D DUMMY_VALUE; + tag->request.value.left =3D DUMMY_VALUE; + tag->request.value.right =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_DMA_CHANNELS) { + g_assert_cmphex(tag->response.value.mask, =3D=3D, GPIO_MASK); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_COMMANDLINE) { + /* No special checks are needed for this test case */ +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(GET_NUM_DISPLAYS) { + g_assert_cmpint(tag->response.value.num_displays, =3D=3D, 1); +} + +/*------------------------------------------------------------------------= ----*/ +DECLARE_TEST_CASE(SET_PITCH) { + /* No special checks are needed for this test case */ +} +DECLARE_TEST_CASE_SETUP(SET_PITCH) { + tag->request.value.pitch =3D DUMMY_VALUE; +} + +/*------------------------------------------------------------------------= ----*/ int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -395,6 +582,30 @@ int main(int argc, char **argv) QTEST_ADD_TEST_CASE(TEST_FB_VIRT_WIDTH); QTEST_ADD_TEST_CASE(GET_FB_VIRT_WIDTH, INITIAL); QTEST_ADD_TEST_CASE(SET_FB_VIRT_WIDTH); + QTEST_ADD_TEST_CASE(TEST_FB_DEPTH); + QTEST_ADD_TEST_CASE(GET_FB_DEPTH); + QTEST_ADD_TEST_CASE(SET_FB_DEPTH); + QTEST_ADD_TEST_CASE(TEST_PIXEL_ORDER); + QTEST_ADD_TEST_CASE(GET_PIXEL_ORDER); + QTEST_ADD_TEST_CASE(SET_PIXEL_ORDER, BGR); + QTEST_ADD_TEST_CASE(SET_PIXEL_ORDER, RGB); + QTEST_ADD_TEST_CASE(TEST_FB_ALPHA_MODE); + QTEST_ADD_TEST_CASE(GET_FB_ALPHA_MODE); + QTEST_ADD_TEST_CASE(SET_FB_ALPHA_MODE, ENABLED); + QTEST_ADD_TEST_CASE(SET_FB_ALPHA_MODE, REVERSED); + QTEST_ADD_TEST_CASE(SET_FB_ALPHA_MODE, IGNORED); + QTEST_ADD_TEST_CASE(GET_PITCH); + QTEST_ADD_TEST_CASE(TEST_VIRTUAL_OFFSET); + QTEST_ADD_TEST_CASE(GET_VIRTUAL_OFFSET); + QTEST_ADD_TEST_CASE(SET_VIRTUAL_OFFSET, _0_); + QTEST_ADD_TEST_CASE(SET_VIRTUAL_OFFSET, _42_); + QTEST_ADD_TEST_CASE(GET_OVERSCAN); + QTEST_ADD_TEST_CASE(TEST_OVERSCAN); + QTEST_ADD_TEST_CASE(SET_OVERSCAN); + QTEST_ADD_TEST_CASE(GET_DMA_CHANNELS); + QTEST_ADD_TEST_CASE(GET_COMMANDLINE); + QTEST_ADD_TEST_CASE(GET_NUM_DISPLAYS); + QTEST_ADD_TEST_CASE(SET_PITCH); =20 return g_test_run(); } --=20 2.34.1