diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-07-15 13:11:24 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-10-01 09:33:26 -0400 |
commit | 561f60bc511f6ec054b566205b5c40ab9558a0ff (patch) | |
tree | ddeda0112a5a0c29903e3846729ac987307b776f | |
parent | d563c24514166d01b87cc96f92fe93b635d24c6e (diff) |
drm/armada: introduce generic armada_plane struct
Introduce a generic armada_plane struct which will eventually be used
for both the primary and overlay planes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/armada/armada_overlay.c | 19 |
2 files changed, 15 insertions, 9 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h index a86243ef4a51..549b5f538266 100644 --- a/drivers/gpu/drm/armada/armada_crtc.h +++ b/drivers/gpu/drm/armada/armada_crtc.h | |||
@@ -34,6 +34,11 @@ struct armada_regs { | |||
34 | struct armada_frame_work; | 34 | struct armada_frame_work; |
35 | struct armada_variant; | 35 | struct armada_variant; |
36 | 36 | ||
37 | struct armada_plane { | ||
38 | struct drm_plane base; | ||
39 | }; | ||
40 | #define drm_to_armada_plane(p) container_of(p, struct armada_plane, base) | ||
41 | |||
37 | struct armada_crtc { | 42 | struct armada_crtc { |
38 | struct drm_crtc crtc; | 43 | struct drm_crtc crtc; |
39 | const struct armada_variant *variant; | 44 | const struct armada_variant *variant; |
diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 8f2b21693c76..e5a5b73a08cb 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c | |||
@@ -30,7 +30,7 @@ struct armada_ovl_plane_properties { | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | struct armada_ovl_plane { | 32 | struct armada_ovl_plane { |
33 | struct drm_plane base; | 33 | struct armada_plane base; |
34 | struct drm_framebuffer *old_fb; | 34 | struct drm_framebuffer *old_fb; |
35 | uint32_t src_hw; | 35 | uint32_t src_hw; |
36 | uint32_t dst_hw; | 36 | uint32_t dst_hw; |
@@ -43,7 +43,8 @@ struct armada_ovl_plane { | |||
43 | } vbl; | 43 | } vbl; |
44 | struct armada_ovl_plane_properties prop; | 44 | struct armada_ovl_plane_properties prop; |
45 | }; | 45 | }; |
46 | #define drm_to_armada_ovl_plane(p) container_of(p, struct armada_ovl_plane, base) | 46 | #define drm_to_armada_ovl_plane(p) \ |
47 | container_of(p, struct armada_ovl_plane, base.base) | ||
47 | 48 | ||
48 | 49 | ||
49 | static void | 50 | static void |
@@ -78,7 +79,7 @@ static void armada_ovl_retire_fb(struct armada_ovl_plane *dplane, | |||
78 | old_fb = xchg(&dplane->old_fb, fb); | 79 | old_fb = xchg(&dplane->old_fb, fb); |
79 | 80 | ||
80 | if (old_fb) | 81 | if (old_fb) |
81 | armada_drm_queue_unref_work(dplane->base.dev, old_fb); | 82 | armada_drm_queue_unref_work(dplane->base.base.dev, old_fb); |
82 | } | 83 | } |
83 | 84 | ||
84 | /* === Plane support === */ | 85 | /* === Plane support === */ |
@@ -266,10 +267,10 @@ static int armada_ovl_plane_disable(struct drm_plane *plane) | |||
266 | struct drm_framebuffer *fb; | 267 | struct drm_framebuffer *fb; |
267 | struct armada_crtc *dcrtc; | 268 | struct armada_crtc *dcrtc; |
268 | 269 | ||
269 | if (!dplane->base.crtc) | 270 | if (!dplane->base.base.crtc) |
270 | return 0; | 271 | return 0; |
271 | 272 | ||
272 | dcrtc = drm_to_armada_crtc(dplane->base.crtc); | 273 | dcrtc = drm_to_armada_crtc(dplane->base.base.crtc); |
273 | dcrtc->plane = NULL; | 274 | dcrtc->plane = NULL; |
274 | 275 | ||
275 | spin_lock_irq(&dcrtc->irq_lock); | 276 | spin_lock_irq(&dcrtc->irq_lock); |
@@ -362,9 +363,9 @@ static int armada_ovl_plane_set_property(struct drm_plane *plane, | |||
362 | update_attr = true; | 363 | update_attr = true; |
363 | } | 364 | } |
364 | 365 | ||
365 | if (update_attr && dplane->base.crtc) | 366 | if (update_attr && dplane->base.base.crtc) |
366 | armada_ovl_update_attr(&dplane->prop, | 367 | armada_ovl_update_attr(&dplane->prop, |
367 | drm_to_armada_crtc(dplane->base.crtc)); | 368 | drm_to_armada_crtc(dplane->base.base.crtc)); |
368 | 369 | ||
369 | return 0; | 370 | return 0; |
370 | } | 371 | } |
@@ -461,7 +462,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) | |||
461 | armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl, | 462 | armada_drm_vbl_event_init(&dplane->vbl.update, armada_ovl_plane_vbl, |
462 | dplane); | 463 | dplane); |
463 | 464 | ||
464 | ret = drm_universal_plane_init(dev, &dplane->base, crtcs, | 465 | ret = drm_universal_plane_init(dev, &dplane->base.base, crtcs, |
465 | &armada_ovl_plane_funcs, | 466 | &armada_ovl_plane_funcs, |
466 | armada_ovl_formats, | 467 | armada_ovl_formats, |
467 | ARRAY_SIZE(armada_ovl_formats), | 468 | ARRAY_SIZE(armada_ovl_formats), |
@@ -479,7 +480,7 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs) | |||
479 | dplane->prop.contrast = 0x4000; | 480 | dplane->prop.contrast = 0x4000; |
480 | dplane->prop.saturation = 0x4000; | 481 | dplane->prop.saturation = 0x4000; |
481 | 482 | ||
482 | mobj = &dplane->base.base; | 483 | mobj = &dplane->base.base.base; |
483 | drm_object_attach_property(mobj, priv->colorkey_prop, | 484 | drm_object_attach_property(mobj, priv->colorkey_prop, |
484 | 0x0101fe); | 485 | 0x0101fe); |
485 | drm_object_attach_property(mobj, priv->colorkey_min_prop, | 486 | drm_object_attach_property(mobj, priv->colorkey_min_prop, |