public inbox for linux-fbdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] fbtft: limit dirty rows based on damage range
@ 2026-01-28 20:39 ChanSoo Shin
  2026-01-28 22:35 ` Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: ChanSoo Shin @ 2026-01-28 20:39 UTC (permalink / raw)
  To: andy; +Cc: gregkh, dri-devel, linux-fbdev, linux-staging, ChanSoo Shin

Instead of marking the entire display as dirty, calculate the start
and end rows based on the damage offset and length and only mark the
affected rows dirty. This reduces unnecessary full framebuffer updates
for partial writes.

Signed-off-by: ChanSoo Shin <csshin9928@gmail.com>
---
 drivers/staging/fbtft/fbtft-core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 8a5ccc8ae0a1..1d5cb45199d0 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -415,8 +415,12 @@ 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;
+	__u32 height = end_row - start_row + 1;
+
+	par->fbtftops.mkdirty(info, start_row, height);
 }
 
 static void fbtft_ops_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-01-28 20:39 [PATCH v5] fbtft: limit dirty rows based on damage range ChanSoo Shin
@ 2026-01-28 22:35 ` Andy Shevchenko
  2026-01-29  6:29 ` Dan Carpenter
  2026-02-06  0:04 ` Nam Cao
  2 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-28 22:35 UTC (permalink / raw)
  To: ChanSoo Shin; +Cc: andy, gregkh, dri-devel, linux-fbdev, linux-staging

On Thu, Jan 29, 2026 at 05:39:38AM +0900, ChanSoo Shin wrote:
> Instead of marking the entire display as dirty, calculate the start
> and end rows based on the damage offset and length and only mark the
> affected rows dirty. This reduces unnecessary full framebuffer updates
> for partial writes.
> 
> Signed-off-by: ChanSoo Shin <csshin9928@gmail.com>
> ---

This is v5 and no changelog and no answers to the reviewers' questions.
Please, read all what people replied to your previous attempts.
Without that processed correctly NAK to this one.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-01-28 20:39 [PATCH v5] fbtft: limit dirty rows based on damage range ChanSoo Shin
  2026-01-28 22:35 ` Andy Shevchenko
@ 2026-01-29  6:29 ` Dan Carpenter
  2026-01-29 10:59   ` Andy Shevchenko
  2026-02-06  0:04 ` Nam Cao
  2 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2026-01-29  6:29 UTC (permalink / raw)
  To: ChanSoo Shin, andy; +Cc: gregkh, dri-devel, linux-fbdev, linux-staging

On Thu, Jan 29, 2026 at 05:39:38AM +0900, ChanSoo Shin wrote:
> Instead of marking the entire display as dirty, calculate the start
> and end rows based on the damage offset and length and only mark the
> affected rows dirty. This reduces unnecessary full framebuffer updates
> for partial writes.
> 
> Signed-off-by: ChanSoo Shin <csshin9928@gmail.com>
> ---

TL/DR:  I suck as a reviewer so I would be nervous to apply this
without testing.  Andy is an expert here and we trust him so if he's
okay with it then great.  Or if some other expert could sign off, but
I don't know enough to sign off myself.


The problem for me is how do I review something like this?  Staging
is a grab bag of different modules and I'm not an expert in any of
the subsystems.  Normally, it's easy to review staging patches
because they are clean up work which does change how the code works
so I just look for unintentional side effects.

It's trickier to review a patch like this which changes runtime.  If
it were fixing a bug, then I could verify the bug is real and say
well, "Maybe the fix is wrong, but we were going to corrupt memory
anyway, so the worst case is that it is as bad as before.  It can't
make the problem worse."

This is your first kernel patch.  You don't work for a company that
makes the hardware.  You said earlier in a private email that this
hasn't been tested.

The patch looks reasonable to me, but it also looks simple.  If it
were that easy why didn't the original author do it?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-01-29  6:29 ` Dan Carpenter
@ 2026-01-29 10:59   ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-01-29 10:59 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: ChanSoo Shin, andy, gregkh, dri-devel, linux-fbdev, linux-staging

On Thu, Jan 29, 2026 at 09:29:26AM +0300, Dan Carpenter wrote:
> On Thu, Jan 29, 2026 at 05:39:38AM +0900, ChanSoo Shin wrote:
> > Instead of marking the entire display as dirty, calculate the start
> > and end rows based on the damage offset and length and only mark the
> > affected rows dirty. This reduces unnecessary full framebuffer updates
> > for partial writes.
> > 
> > Signed-off-by: ChanSoo Shin <csshin9928@gmail.com>
> > ---
> 
> TL/DR:  I suck as a reviewer so I would be nervous to apply this
> without testing.  Andy is an expert here and we trust him so if he's
> okay with it then great.  Or if some other expert could sign off, but
> I don't know enough to sign off myself.

