Commit fdc575e7 authored by Joonyoung Shim's avatar Joonyoung Shim Committed by Inki Dae

drm/exynos: define to_exynos_plane macro

Add macro to get struct exynos_plane from struct drm_plane pointer.
Signed-off-by: default avatarJoonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent d249ce02
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "exynos_drm_drv.h" #include "exynos_drm_drv.h"
#include "exynos_drm_encoder.h" #include "exynos_drm_encoder.h"
#define to_exynos_plane(x) container_of(x, struct exynos_plane, base)
struct exynos_plane { struct exynos_plane {
struct drm_plane base; struct drm_plane base;
struct exynos_drm_overlay overlay; struct exynos_drm_overlay overlay;
...@@ -37,8 +39,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -37,8 +39,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
uint32_t src_x, uint32_t src_y, uint32_t src_x, uint32_t src_y,
uint32_t src_w, uint32_t src_h) uint32_t src_w, uint32_t src_h)
{ {
struct exynos_plane *exynos_plane = struct exynos_plane *exynos_plane = to_exynos_plane(plane);
container_of(plane, struct exynos_plane, base);
struct exynos_drm_overlay *overlay = &exynos_plane->overlay; struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
struct exynos_drm_crtc_pos pos; struct exynos_drm_crtc_pos pos;
int ret; int ret;
...@@ -73,8 +74,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, ...@@ -73,8 +74,7 @@ exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
static int exynos_disable_plane(struct drm_plane *plane) static int exynos_disable_plane(struct drm_plane *plane)
{ {
struct exynos_plane *exynos_plane = struct exynos_plane *exynos_plane = to_exynos_plane(plane);
container_of(plane, struct exynos_plane, base);
struct exynos_drm_overlay *overlay = &exynos_plane->overlay; struct exynos_drm_overlay *overlay = &exynos_plane->overlay;
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
...@@ -93,8 +93,7 @@ static int exynos_disable_plane(struct drm_plane *plane) ...@@ -93,8 +93,7 @@ static int exynos_disable_plane(struct drm_plane *plane)
static void exynos_plane_destroy(struct drm_plane *plane) static void exynos_plane_destroy(struct drm_plane *plane)
{ {
struct exynos_plane *exynos_plane = struct exynos_plane *exynos_plane = to_exynos_plane(plane);
container_of(plane, struct exynos_plane, base);
DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__);
...@@ -161,7 +160,7 @@ int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data, ...@@ -161,7 +160,7 @@ int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data,
} }
plane = obj_to_plane(obj); plane = obj_to_plane(obj);
exynos_plane = container_of(plane, struct exynos_plane, base); exynos_plane = to_exynos_plane(plane);
exynos_plane->overlay.zpos = zpos_req->zpos; exynos_plane->overlay.zpos = zpos_req->zpos;
......
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