Skip to contentSkip to conversation

fbtft: limit dirty rows based on damage range

PATCH In review ChanSoo Shin 5 participants 9 messages Jan 28 – Feb 6

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 fbtft: limit dirty rows based on damage range

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.

---
 drivers/staging/fbtft/fbtft-core.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/fbtft/fbtft-core.c +6 -2
index 8a5ccc8ae0a1..1d5cb45199d0 100644
@@ -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)
Signature · 1 line
2.52.0
#1 lore raw
Quoted 7 lines · 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.

---

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
In reply to ChanSoo Shin
Quoted 7 lines · 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.

---

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

#3 lore raw
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · 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.

Quoted 7 lines
Quoted 2 lines

---

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'.

Quoted 12 lines

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."

Quoted 3 lines

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.

Quoted 2 lines

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

Signature · 2 lines
With Best Regards,
Andy Shevchenko
author
#4 lore raw

Thanks for the explanation.

I understand the issue now, and I'd like to withdraw this patch. Sorry for the confusion, and thank you for taking the time to review it.

Best regards,
ChanSoo Shin

Quoted 52 lines · Andy Shevchenko
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · 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.

Quoted 7 lines
Quoted 2 lines

---

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'.

Quoted 12 lines

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."

Quoted 3 lines

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涎,
SPI, and parallel panels.

Quoted 2 lines

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

#5 lore raw
In reply to ChanSoo Shin

Hi ChanSoo,

Quoted 6 lines · 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.

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

#6 lore raw
Quoted 8 lines · Nam Cao
Quoted 4 lines · 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.

This looks useful and I prefer to see it applied. I understand lack of testing is the main obstacle.

Correct.

Quoted 1 line

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw
Quoted 1 line · Andy Shevchenko

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

Yes, a pair with SPI interface.

Nam

#8 lore raw
Quoted 4 lines · Nam Cao
Quoted 1 line · Andy Shevchenko

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.

Signature · 2 lines
With Best Regards,
Andy Shevchenko