The rule of thumb for _this_ driver (or set of drivers under FBTFT) is
that: we are in maintenance mode and we only accept bugfixes or treewide
changes. The rest can be accepted but unlikely. Either way, we really
want to see this (kind of changes) being tested on real HW. It's not as
simple as renaming variable 'i' to 'j'.

> The problem for me is how do I review something like this?  Staging
> is a grab bag of different modules and I'm not an expert in any of
> the subsystems.  Normally, it's easy to review staging patches
> because they are clean up work which does change how the code works
> so I just look for unintentional side effects.
> 
> It's trickier to review a patch like this which changes runtime.  If
> it were fixing a bug, then I could verify the bug is real and say
> well, "Maybe the fix is wrong, but we were going to corrupt memory
> anyway, so the worst case is that it is as bad as before.  It can't
> make the problem worse."
> 
> This is your first kernel patch.  You don't work for a company that
> makes the hardware.  You said earlier in a private email that this
> hasn't been tested.

Unfortunately it is not the best driver to go with this. At some point I might
be able to test this when I setup my fbtft minilab at home, I have a few I²C,
SPI, and parallel panels.

> The patch looks reasonable to me, but it also looks simple.  If it
> were that easy why didn't the original author do it?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-01-28 20:39 [PATCH v5] fbtft: limit dirty rows based on damage range ChanSoo Shin
  2026-01-28 22:35 ` Andy Shevchenko
  2026-01-29  6:29 ` Dan Carpenter
@ 2026-02-06  0:04 ` Nam Cao
  2026-02-06 10:36   ` Andy Shevchenko
  2 siblings, 1 reply; 8+ messages in thread
From: Nam Cao @ 2026-02-06  0:04 UTC (permalink / raw)
  To: ChanSoo Shin, andy
  Cc: gregkh, dri-devel, linux-fbdev, linux-staging, ChanSoo Shin

Hi ChanSoo,

ChanSoo Shin <csshin9928@gmail.com> writes:
> Instead of marking the entire display as dirty, calculate the start
> and end rows based on the damage offset and length and only mark the
> affected rows dirty. This reduces unnecessary full framebuffer updates
> for partial writes.
>
> Signed-off-by: ChanSoo Shin <csshin9928@gmail.com>

This looks useful and I prefer to see it applied. I understand lack of
testing is the main obstacle. Are you still trying to get it merged? If
not, I can take over.

Nam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-02-06  0:04 ` Nam Cao
@ 2026-02-06 10:36   ` Andy Shevchenko
  2026-02-06 10:51     ` Nam Cao
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2026-02-06 10:36 UTC (permalink / raw)
  To: Nam Cao; +Cc: ChanSoo Shin, andy, gregkh, dri-devel, linux-fbdev, linux-staging

On Fri, Feb 06, 2026 at 01:04:45AM +0100, Nam Cao wrote:
> ChanSoo Shin <csshin9928@gmail.com> writes:
> > Instead of marking the entire display as dirty, calculate the start
> > and end rows based on the damage offset and length and only mark the
> > affected rows dirty. This reduces unnecessary full framebuffer updates
> > for partial writes.
> 
> This looks useful and I prefer to see it applied. I understand lack of
> testing is the main obstacle.

Correct.

> Are you still trying to get it merged? If not, I can take over.

Do you have an actual HW to test? If not, won't be applied either.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-02-06 10:36   ` Andy Shevchenko
@ 2026-02-06 10:51     ` Nam Cao
  2026-02-06 11:35       ` Andy Shevchenko
  0 siblings, 1 reply; 8+ messages in thread
From: Nam Cao @ 2026-02-06 10:51 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: ChanSoo Shin, andy, gregkh, dri-devel, linux-fbdev, linux-staging

Andy Shevchenko <andriy.shevchenko@intel.com> writes:
> Do you have an actual HW to test? If not, won't be applied either.

Yes, a pair with SPI interface.

Nam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] fbtft: limit dirty rows based on damage range
  2026-02-06 10:51     ` Nam Cao
@ 2026-02-06 11:35       ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2026-02-06 11:35 UTC (permalink / raw)
  To: Nam Cao; +Cc: ChanSoo Shin, andy, gregkh, dri-devel, linux-fbdev, linux-staging

On Fri, Feb 06, 2026 at 05:51:45PM +0700, Nam Cao wrote:
> Andy Shevchenko <andriy.shevchenko@intel.com> writes:
> > Do you have an actual HW to test? If not, won't be applied either.
> 
> Yes, a pair with SPI interface.

Cool! Would be nice to have tested contribution, indeed.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-02-06 11:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-28 20:39 [PATCH v5] fbtft: limit dirty rows based on damage range ChanSoo Shin
2026-01-28 22:35 ` Andy Shevchenko
2026-01-29  6:29 ` Dan Carpenter
2026-01-29 10:59   ` Andy Shevchenko
2026-02-06  0:04 ` Nam Cao
2026-02-06 10:36   ` Andy Shevchenko
2026-02-06 10:51     ` Nam Cao
2026-02-06 11:35       ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox