From nobody Tue Nov 4 21:44:00 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1531122579235146.28341036890004; Mon, 9 Jul 2018 00:49:39 -0700 (PDT) Received: from localhost ([::1]:39725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcQvS-0000S1-1z for importer@patchew.org; Mon, 09 Jul 2018 03:49:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcQq8-000530-5F for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcQq7-0002DC-53 for qemu-devel@nongnu.org; Mon, 09 Jul 2018 03:44:08 -0400 Received: from ozlabs.org ([203.11.71.1]:41957) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcQq6-0002B5-QF; Mon, 09 Jul 2018 03:44:07 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 41PHQS5d2Nz9s2L; Mon, 9 Jul 2018 17:44:00 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1531122240; bh=7GfICPQPsIbTS3iUKmiQ6IVG2sGsquE2IFeAxz7ENq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fc6YL6La1MPIsl1DYOPV95J2DyjXGCDa8eGQJBLZMNMZSoGi078b+2ATZYw2GsMC/ Rfe0MLcTqkDDfXYN/+h6gpDZK4TQ9QQ9e8WxJXzfJHY2rRqq3Lzek9kFB9MdW2Tfcm Q1nk+F1UKhODHYKXAxt1RQvrQB9OTc4ikn8gCI3g= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 9 Jul 2018 17:43:43 +1000 Message-Id: <20180709074350.27086-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709074350.27086-1-david@gibson.dropbear.id.au> References: <20180709074350.27086-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 09/16] sm501: Set updated region dirty after 2D operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Set the changed memory region dirty after performed a 2D operation to ensure that the screen is updated properly. Signed-off-by: BALATON Zoltan Signed-off-by: David Gibson --- hw/display/sm501.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 10ee008eb2..3661a89f60 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -715,12 +715,16 @@ static void sm501_2d_operation(SM501State *s) /* 1 if rop2 source is the pattern, otherwise the source is the bitmap= */ int rop2_source_is_pattern =3D (s->twoD_control >> 14) & 0x1; int rop =3D s->twoD_control & 0xFF; + uint32_t src_base =3D s->twoD_source_base & 0x03FFFFFF; + uint32_t dst_base =3D s->twoD_destination_base & 0x03FFFFFF; =20 /* get frame buffer info */ - uint8_t *src =3D s->local_mem + (s->twoD_source_base & 0x03FFFFFF); - uint8_t *dst =3D s->local_mem + (s->twoD_destination_base & 0x03FFFFFF= ); + uint8_t *src =3D s->local_mem + src_base; + uint8_t *dst =3D s->local_mem + dst_base; int src_width =3D s->twoD_pitch & 0x1FFF; int dst_width =3D (s->twoD_pitch >> 16) & 0x1FFF; + int crt =3D (s->dc_crt_control & SM501_DC_CRT_CONTROL_SEL) ? 1 : 0; + int fb_len =3D get_width(s, crt) * get_height(s, crt) * get_bpp(s, crt= ); =20 if (addressing !=3D 0x0) { printf("%s: only XY addressing is supported.\n", __func__); @@ -821,6 +825,15 @@ static void sm501_2d_operation(SM501State *s) abort(); break; } + + if (dst_base >=3D get_fb_addr(s, crt) && + dst_base <=3D get_fb_addr(s, crt) + fb_len) { + int dst_len =3D MIN(fb_len, ((dst_y + operation_height - 1) * dst_= width + + dst_x + operation_width) * (1 << format_flags)); + if (dst_len) { + memory_region_set_dirty(&s->local_mem_region, dst_base, dst_le= n); + } + } } =20 static uint64_t sm501_system_config_read(void *opaque, hwaddr addr, --=20 2.17.1