Skip to contentSkip to conversation

drm/mgag200: Fix value in <VBLKSTR> register

PATCH Applied Thomas Zimmermann 5 participants 7 messages Apr 16, 2025 – Apr 17, 2025

Subsystems (4)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

PATCH 1/1 drm/mgag200: Fix value in <VBLKSTR> register

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
 	vsyncstr = mode->crtc_vsync_start - 1;
 	vsyncend = mode->crtc_vsync_end - 1;
 	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
 	vblkend = vtotal + 1;
 
 	linecomp = vdispend;
Signature · 1 line
2.49.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thomas Zimmermann

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

Thanks, it looks good to me.

Quoted 30 lines
---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
  	vsyncstr = mode->crtc_vsync_start - 1;
  	vsyncend = mode->crtc_vsync_end - 1;
  	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
  	vblkend = vtotal + 1;
 
  	linecomp = vdispend;
Applied
#2 lore raw
In reply to Thomas Zimmermann
Quoted 5 lines · Thomas Zimmermann

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

Applied to 6.14.2. BMC and external monitor works as expected.

Thank you.

Quoted 32 lines
---
 drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
 	vsyncstr = mode->crtc_vsync_start - 1;
 	vsyncend = mode->crtc_vsync_end - 1;
 	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
 	vblkend = vtotal + 1;
 
 	linecomp = vdispend;
Signature · 1 line
2.49.0
Signature · 2 lines
 Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
 million bugs.
author maintainer
#3 lore raw

Hi

Am 16.04.25 um 17:22 schrieb Wakko Warner:

Quoted 7 lines
Quoted 5 lines · Thomas Zimmermann

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

Applied to 6.14.2. BMC and external monitor works as expected.

Great. Thanks for testing. Can I add your Tested-by tag to the commit?

Best regards
Thomas

Quoted 35 lines

Thank you.

Quoted 32 lines
---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
  	vsyncstr = mode->crtc_vsync_start - 1;
  	vsyncend = mode->crtc_vsync_end - 1;
  	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
  	vblkend = vtotal + 1;
 
  	linecomp = vdispend;
Signature · 1 line
2.49.0
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#4 lore raw
Quoted 4 lines · Thomas Zimmermann

Hi

Am 16.04.25 um 17:22 schrieb Wakko Warner:

Quoted 1 line

Thomas Zimmermann wrote:

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

Applied to 6.14.2. BMC and external monitor works as expected.

Great. Thanks for testing. Can I add your Tested-by tag to the commit?

You may.

Quoted 41 lines
Quoted 31 lines
Quoted 31 lines
---
  drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
  	vsyncstr = mode->crtc_vsync_start - 1;
  	vsyncend = mode->crtc_vsync_end - 1;
  	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
  	vblkend = vtotal + 1;
  	linecomp = vdispend;
Signature · 1 line
2.49.0
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
Signature · 2 lines
 Microsoft has beaten Volkswagen's world record.  Volkswagen only created 22
 million bugs.
#5 lore raw

Hello. Maybe I don't understand something, but I installed kernel version 6.14.2 on Arch Linux and the problem with the blinking video signal on IPMI remained

16.04.2025 19:56, Wakko Warner пишет:

Quoted 54 lines
Quoted 11 lines · Thomas Zimmermann

Hi

Am 16.04.25 um 17:22 schrieb Wakko Warner:

Quoted 7 lines
Quoted 5 lines · Thomas Zimmermann

Fix an off-by-one error when setting the vblanking start in <VBLKSTR>. Commit d6460bd52c27 ("drm/mgag200: Add dedicated variables for blanking fields") switched the value from crtc_vdisplay to crtc_vblank_start, which DRM helpers copy from the former. The commit missed to subtract one though.

Applied to 6.14.2. BMC and external monitor works as expected.

Great. Thanks for testing. Can I add your Tested-by tag to the commit?

You may.

Quoted 40 lines
Quoted 31 lines
Quoted 31 lines
---
   drivers/gpu/drm/mgag200/mgag200_mode.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +1 -1
index fb71658c3117..6067d08aeee3 100644
@@ -223,7 +223,7 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
   	vsyncstr = mode->crtc_vsync_start - 1;
   	vsyncend = mode->crtc_vsync_end - 1;
   	vtotal = mode->crtc_vtotal - 2;
-	vblkstr = mode->crtc_vblank_start;
+	vblkstr = mode->crtc_vblank_start - 1;
   	vblkend = vtotal + 1;
   	linecomp = vdispend;
Signature · 1 line
2.49.0
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)