Skip to contentSkip to conversation

pxafb: correct the vertical back porch macro

PATCH New Matt Reimer 4 participants 5 messages Oct 22, 2010 – Oct 25, 2010

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

PATCH 1/1 pxafb: correct the vertical back porch macro

Fix an off-by-one bug in the LCCR2_BegFrmDel() macro. The vertical back porch knob LCCR2[BFW] specifies the number of clock periods minus one, but the macro wasn't doing the subtraction.

---
 arch/arm/mach-pxa/include/mach/regs-lcd.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/include/mach/regs-lcd.h +1 -1
index f82dcea..5074d18 100644
@@ -107,7 +107,7 @@
 #define LCCR2_EndFrmDel(Tln)   ((Tln) << FShft (LCCR2_EFW))
 
 #define LCCR2_BFW      Fld (8, 24)     /* Beginning-of-Frame line clock */
-#define LCCR2_BegFrmDel(Tln)   ((Tln) << FShft (LCCR2_BFW))
+#define LCCR2_BegFrmDel(Tln)   (((Tln) - 1) << FShft (LCCR2_BFW))
 
 #define LCCR3_API      (0xf << 16)     /* AC Bias pin trasitions per interrupt */
 #define LCCR3_API_S    16
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 pxafb: correct the vertical back porch macro

Quoted 15 lines · Matt Reimer

Fix an off-by-one bug in the LCCR2_BegFrmDel() macro. The vertical back porch knob LCCR2[BFW] specifies the number of clock periods minus one, but the macro wasn't doing the subtraction.
---
?arch/arm/mach-pxa/include/mach/regs-lcd.h | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

arch/arm/mach-pxa/include/mach/regs-lcd.h +0 -0
index f82dcea..5074d18 100644
@@ -107,7 +107,7 @@
 ?#define LCCR2_EndFrmDel(Tln) ? ((Tln) << FShft (LCCR2_EFW))
 

?#define LCCR2_BFW ? ? ?Fld (8, 24) ? ? /* Beginning-of-Frame line clock */

arch/arm/mach-pxa/include/mach/regs-lcd.h

Quoted 2 lines
arch/arm/mach-pxa/include/mach/regs-lcd.h +1 -1
-#define LCCR2_BegFrmDel(Tln) ? ((Tln) << FShft (LCCR2_BFW))
+#define LCCR2_BegFrmDel(Tln) ? (((Tln) - 1) << FShft (LCCR2_BFW))

Nothing in the spec suggests that this minus 1 is necessary. Could you please double check?

Quoted 13 lines

?#define LCCR3_API ? ? ?(0xf << 16) ? ? /* AC Bias pin trasitions per interrupt */ ?#define LCCR3_API_S ? ?16
--
1.7.0.4

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#2 lore raw

PATCH 1/1 pxafb: correct the vertical back porch macro

Dne So 23. ??jna 2010 03:07:34 Eric Miao napsal(a):

Quoted 16 lines · Matt Reimer
Quoted 15 lines

Fix an off-by-one bug in the LCCR2_BegFrmDel() macro. The vertical back porch knob LCCR2[BFW] specifies the number of clock periods minus one, but the macro wasn't doing the subtraction.

---
 arch/arm/mach-pxa/include/mach/regs-lcd.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/arch/arm/mach-pxa/include/mach/regs-lcd.h index f82dcea..5074d18 100644

arch/arm/mach-pxa/include/mach/regs-lcd.h +0 -0
@@ -107,7 +107,7 @@
 #define LCCR2_EndFrmDel(Tln)   ((Tln) << FShft (LCCR2_EFW))
 
Quoted 6 lines

arch/arm/mach-pxa/include/mach/regs-lcd.h line 111

Quoted 3 lines
arch/arm/mach-pxa/include/mach/regs-lcd.h +1 -0
 #define LCCR2_BFW      Fld (8, 24)     /* Beginning-of-Frame line clock
 */ -#define LCCR2_BegFrmDel(Tln)   ((Tln) << FShft (LCCR2_BFW))
+#define LCCR2_BegFrmDel(Tln)   (((Tln) - 1) << FShft (LCCR2_BFW))

Nothing in the spec suggests that this minus 1 is necessary. Could you please double check?

It doesn't fit the settings in U-Boot or something ... it's a long known thing. I remember in U-Boot, one had to actually subtract one in the LCD configuration data structure so it'd be programmer correctly.

Quoted 17 lines
Quoted 8 lines
arch/arm/mach-pxa/include/mach/regs-lcd.h +0 -0
 #define LCCR3_API      (0xf << 16)     /* AC Bias pin trasitions per

interrupt */ #define LCCR3_API_S 16
--
1.7.0.4

Quoted 4 lines

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

PATCH 1/1 pxafb: correct the vertical back porch macro

In reply to Eric Miao
Quoted 15 lines · Eric Miao
Quoted 14 lines · Matt Reimer

Fix an off-by-one bug in the LCCR2_BegFrmDel() macro. The vertical back porch knob LCCR2[BFW] specifies the number of clock periods minus one, but the macro wasn't doing the subtraction.
---
?arch/arm/mach-pxa/include/mach/regs-lcd.h | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

arch/arm/mach-pxa/include/mach/regs-lcd.h +0 -0
index f82dcea..5074d18 100644
@@ -107,7 +107,7 @@
 ?#define LCCR2_EndFrmDel(Tln) ? ((Tln) << FShft (LCCR2_EFW))
 
Quoted 6 lines

arch/arm/mach-pxa/include/mach/regs-lcd.h

Quoted 3 lines

?#define LCCR2_BFW ? ? ?Fld (8, 24) ? ? /* Beginning-of-Frame line clock */

arch/arm/mach-pxa/include/mach/regs-lcd.h +1 -1
-#define LCCR2_BegFrmDel(Tln) ? ((Tln) << FShft (LCCR2_BFW))
+#define LCCR2_BegFrmDel(Tln) ? (((Tln) - 1) << FShft (LCCR2_BFW))

Nothing in the spec suggests that this minus 1 is necessary. Could you please double check?

The docs I have describing this bit (vol 3 rev 1.0) say, "If LCCR6[29] is set for LCD panels with an internal frame buffer, BFW specifies the pulse width of the read signal (L_FCLK_RD), which is equal to (BFW+1)*LCD_CLK_PERIOD."

I saw the "+1" in the docs and that the macro didn't match. But I hadn't read closely enough to see that BFW gets different meanings depending on what mode the controller is in. Because of this, I agree it should stay as it is, so I withdraw this patch.

Matt

#4 lore raw

PATCH 1/1 pxafb: correct the vertical back porch macro

In reply to Matt Reimer

Hi,

Quoted 4 lines · Matt Reimer

Fix an off-by-one bug in the LCCR2_BegFrmDel() macro. The vertical back porch knob LCCR2[BFW] specifies the number of clock periods minus one, but the macro wasn't doing the subtraction.

Nope! This is true only for the ELW and BLW settings in LCCR1, but not for the EFW and BFW settings in LCCR2! The vertical front and back porch can actually be programmed to a length of zero lines.

Furthermore, if you introduce such a change, you should also convert all users of the macro to use an appropriately adjusted value so that the result will be the same as without the patch!

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________