[PATCH 13/17] drm/armada: move plane works to overlay
Russell King
rmk+kernel at armlinux.org.uk
Tue Jul 10 10:33:15 UTC 2018
Only overlay makes use of these now, so move these to the overlay code.
Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
---
drivers/gpu/drm/armada/armada_crtc.h | 2 --
drivers/gpu/drm/armada/armada_overlay.c | 12 ++++++++----
drivers/gpu/drm/armada/armada_plane.c | 6 ------
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h
index 2672c5cc0e45..73ddd7d61eb4 100644
--- a/drivers/gpu/drm/armada/armada_crtc.h
+++ b/drivers/gpu/drm/armada/armada_crtc.h
@@ -48,8 +48,6 @@ struct armada_plane_work {
struct armada_plane {
struct drm_plane base;
wait_queue_head_t frame_wait;
- bool next_work;
- struct armada_plane_work works[2];
struct armada_plane_work *work;
};
#define drm_to_armada_plane(p) container_of(p, struct armada_plane, base)
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c
index 214b2171a8f4..40868e485ae8 100644
--- a/drivers/gpu/drm/armada/armada_overlay.c
+++ b/drivers/gpu/drm/armada/armada_overlay.c
@@ -36,6 +36,8 @@ struct armada_ovl_plane_properties {
struct armada_ovl_plane {
struct armada_plane base;
+ struct armada_plane_work works[2];
+ bool next_work;
bool wait_vblank;
struct armada_ovl_plane_properties prop;
};
@@ -245,7 +247,7 @@ static int armada_overlay_commit(struct drm_plane *plane,
if (ret)
goto put_state;
- work = &dplane->base.works[dplane->base.next_work];
+ work = &dplane->works[dplane->next_work];
if (plane->state->fb != state->fb) {
/*
@@ -295,7 +297,7 @@ static int armada_overlay_commit(struct drm_plane *plane,
ret = 0;
}
- dplane->base.next_work = !dplane->base.next_work;
+ dplane->next_work = !dplane->next_work;
put_state:
drm_atomic_helper_plane_destroy_state(plane, state);
@@ -515,8 +517,10 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs)
return ret;
}
- dplane->base.works[0].fn = armada_ovl_plane_work;
- dplane->base.works[1].fn = armada_ovl_plane_work;
+ dplane->works[0].plane = &dplane->base.base;
+ dplane->works[0].fn = armada_ovl_plane_work;
+ dplane->works[1].plane = &dplane->base.base;
+ dplane->works[1].fn = armada_ovl_plane_work;
drm_plane_helper_add(&dplane->base.base,
&armada_overlay_plane_helper_funcs);
diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c
index 9d1eec1dc720..1cb6a605bda9 100644
--- a/drivers/gpu/drm/armada/armada_plane.c
+++ b/drivers/gpu/drm/armada/armada_plane.c
@@ -264,13 +264,7 @@ static const struct drm_plane_funcs armada_primary_plane_funcs = {
int armada_drm_plane_init(struct armada_plane *plane)
{
- unsigned int i;
-
- for (i = 0; i < ARRAY_SIZE(plane->works); i++)
- plane->works[i].plane = &plane->base;
-
init_waitqueue_head(&plane->frame_wait);
-
return 0;
}
--
2.7.4
More information about the dri-devel
mailing list