From patchwork Fri Oct 3 16:55:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 488 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510582; bh=5JZL6fwoTiGqmfjIsWT99YDrhOx62JxdS/HjhC8aCho=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ktvhTzMGTQy6FnYRI+F6SO77YTr8wmNKU9KwNee8VOnISDj4A4yPVg3Ho/I8wrpFM 2VKR3kcmwtxVm0gMOuBNqksCuIBO/0ghMZjLaTqqjRg15L7ElFLIU0veW1zyfS/sij KsZjYdDSw4czGpOKYrV2TvaLtIAIOvfi82D9jsFMbEe8RWndg11TqIomQ8dn5LXCTs 8Tjf2cd9EX0d4ge9IyqdESQP61lEb5gziQaDHX45byVg2O5Nsh5X7SQkS37iDHueIu HZWA3TbMBcIv/PheomrEu6QggPiZzHxSFK3t3C3obB5SnfDXuin7qIONzAYGMtHW6K /M6kALdY/bH/g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8849967EC0 for ; Fri, 3 Oct 2025 10:56:22 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Y2s_eGMzkMGY for ; Fri, 3 Oct 2025 10:56:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510580; bh=5JZL6fwoTiGqmfjIsWT99YDrhOx62JxdS/HjhC8aCho=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=NZWbhzWPwev9Ybz8xDqSFAMxmqM6IrfltZ9Def61NjPg13KwaLccYm7rrxjy/tw92 8dnfty8jSEXt6T1wK/L0scX8/MPbpV0Kd2TBv2Ujx0sCbIrhJauTbSNk3q7t6Ziw5y /2WgGtkh2btTX7J752LZPFz3Grf58klwJQT5ZYzwymPkl+EmjN62RfPLX72RFTovvI aPUgKAEQDfWAQorgcKwry4bl+ZL2g2n6Eh5uNbPOoMi0bbRkR8KV5dZpxv/UV2vyYB Ouv0QubXHZnRZzKAQU/3lGaUrRBa/BtJ3lG++rfNwMsIFn9Q6M83NbQQhzeIJUoIBm 2BbRpZZ2cFSHg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9EB2B67F2F for ; Fri, 3 Oct 2025 10:56:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510577; bh=XfUFZY1evZ+7WuIeawglWdAEJq0KtARA67XgcmQc0bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zm28xQB8wasQbkj76em4duLNmUURoT3gHvJB+iXkFh4zX768cJ78CRRuIWnCzrIod IUBMyGXLrFhFH+68liB9/tylZBX63izWCc8deUKnOYM80EnUpRjuFovQ9o656vjngW I01XH9SRTlY/i3EfY1jk5YAYdh0M/MvtIx0wI1KM+Sy5TyWRkvG8tGvc7O84MGzD4h WzlsGGLK5jBaFqWWjtWNmOf5MYZODRUf8FVDbHAxWmd5PEjrLO07oR4Ln+Moug0ECl l+Oqlc0ZHjW7Lw4gz9vKCjpjAOUQMMkQpcau9nd/ZJBliIzQ7N2CBfUY3MFKrVDFOW 1766NwIjudxRg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A18C067EBD; Fri, 3 Oct 2025 10:56:17 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id sgt2TRMFRlNw; Fri, 3 Oct 2025 10:56:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510575; bh=/SVaoLnjeYcLLGhEVooF3NjJn5rO6SdJoBkQ+HmXebA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnbcxMubsTmcIs7YYoiZQ0Qnp+QUhTfTBWo9X9jh32vcCuw9vXYq1MbRFarJwIbpZ MlOfErtbwbLD6xifYuZCYOv+YlikLiu06rehSmRRgGJ2x7z+qdnlv0WGnE8uG/Tif0 HXk/CFzuT+1I1812XgeVohoZkDGuDi9hkfjLn9tyO7HE0OYebCmefWYVCnKvIWF6CB C2YIm4HoSrOwWShNT0Yp37P+ZTP9WKnpI8XQO4LvccfPyPUF0l1lnKlFAY0ECmbNE7 zqeAYYgSoPQswixB0375WDCEFKnlYc02FQc5sUuIk5+QsA8WSH7EQhehkGdnXA6nYk xlPAtR038R0LA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 8753967F3E; Fri, 3 Oct 2025 10:56:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 3 Oct 2025 10:55:00 -0600 Message-ID: <20251003165525.440173-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251003165525.440173-1-sjg@u-boot.org> References: <20251003165525.440173-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KDPKD4PO6TQQQUDA5QSGF4DFX5CQRM3J X-Message-ID-Hash: KDPKD4PO6TQQQUDA5QSGF4DFX5CQRM3J X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/22] video: Check drawing the mouse pointer List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add some simple tests for drawing the mouse pointer on a white and black background. Signed-off-by: Simon Glass --- test/dm/video.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/dm/video.c b/test/dm/video.c index 6c96eee1b8b..a802228b790 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -667,6 +667,35 @@ static int dm_test_video_comp_bmp8(struct unit_test_state *uts) } DM_TEST(dm_test_video_comp_bmp8, UTF_SCAN_PDATA | UTF_SCAN_FDT); +/* Test drawing the riscos pointer */ +static int dm_test_video_bmp_alpha(struct unit_test_state *uts) +{ + struct video_priv *priv; + struct udevice *dev; + ulong addr; + + ut_assertok(video_get_nologo(uts, &dev)); + priv = dev_get_uclass_priv(dev); + addr = map_to_sysmem(video_image_getptr(riscos_arrow)); + + /* Draw a black rectangle first */ + video_draw_box(dev, 100, 100, 200, 200, 0, + video_index_to_colour(priv, VID_BLACK), true); + + /* Draw the pointer on top of the black rectangle */ + ut_assertok(video_bmp_display(dev, addr, 110, 110, false)); + ut_asserteq(174, video_compress_fb(uts, dev, false)); + ut_assertok(video_check_copy_fb(uts, dev)); + + /* Draw the pointer on top of the black rectangle */ + ut_assertok(video_bmp_display(dev, addr, 350, 110, false)); + ut_asserteq(249, video_compress_fb(uts, dev, false)); + ut_assertok(video_check_copy_fb(uts, dev)); + + return 0; +} +DM_TEST(dm_test_video_bmp_alpha, UTF_SCAN_PDATA | UTF_SCAN_FDT); + /* Test TrueType console */ static int dm_test_video_truetype(struct unit_test_state *uts) {