Skip to content

Commit 6f71937

Browse files
committed
drm/ast: Blank with VGACR17 sync enable, always clear VGACRB6 sync off
Blank the display by disabling sync pulses with VGACR17<7>. Unblank by reenabling them. This VGA setting should be supported by all Aspeed hardware. Ast currently blanks via sync-off bits in VGACRB6. Not all BMCs handle VGACRB6 correctly. After disabling sync during a reboot, some BMCs do not reenable it after the soft reset. The display output remains dark. When the display is off during boot, some BMCs set the sync-off bits in VGACRB6, so the display remains dark. Observed with Blackbird AST2500 BMCs. Clearing the sync-off bits unconditionally fixes these issues. Also do not modify VGASR1's SD bit for blanking, as it only disables GPU access to video memory. v2: - init vgacrb6 correctly (Jocelyn) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Fixes: ce3d99c ("drm: Call drm_atomic_helper_shutdown() at shutdown time for misc drivers") Tested-by: Nick Bowler <nbowler@draconx.ca> Reported-by: Nick Bowler <nbowler@draconx.ca> Closes: https://lore.kernel.org/dri-devel/wpwd7rit6t4mnu6kdqbtsnk5bhftgslio6e2jgkz6kgw6cuvvr@xbfswsczfqsi/ Cc: Douglas Anderson <dianders@chromium.org> Cc: Dave Airlie <airlied@redhat.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: Jocelyn Falempe <jfalempe@redhat.com> Cc: dri-devel@lists.freedesktop.org Cc: <stable@vger.kernel.org> # v6.7+ Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20251014084743.18242-1-tzimmermann@suse.de
1 parent 52e59f7 commit 6f71937

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -836,22 +836,24 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
836836
static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
837837
{
838838
struct ast_device *ast = to_ast_device(crtc->dev);
839+
u8 vgacr17 = 0x00;
840+
u8 vgacrb6 = 0xff;
839841

840-
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, 0x00);
841-
ast_set_index_reg_mask(ast, AST_IO_VGASRI, 0x01, 0xdf, 0x00);
842+
vgacr17 |= AST_IO_VGACR17_SYNC_ENABLE;
843+
vgacrb6 &= ~(AST_IO_VGACRB6_VSYNC_OFF | AST_IO_VGACRB6_HSYNC_OFF);
844+
845+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x17, 0x7f, vgacr17);
846+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, vgacrb6);
842847
}
843848

844849
static void ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_atomic_state *state)
845850
{
846851
struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
847852
struct ast_device *ast = to_ast_device(crtc->dev);
848-
u8 vgacrb6;
853+
u8 vgacr17 = 0xff;
849854

850-
ast_set_index_reg_mask(ast, AST_IO_VGASRI, 0x01, 0xdf, AST_IO_VGASR1_SD);
851-
852-
vgacrb6 = AST_IO_VGACRB6_VSYNC_OFF |
853-
AST_IO_VGACRB6_HSYNC_OFF;
854-
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xb6, 0xfc, vgacrb6);
855+
vgacr17 &= ~AST_IO_VGACR17_SYNC_ENABLE;
856+
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0x17, 0x7f, vgacr17);
855857

856858
/*
857859
* HW cursors require the underlying primary plane and CRTC to

drivers/gpu/drm/ast/ast_reg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#define AST_IO_VGAGRI (0x4E)
3030

3131
#define AST_IO_VGACRI (0x54)
32+
#define AST_IO_VGACR17_SYNC_ENABLE BIT(7) /* called "Hardware reset" in docs */
3233
#define AST_IO_VGACR80_PASSWORD (0xa8)
3334
#define AST_IO_VGACR99_VGAMEM_RSRV_MASK GENMASK(1, 0)
3435
#define AST_IO_VGACRA1_VGAIO_DISABLED BIT(1)

0 commit comments

Comments
 (0)