summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mgag200/mgag200_mode.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-02-09 16:41:05 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2023-02-20 15:20:41 +0100
commit2a742fd1640574b80682669825274122e71141e7 (patch)
tree832c7e6416be997f1005683188921cace9425014 /drivers/gpu/drm/mgag200/mgag200_mode.c
parentdrm/mgag200: Remove disable handling from atomic_update (diff)
downloadlinux-2a742fd1640574b80682669825274122e71141e7.tar.xz
linux-2a742fd1640574b80682669825274122e71141e7.zip
drm/mgag200: Implement struct drm_plane_helper_funcs.atomic_enable
Enable the primary plane for mgag200 hardware via atomic_enable. Atomic helpers invoke this callback only when the plane becomes active. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230209154107.30680-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_mode.c')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 47e86eadb239..0f2dd26755df 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -501,7 +501,6 @@ void mgag200_primary_plane_helper_atomic_update(struct drm_plane *plane,
struct drm_framebuffer *fb = plane_state->fb;
struct drm_atomic_helper_damage_iter iter;
struct drm_rect damage;
- u8 seq1;
drm_atomic_helper_damage_iter_init(&iter, old_plane_state, plane_state);
drm_atomic_for_each_plane_damage(&iter, &damage) {
@@ -511,13 +510,19 @@ void mgag200_primary_plane_helper_atomic_update(struct drm_plane *plane,
/* Always scanout image at VRAM offset 0 */
mgag200_set_startadd(mdev, (u32)0);
mgag200_set_offset(mdev, fb);
+}
- if (!old_plane_state->crtc && plane_state->crtc) { // enabling
- RREG_SEQ(0x01, seq1);
- seq1 &= ~MGAREG_SEQ1_SCROFF;
- WREG_SEQ(0x01, seq1);
- msleep(20);
- }
+void mgag200_primary_plane_helper_atomic_enable(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct drm_device *dev = plane->dev;
+ struct mga_device *mdev = to_mga_device(dev);
+ u8 seq1;
+
+ RREG_SEQ(0x01, seq1);
+ seq1 &= ~MGAREG_SEQ1_SCROFF;
+ WREG_SEQ(0x01, seq1);
+ msleep(20);
}
void mgag200_primary_plane_helper_atomic_disable(struct drm_plane *plane,