Skip to contentSkip to conversation

drm: mxsfb_crtc: Fix the framebuffer misplacement

PATCH In review Fabio Estevam 4 participants 7 messages Feb 2, 2017 – Feb 8, 2017

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 drm: mxsfb_crtc: Fix the framebuffer misplacement

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

---
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +2 -2
index e10a4ed..b56f86c 100644
@@ -184,8 +184,8 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
 	       VDCTRL2_SET_HSYNC_PERIOD(m->crtc_htotal),
 	       mxsfb->base + LCDC_VDCTRL2);
 
-	writel(SET_HOR_WAIT_CNT(m->crtc_hblank_end - m->crtc_hsync_end) |
-	       SET_VERT_WAIT_CNT(m->crtc_vblank_end - m->crtc_vsync_end),
+	writel(SET_HOR_WAIT_CNT(m->crtc_htotal - m->crtc_hsync_start) |
+	       SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start),
 	       mxsfb->base + LCDC_VDCTRL3);
 
 	writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
Signature · 6 lines
2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tested-by Breno Lima on v1 1/1
#1 lore raw

2017-02-02 19:26 GMT-02:00 Fabio Estevam <[email protected]>:

Quoted 23 lines

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

Review

Quoted 7 lines
---
 drivers/gpu/drm/mxsfb/mxsfb_crtc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/mxsfb/mxsfb_crtc.c

drivers/gpu/drm/mxsfb/mxsfb_crtc.c static void mxsfb_crtc_mode_set_nofb(struct

Quoted 4 lines

index e10a4ed..b56f86c 100644

drivers/gpu/drm/mxsfb/mxsfb_crtc.c +0 -0
@@ -184,8 +184,8 @@ static void mxsfb_crtc_mode_set_nofb(struct

mxsfb_drm_private *mxsfb)

Quoted 11 lines
drivers/gpu/drm/mxsfb/mxsfb_crtc.c +2 -3
               VDCTRL2_SET_HSYNC_PERIOD(m->crtc_htotal),
               mxsfb->base + LCDC_VDCTRL2);
 
-       writel(SET_HOR_WAIT_CNT(m->crtc_hblank_end - m->crtc_hsync_end) |
-             SET_VERT_WAIT_CNT(m->crtc_vblank_end - m->crtc_vsync_end),
+       writel(SET_HOR_WAIT_CNT(m->crtc_htotal - m->crtc_hsync_start) |
+              SET_VERT_WAIT_CNT(m->crtc_vtotal - m->crtc_vsync_start),
               mxsfb->base + LCDC_VDCTRL3);
 
        writel(SET_DOTCLK_H_VALID_DATA_CNT(m->hdisplay),
--
Quoted 2 lines

2.7.4

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Tested-by on v1 1/1
#2 lore raw
In reply to Fabio Estevam
Quoted 16 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

Quoted 8 lines

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

Signature · 6 lines
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 19 lines · Marek Vasut
Quoted 18 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

Quoted 8 lines
Quoted 6 lines

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

You're listed as maintainer in MAINTAINERS, replying with tested-by is super confusing. Did you pick this up and will do a pull request? Do you expect someone else to pick this up?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#4 lore raw
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Marek Vasut
Quoted 22 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You're listed as maintainer in MAINTAINERS, replying with tested-by is super confusing. Did you pick this up and will do a pull request?

No

Quoted 1 line

Do you expect someone else to pick this up?

The last patches for mxsfb were picked by you, but if you expect me to pick the mxsfb patches through my own tree and then submit PR, I can do that.

Signature · 6 lines
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 33 lines · Marek Vasut
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Marek Vasut
Quoted 22 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You're listed as maintainer in MAINTAINERS, replying with tested-by is super confusing. Did you pick this up and will do a pull request?

Quoted 7 lines

No

Quoted 1 line

Do you expect someone else to pick this up?

The last patches for mxsfb were picked by you, but if you expect me to pick the mxsfb patches through my own tree and then submit PR, I can do that.

I apply trivial patches as a welcoming gesture for new folks, but that's generally about it. Anyway, if you expect drm-misc maintainers to pick up stuff then you need to tell us, otherwise the patch will be lost. But then if you want mxsfb maintained in drm-misc I'd say better to get commit rights and join the club :-) Just ping on #dri-devel on freenode.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
maintainer
#6 lore raw
Quoted 42 lines · Daniel Vetter
Quoted 33 lines · Marek Vasut
Quoted 24 lines · Daniel Vetter
Quoted 23 lines · Marek Vasut
Quoted 22 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Currently the framebuffer content is displayed with incorrect offsets in both the vertical and horizontal directions.

The fbdev version of the driver does not show this problem. Breno Lima dumped the eLCDIF controller registers on both the drm and fbdev drivers and noticed that the VDCTRL3 register is configured incorrectly in the drm driver.

The fbdev driver calculates the vertical and horizontal wait counts of the VDCTRL3 register by doing: back porch + sync length.

Looking at the horizontal and vertical timing diagram from include/drm/drm_modes.h this value corresponds to:

crtc_[hv]total - crtc_[hv]sync_start

So fix the VDCTRL3 register setting accordingly so that the eLCDIF controller can properly show the framebuffer content in the correct position.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

You're listed as maintainer in MAINTAINERS, replying with tested-by is super confusing. Did you pick this up and will do a pull request?

Quoted 7 lines

No

Quoted 1 line

Do you expect someone else to pick this up?

The last patches for mxsfb were picked by you, but if you expect me to pick the mxsfb patches through my own tree and then submit PR, I can do that.

Quoted 6 lines

I apply trivial patches as a welcoming gesture for new folks, but that's generally about it. Anyway, if you expect drm-misc maintainers to pick up stuff then you need to tell us, otherwise the patch will be lost. But then if you want mxsfb maintained in drm-misc I'd say better to get commit rights and join the club :-) Just ping on #dri-devel on freenode.

Ha, I see. I'll ping you on dri-devel shortly.

Quoted 2 lines

-Daniel

Signature · 6 lines
Best regards,
Marek Vasut
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel