From patchwork Mon Oct 6 16:54:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 516 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=1759769752; bh=jsYO9Y/KMeV//ETAe6RJRTO2+ro4wKFBL/vYBal7QxQ=; 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=qTGowo4dR9uSACfNFtyDliabGdHf+bjmdfoinPKRKPcBeEmByefn6EPEUFh513Og2 QwFU2ACtGw4FC6K+hACjrY68l0tRT1AslPq3jrpoEChOwti6T+kbxhn0dVsiFBaNQg 7OMyyBpLY8C4sGComJQKr0vAaPPcucTSc4xzgWtRZ+oC6WN3XNs0ZI/PD25WcN1DfE 5kxxxogdihlUJ7KAOB8X2kzA1CmZ0wXmHRhVD4wl8TauUfzBVba1zh0zS+Ulhb9rig uR0uZe4yKEHiggOgask2FgpfwfUog8d2JeZKBEVTQiW+O+zoVWpD2RQb27BpcGoNjp WOFWor3rSd2aA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1797167F8B for ; Mon, 6 Oct 2025 10:55:52 -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 AIc5GHmsCbLY for ; Mon, 6 Oct 2025 10:55:52 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769752; bh=jsYO9Y/KMeV//ETAe6RJRTO2+ro4wKFBL/vYBal7QxQ=; 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=qTGowo4dR9uSACfNFtyDliabGdHf+bjmdfoinPKRKPcBeEmByefn6EPEUFh513Og2 QwFU2ACtGw4FC6K+hACjrY68l0tRT1AslPq3jrpoEChOwti6T+kbxhn0dVsiFBaNQg 7OMyyBpLY8C4sGComJQKr0vAaPPcucTSc4xzgWtRZ+oC6WN3XNs0ZI/PD25WcN1DfE 5kxxxogdihlUJ7KAOB8X2kzA1CmZ0wXmHRhVD4wl8TauUfzBVba1zh0zS+Ulhb9rig uR0uZe4yKEHiggOgask2FgpfwfUog8d2JeZKBEVTQiW+O+zoVWpD2RQb27BpcGoNjp WOFWor3rSd2aA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 06D5267F03 for ; Mon, 6 Oct 2025 10:55:52 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769749; bh=4qgNW+YeM/VCum37YSYhz//IDOMYSP9OSipEOz80HWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vgU0iNj3I+TgGP/Ls9G1qubXFzW2k8PcY5ogIMqf3bjCg2gPDnGFfS1tr6IWHVHQM fyYoCY0Lw3h8eLpFgvhGHnDpiBktR6FQoKoW3h160ta6sLWSTRtP7uflsbQo0FGOJd UJZyv3RIICHuFZpf41E2XhgclZayLxksJMgPjwCTnStYT2nsqQ6Omnt82vSGelqhYP uRlLpUapBlse4hjWZRGukrQ+acidTJ74x8qDYGUWUuTBTB8Lj7zAnE1IJKFe/BgQiq INWvIA76C97txHU9Nbznh+2nUajw0MAsWnXsE5CSOJVrIUoIqQlKg5AcxTHLUQexEK nFw1b1+HrWOdw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 723AA67F8F; Mon, 6 Oct 2025 10:55:49 -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 EVd8Pc-kUn81; Mon, 6 Oct 2025 10:55:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769746; bh=DiDq8pNRdGEvQnKVOHtuqOVtMPLruqRdV6Zph3wUpI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q/dWTu1byy4+zUmDzgS3RXzl3890ec7u67BGE2CetTxjOefcdXU6QwMXAwlu3/++B XI/KkNzauczH9FmMzKYzCh/zRaUQIlWM7EeN1z8/Z/DiGgb3aHyWJS3gw3bJ1dud07 REuAwyLBeUjMC7zDuNH+kk6JSuLE3AXIFkk97lWfwxWE+7ez44Sr2nZ53r6Yn+4Spe CchfUe9G5fJUccWe0WML9xDqZuS/VaRC3ZG1ZhOTD50GqzhQu1RYnJlwutlbwGVI9d 9MTN8abdffkxze/9UklFohe0pvmotkYQAGKilZ5+hxkKNiJRJ/IoZCsYVz3sKHwfCn /bH5H1uHXS1Gg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9701367EE4; Mon, 6 Oct 2025 10:55:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 10:54:45 -0600 Message-ID: <20251006165452.1675349-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006165452.1675349-1-sjg@u-boot.org> References: <20251006165452.1675349-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HPFXKDZCS7LYEWBZ4YWB3EGJQ4Z4TNK7 X-Message-ID-Hash: HPFXKDZCS7LYEWBZ4YWB3EGJQ4Z4TNK7 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 , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/14] expo: Add selective rendering for dirty objects in scene 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 Support rendering only the dirty objects in a scene. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo.c | 2 +- boot/scene.c | 27 +++++++++++++++++++++++++-- boot/scene_internal.h | 3 ++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 5cbe06b1c28..8423a304eb0 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -320,7 +320,7 @@ int expo_render(struct expo *exp) if (!scn) return log_msg_ret("scn", -ENOENT); - ret = scene_render(scn); + ret = scene_render(scn, false); if (ret) return log_msg_ret("ren", ret); } diff --git a/boot/scene.c b/boot/scene.c index 332d11fc751..ec0c5899bca 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -930,7 +930,21 @@ static int scene_get_dirty_bbox(struct scene *scn, struct vid_bbox *bbox) return found_dirty ? 0 : -ENOENT; } -int scene_render(struct scene *scn) +/** + * bbox_intersects() - Check if two bounding boxes intersect + * + * @bbox1: First bounding box + * @bbox2: Second bounding box + * Return: true if bounding boxes intersect, false otherwise + */ +static bool bbox_intersects(const struct vid_bbox *bbox1, + const struct vid_bbox *bbox2) +{ + return !(bbox1->x1 <= bbox2->x0 || bbox2->x1 <= bbox1->x0 || + bbox1->y1 <= bbox2->y0 || bbox2->y1 <= bbox1->y0); +} + +int scene_render(struct scene *scn, bool dirty_only) { struct expo *exp = scn->expo; struct scene_obj *obj; @@ -943,7 +957,16 @@ int scene_render(struct scene *scn) expo_damage_add(exp, &dirty_bbox); list_for_each_entry(obj, &scn->obj_head, sibling) { - if (!(obj->flags & SCENEOF_HIDE)) { + bool render = true; + + if (obj->flags & SCENEOF_HIDE) + continue; + + /* render objects that intersect with dirty bbox */ + if (dirty_only && !ret) + render = bbox_intersects(&obj->bbox, &dirty_bbox); + + if (render) { ret = scene_obj_render(obj, exp->text_mode); if (ret && ret != -ENOTSUPP) return log_msg_ret("ren", ret); diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 0bc6f45cdcb..00696979f7d 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -237,9 +237,10 @@ void scene_destroy(struct scene *scn); * This is called from expo_render() * * @scn: Scene to render + * @dirty_only: If true, only render objects that intersect with dirty areas * Returns: 0 if OK, -ve on error */ -int scene_render(struct scene *scn); +int scene_render(struct scene *scn, bool dirty_only); /** * scene_send_key() - set a keypress to a scene