From patchwork Mon Oct 6 16:54:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 513 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=1759769739; bh=GfGh2wrVlE7TzGBlQH3YhMRXA5eML6WqKxbf5no1z8M=; 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=N0Qo+/96QZQNR6yb96FhI9kd4euwJNlchsfQSLyxscRcgwTCx5sVhd2hqhRARtgD1 JNkccaK9pJCiFiS1AuQo3774hywOFd4cyGcJk/D2j38YUXOBipYjPHifDhjAFRJ/co ZtiwE7Urg+ZpcL9ohsET+/0AEpP23lZGLBrMhZgytQKqUtwoSMs6i0kiiGTF6QyFk/ L4PvuA0cUvP+MHvwutPxAny1X+tXMx5i2SubInpSpXbD5exDpj8aH9djsODPpWwqwF SosTyMEhFxRvNKNIokXv9BSrp0sYaW3intJMODzVhNtIUP7gz5gHeDMV09zaXnsa8g tRfACixgUTb8w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D0A4867ECE for ; Mon, 6 Oct 2025 10:55:39 -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 ijJTD3S7W9K7 for ; Mon, 6 Oct 2025 10:55:39 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769738; bh=GfGh2wrVlE7TzGBlQH3YhMRXA5eML6WqKxbf5no1z8M=; 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=NPwyElppXFb5VjLKaBINFP3aNdssc+M4FgYSlNp5sFY6bGOGlfWw6ZyUUULqU9IPf UUyXmN9KL50A2seZYM2uBMM8D9Hm5PN8ZJrpimoM/nxrHDRMcgg4yWQp8oZcQJNjrt dT4VC+kdqTpMl5DZauUi0WFSQMjD6+fMfPaZD0blLv/joG6gBnEbjHpzkJ3s5VUnY9 CKj1zw+1uXSp8v0N49rCb2W7ejJ+P2ju30hEoKRN3P104eU2baxjKDFiT6iRoK7Kn9 g9fcJIFklwPZhvYiPSaHl9meAVPPb93PRGRZdo4hlGXdj58/48Y7BYg5fSgfhib7ZH Ra/u6miL5jmjw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C1B5067EE5 for ; Mon, 6 Oct 2025 10:55:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769736; bh=fpSNYOsDg+0cMiqwtPIURlRwBX7YjGbzk2t68WmiOpM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FnEJhs/lVduxLswtlX+UrSts8VVWMUS4TRPu+HCW1+wlxjzcXuILO8YJpiBvE12Wz k4wgchdKlcvgAShWhIqUBKP0DTikcp6db4GxUt+T22I72FOz+68069fNg30c3DFnRw NCyYoRAS756LcrJYatMqwPLukltDNPlh7t/SfBsiFVhS2OKYouu2VJwwBMhW3mwG1E k5I+kkE5h6ihUHf1fGE95eA9eV0DXwgamOdTuUoSAZlkIwjabUHK8JPAIKf4TYIaii 1gXIoBeLt+aqNXCZXUPuwhVrDwAeJ+Xurw10nHTUSpdyzg4s9fhnSlShhOvEqFpSHQ y0OarEy51Ykdg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EEC4667ECE; Mon, 6 Oct 2025 10:55:36 -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 9FPAe_H8jXb9; Mon, 6 Oct 2025 10:55:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759769735; bh=jeAXsaTKAvqxaCkDThiP5U0va+eq8TtjQ2HU/U5SiKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gnZw7LH7TSnPdAT3kBwNUGf9+m7kSn/wRlLbx9ZNJxLZ/O8arFWhQ3NpVf/4/1Aei ohl8/AEImOWcEM0QMMzVhO8QkgNKjo/OSVvwgub2S23jD2wEqv2j04WI0sAFnkPziP dk9e1g5IwqpgBIN4DIeEUB5DHwZKB0jFv1OvJvmCb5S2rbBD16J7CsamHhQhEhgKuB HDS4IWZu5o0GIZv6QKhHKxLlyVsNrkKqJ1BwS378ZtfO+DUA28t89NflrbxLey0adL OWftEfAmbIDSBCHiAjtFwJEkY2E/JIKdRBHy+8E5gnCsn5zI6OJnm/gmC7/qRQFMNy 0lO0oHTVRhABA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 28D9767EE4; Mon, 6 Oct 2025 10:55:35 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 10:54:42 -0600 Message-ID: <20251006165452.1675349-11-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: GDWOA3NXUSG2YHTQVLJLMOTRT4SFULFP X-Message-ID-Hash: GDWOA3NXUSG2YHTQVLJLMOTRT4SFULFP 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 10/14] expo: Add damage tracking 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 As a few step towards making rendering more efficient, add support for tracking video damage within an expo. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo.c | 30 ++++++++++++++++++++++++++++++ include/expo.h | 23 +++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/boot/expo.c b/boot/expo.c index 295b779dce8..5cbe06b1c28 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -536,3 +536,33 @@ void expo_exit_mode(struct expo *exp) { video_manual_sync(exp->display, false); } + +void expo_damage_reset(struct expo *exp) +{ + exp->damage.x0 = 0; + exp->damage.y0 = 0; + exp->damage.x1 = 0; + exp->damage.y1 = 0; +} + +void expo_damage_add(struct expo *exp, const struct vid_bbox *bbox) +{ + /* If bbox is invalid (empty), do nothing */ + if (bbox->x1 <= bbox->x0 || bbox->y1 <= bbox->y0) + return; + + /* If current damage is empty, set it to the new bbox */ + if (exp->damage.x1 <= exp->damage.x0 || exp->damage.y1 <= exp->damage.y0) { + exp->damage = *bbox; + } else { + /* Expand damage area to include new bbox */ + if (bbox->x0 < exp->damage.x0) + exp->damage.x0 = bbox->x0; + if (bbox->y0 < exp->damage.y0) + exp->damage.y0 = bbox->y0; + if (bbox->x1 > exp->damage.x1) + exp->damage.x1 = bbox->x1; + if (bbox->y1 > exp->damage.y1) + exp->damage.y1 = bbox->y1; + } +} diff --git a/include/expo.h b/include/expo.h index a6e6b2b780b..487b58fb916 100644 --- a/include/expo.h +++ b/include/expo.h @@ -135,6 +135,7 @@ struct expo_theme { * @mouse_ptr: Pointer to mouse pointer image data (BMP format) * @mouse_size: Size of mouse pointer (width and height in pixels) * @mouse_pos: Current mouse position + * @damage: Bounding box of the area that needs to be redrawn * @priv: Private data for the controller * @done: Indicates that a cedit session is complete and the user has quit * @save: Indicates that cedit data should be saved, rather than discarded @@ -160,6 +161,7 @@ struct expo { const void *mouse_ptr; struct vid_size mouse_size; struct vid_pos mouse_pos; + struct vid_bbox damage; void *priv; bool done; bool save; @@ -1197,4 +1199,25 @@ void expo_enter_mode(struct expo *exp); */ void expo_exit_mode(struct expo *exp); +/** + * expo_damage_reset() - Reset the damage tracking area + * + * @exp: Expo to reset damage tracking for + * + * Clears the damage area, indicating that no part of the display needs + * to be redrawn. + */ +void expo_damage_reset(struct expo *exp); + +/** + * expo_damage_add() - Add a damaged area to the expo damage tracking + * + * @exp: Expo to add damage to + * @bbox: Bounding box of the damaged area to add + * + * Expands the current damage area to include the new damaged region. + * If there is no existing damage, the damage area is set to the new region. + */ +void expo_damage_add(struct expo *exp, const struct vid_bbox *bbox); + #endif /*__EXPO_H */