aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2012-06-27 01:27:03 -0400
committerInki Dae <inki.dae@samsung.com>2012-07-26 22:13:53 -0400
commitfdc575e79508df9ffb85e99b92a213316a795599 (patch)
treea00c39853adc363e3c461caf20698c8f01ce7742
parentd249ce024bf6da9cc26cbd236aca25a22cbbe36e (diff)
drm/exynos: define to_exynos_plane macro
Add macro to get struct exynos_plane from struct drm_plane pointer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index c4c6525d4653..17510f54e4a7 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -16,6 +16,8 @@
16#include "exynos_drm_drv.h" 16#include "exynos_drm_drv.h"
17#include "exynos_drm_encoder.h" 17#include "exynos_drm_encoder.h"
18 18
19#define to_exynos_plane(x) container_of(x, struct exynos_plane, base)
20
19struct exynos_plane { 21struct exynos_plane {
20 struct drm_plane base; 22 struct drm_plane base;
21 struct exynos_drm_overlay overlay; 23 struct exynos_drm_overlay overlay;
@@ -37,8 +39,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
37 uint32_t src_x, uint32_t src_y, 39 uint32_t src_x, uint32_t src_y,
38 uint32_t src_w, uint32_t src_h) 40 uint32_t src_w, uint32_t src_h)
39{ 41{
40 struct exynos_plane *exynos_plane = 42 struct exynos_plane *exynos_plane = to_exynos_plane(plane);
41 container_of(plane, struct exynos_plane, base);
42 struct exynos_drm_overlay *overlay = &exynos_plane->overlay; 43 struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
43 struct exynos_drm_crtc_pos pos; 44 struct exynos_drm_crtc_pos pos;
44 int ret; 45 int ret;
@@ -73,8 +74,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
73 74
74static int exynos_disable_plane(struct drm_plane *plane) 75static int exynos_disable_plane(struct drm_plane *plane)
75{ 76{
76 struct exynos_plane *exynos_plane = 77 struct exynos_plane *exynos_plane = to_exynos_plane(plane);
77 container_of(plane, struct exynos_plane, base);
78 struct exynos_drm_overlay *overlay = &exynos_plane->overlay; 78 struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
79 79
80 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 80 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
@@ -93,8 +93,7 @@ static int exynos_disable_plane(struct drm_plane *plane)
93 93
94static void exynos_plane_destroy(struct drm_plane *plane) 94static void exynos_plane_destroy(struct drm_plane *plane)
95{ 95{
96 struct exynos_plane *exynos_plane = 96 struct exynos_plane *exynos_plane = to_exynos_plane(plane);
97 container_of(plane, struct exynos_plane, base);
98 97
99 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); 98 DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
100 99
@@ -161,7 +160,7 @@ int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data,
161 } 160 }
162 161
163 plane = obj_to_plane(obj); 162 plane = obj_to_plane(obj);
164 exynos_plane = container_of(plane, struct exynos_plane, base); 163 exynos_plane = to_exynos_plane(plane);
165 164
166 exynos_plane->overlay.zpos = zpos_req->zpos; 165 exynos_plane->overlay.zpos = zpos_req->zpos;
167 166