From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66FC9D358E5 for ; Thu, 29 Jan 2026 08:56:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C29FD10E821; Thu, 29 Jan 2026 08:56:53 +0000 (UTC) X-Greylist: delayed 329 seconds by postgrey-1.36 at gabe; Wed, 28 Jan 2026 17:11:01 UTC Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 206B410E738 for ; Wed, 28 Jan 2026 17:11:01 +0000 (UTC) From: Nam Cao To: ChanSoo Shin , andy@kernel.org Cc: gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, ChanSoo Shin Subject: Re: [PATCH] fbtft: Improve damage_range to mark only changed rows In-Reply-To: <20260128130503.868466-1-csshin9928@gmail.com> References: <20260128130503.868466-1-csshin9928@gmail.com> Date: Wed, 28 Jan 2026 18:05:26 +0100 Message-ID: <87h5s5r7l5.fsf@yellow.woof> MIME-Version: 1.0 Content-Type: text/plain X-Mailman-Approved-At: Thu, 29 Jan 2026 08:56:34 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" ChanSoo Shin writes: > Instead of marking the entire display as dirty, calculate > start_row and end_row based on off/len and mark only those rows. > This improves performance for partial framebuffer updates. > > Signed-off-by: ChanSoo Shin > --- > drivers/staging/fbtft/fbtft-core.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c > index 8a5ccc8ae0a1..0fbdfdaaa94d 100644 > --- a/drivers/staging/fbtft/fbtft-core.c > +++ b/drivers/staging/fbtft/fbtft-core.c > @@ -415,8 +415,11 @@ static void fbtft_ops_damage_range(struct fb_info *info, off_t off, size_t len) > { > struct fbtft_par *par = info->par; > > - /* TODO: only mark changed area update all for now */ > - par->fbtftops.mkdirty(info, -1, 0); > + __u32 width = info->var.xres; > + __u32 start_row = off / width; > + __u32 end_row = (off + len - 1) / width; > + > + par->fbtftops.mkdirty(info, start_row, end_row); This doesn't look right: mkdirty() takes start row and number of rows, not start row and end row. Don't be fooled by how mkdirty() is declared, look at how it is implemented. Nam