Commit 8f85e4a1 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/ast: Implement struct drm_plane_helper_funcs.atomic_enable

Enable the primary plane for ast hardware via atomic_enable. Atomic
helpers invoke this callback only when the plane becomes active.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230209154107.30680-3-tzimmermann@suse.de
parent 169b9182
...@@ -672,17 +672,28 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane, ...@@ -672,17 +672,28 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
/* /*
* Some BMCs stop scanning out the video signal after the driver * Some BMCs stop scanning out the video signal after the driver
* reprogrammed the offset or scanout address. This stalls display * reprogrammed the offset. This stalls display output for several
* output for several seconds and makes the display unusable. * seconds and makes the display unusable. Therefore only update
* Therefore only update the offset if it changes and reprogram the * the offset if it changes.
* address after enabling the plane.
*/ */
if (!old_fb || old_fb->pitches[0] != fb->pitches[0]) if (!old_fb || old_fb->pitches[0] != fb->pitches[0])
ast_set_offset_reg(ast, fb); ast_set_offset_reg(ast, fb);
if (!old_fb) { }
static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane,
struct drm_atomic_state *state)
{
struct ast_private *ast = to_ast_private(plane->dev);
struct ast_plane *ast_plane = to_ast_plane(plane);
/*
* Some BMCs stop scanning out the video signal after the driver
* reprogrammed the scanout address. This stalls display
* output for several seconds and makes the display unusable.
* Therefore only reprogram the address after enabling the plane.
*/
ast_set_start_address_crt1(ast, (u32)ast_plane->offset); ast_set_start_address_crt1(ast, (u32)ast_plane->offset);
ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00); ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x00);
}
} }
static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane, static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane,
...@@ -697,6 +708,7 @@ static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = { ...@@ -697,6 +708,7 @@ static const struct drm_plane_helper_funcs ast_primary_plane_helper_funcs = {
DRM_GEM_SHADOW_PLANE_HELPER_FUNCS, DRM_GEM_SHADOW_PLANE_HELPER_FUNCS,
.atomic_check = ast_primary_plane_helper_atomic_check, .atomic_check = ast_primary_plane_helper_atomic_check,
.atomic_update = ast_primary_plane_helper_atomic_update, .atomic_update = ast_primary_plane_helper_atomic_update,
.atomic_enable = ast_primary_plane_helper_atomic_enable,
.atomic_disable = ast_primary_plane_helper_atomic_disable, .atomic_disable = ast_primary_plane_helper_atomic_disable,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment