From nobody Sat Jul 25 13:16:50 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4h6lkV52SRz6lPFM for ; Sat, 25 Jul 2026 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h6lkV3FFKz3rwy for ; Sat, 25 Jul 2026 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784985410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T/4MzHIw+AZLa92y8NCuzj+fbNn+dQGSzEA1WvLsBOE=; b=NaNEHDQCEAZbangkHy/cbhY+X5PMN2+IAM1AMqWZDCvYxt+LrhEAKb92Oe5x2BPITZUt4g 5KB2F4ei6HRm5BEMPopPXV4xMxIC8uszhgZOzbFHSj/fzo5Urv2ASR1S4OvNb9wF75eAyM ym0BWyxVgzLWTUU7Li7RzT3RIKHSjhAnwOilcFFgpcNr4MI2OpcZbj/1GolnHUGe7Ij+Wg oQE7iTo6k8g6yynE7NoVBqrz/2vaqVLFxh3+Ev095d1BfE3zZvFm/4RU8vDA/mMDP9HyVT 6aetKGHuBkAM3pwqOTTK6ZrCXKPN/JkgWIwN/CrIaZT4G7iPK94JZpuR7NClNg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784985410; a=rsa-sha256; cv=none; b=t91YR+2YuwIf0Ta8LG376OvonRZwqnRSoHIp2Ibm7B8TMXCqBExhpwOO3L3Mjt9Pns7y2E JITnejIgk1rXn/CElONKxJz6bX6pmSI2BD9Lc5RhmTkdzZTGaOcq4C2g3P6vm4CSLpZVM2 Yjn77Uo0TArKnVb/lClZhBoVkY7LTjJ15+UcLGGAfPkDJ4I46t7ywLqpBThETn89dc9XQY 3EHEclNMV1C6XINJ4E0V7Id52YNNWUp+2U7z+vf06cDyhsNUVpug0R0paWd3XDqmU88fXG kf5HqkiNNuzhBj8qDOWFj3NTeOeUqey7Pnfu79FoR7/OJRcWd0LOexfwEEgR4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784985410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T/4MzHIw+AZLa92y8NCuzj+fbNn+dQGSzEA1WvLsBOE=; b=NIvRFeLLTJByhXC0ZdG/1OwnED4ciNGdDUUkvtzzeeaxRuskh3XS/nU9b/ZMpB+A39/U3k 7RUf8Fppxm4w4uPKZ4/S2hJSXvLDihDi9Z93urqyid3Ucq+cy9YLflHpqEBSsO8LyOPXLw 74eC49QGCMaYSnkAbHHkEUvC9ET6QmuKPW3EIKU7w7Q3UegLVnI59w8pySgxa+tcgDGogZ isKdSqAYw6RnZod9R2KwRfrbMJYfdTkRWSLRoNdszimV1nS4dVw1vEfoYFc+9tiv0oeoM2 lMVVJ8qreEEazWxtsIHGPn/icIexWtpchYH2eUhFu/UjgVT93WGwRFLTHD/h1Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h6lkV1qX6zdm4 for ; Sat, 25 Jul 2026 13:16:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2634d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Jul 2026 13:16:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: ShengYi Hung Subject: git: 4a1a1bf3afc7 - stable/15 - stand: Fix shadow buffer offset handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 4a1a1bf3afc7643356ed7d139cbdad47a9efc4c4 Auto-Submitted: auto-generated Date: Sat, 25 Jul 2026 13:16:50 +0000 Message-Id: <6a64b742.2634d.6522c4c9@gitrepo.freebsd.org> The branch stable/15 has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=4a1a1bf3afc7643356ed7d139cbdad47a9efc4c4 commit 4a1a1bf3afc7643356ed7d139cbdad47a9efc4c4 Author: ShengYi Hung AuthorDate: 2026-06-24 14:31:03 +0000 Commit: ShengYi Hung CommitDate: 2026-07-25 13:13:24 +0000 stand: Fix shadow buffer offset handling The shadow buffer is addressed relative to `tg_origin`, which includes the padding offset, whereas `gfxfb_blt` operates on coordinates without that offset. To make `gfx_fb_copy_area` emulate the behavior of `gfxfb_blt`, the source coordinates must include the padding offset, while the destination coordinates must not. The original implementation omitted the offset from the source coordinates; this change corrects that. Additionally, `gfx_fb_cons_display` already applies the padding offset, so the redundant adjustment is removed. PR: 296246 Reported by: 2khramtsov@gmail.com Reviewed by: imp Tested by: 2khramtsov@gmail.com, junchoon@dec.sakura.ne.jp, naito.yuichiro_@gmail.com Fixes: 32da2f23ae4d MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57821 (cherry picked from commit 76aa776b5f47ecd0d45336e22795fef98af57d2f) --- stand/common/gfx_fb.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/stand/common/gfx_fb.c b/stand/common/gfx_fb.c index 3aa358adf4ec..9db7d26a0dd1 100644 --- a/stand/common/gfx_fb.c +++ b/stand/common/gfx_fb.c @@ -1400,26 +1400,32 @@ gfx_fb_copy_area(teken_gfx_t *state, const teken_rect_t *s, pitch = state->tg_fb.fb_width; bytes = width * sizeof (*state->tg_shadow_fb); - uint32_t dst_x = dx + state->tg_origin.tp_col; - uint32_t dst_y = dy + state->tg_origin.tp_row; + uint32_t ssx = sx + state->tg_origin.tp_col; + uint32_t ssy = sy + state->tg_origin.tp_row; + uint32_t dsx = dx + state->tg_origin.tp_col; + uint32_t dsy = dy + state->tg_origin.tp_row; + uint32_t dst_x = dsx; + uint32_t dst_y = dsy; uint32_t dst_h = height; /* * To handle overlapping areas, set up reverse copy here. + * The origin offset cancels out in the comparison so the + * terminal-relative form is equivalent. */ if (dy * pitch + dx > sy * pitch + sx) { - sy += height; - dy += height; + ssy += height; + dsy += height; step = -step; } while (height-- > 0) { - uint32_t *source = &state->tg_shadow_fb[sy * pitch + sx]; - uint32_t *destination = &state->tg_shadow_fb[dy * pitch + dx]; + uint32_t *source = &state->tg_shadow_fb[ssy * pitch + ssx]; + uint32_t *destination = &state->tg_shadow_fb[dsy * pitch + dsx]; bcopy(source, destination, bytes); - sy += step; - dy += step; + ssy += step; + dsy += step; } gfx_shadow_mark_dirty(dst_x, dst_y, width, dst_h); @@ -1618,13 +1624,11 @@ gfx_fb_cons_display(uint32_t x, uint32_t y, uint32_t width, uint32_t height, */ if (gfx_state.tg_shadow_fb != NULL) { uint32_t pitch = gfx_state.tg_fb.fb_width; - uint32_t sy = y - gfx_state.tg_origin.tp_row; - uint32_t sx = x - gfx_state.tg_origin.tp_col; p = data; for (uint32_t row = 0; row < height; row++) { buf = (void *)(gfx_state.tg_shadow_fb + - (sy + row) * pitch + sx); + (y + row) * pitch + x); bitmap_cpy(buf, &p[row * width], width); } gfx_shadow_mark_dirty(x, y, width, height);