summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_plane.c
diff options
context:
space:
mode:
authorJoonyoung Shim <jy0922.shim@samsung.com>2012-06-27 14:27:04 +0900
committerInki Dae <inki.dae@samsung.com>2012-07-27 11:13:53 +0900
commitb5d2eb3bd691c0b6869a2013e719a61c595d73a6 (patch)
treec1be0c9c1e72ccfc64c4c971a8d01babc7a22cbc /drivers/gpu/drm/exynos/exynos_drm_plane.c
parentfdc575e79508df9ffb85e99b92a213316a795599 (diff)
drm/exynos: use private plane for crtc
The crtc can use private plane instead it has overlay struct. It will be helpful use plane feature from crtc later. 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>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 17510f54e4a7..9ef5b8c42d3e 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -12,8 +12,8 @@
#include "drmP.h"
#include "exynos_drm.h"
-#include "exynos_drm_crtc.h"
#include "exynos_drm_drv.h"
+#include "exynos_drm_crtc.h"
#include "exynos_drm_encoder.h"
#define to_exynos_plane(x) container_of(x, struct exynos_plane, base)
@@ -108,23 +108,30 @@ static struct drm_plane_funcs exynos_plane_funcs = {
.destroy = exynos_plane_destroy,
};
-int exynos_plane_init(struct drm_device *dev, unsigned int nr)
+struct drm_plane *exynos_plane_init(struct drm_device *dev,
+ unsigned int possible_crtcs, bool priv)
{
struct exynos_plane *exynos_plane;
- uint32_t possible_crtcs;
+ int err;
exynos_plane = kzalloc(sizeof(struct exynos_plane), GFP_KERNEL);
- if (!exynos_plane)
- return -ENOMEM;
-
- /* all CRTCs are available */
- possible_crtcs = (1 << MAX_CRTC) - 1;
+ if (!exynos_plane) {
+ DRM_ERROR("failed to allocate plane\n");
+ return NULL;
+ }
exynos_plane->overlay.zpos = DEFAULT_ZPOS;
- return drm_plane_init(dev, &exynos_plane->base, possible_crtcs,
+ err = drm_plane_init(dev, &exynos_plane->base, possible_crtcs,
&exynos_plane_funcs, formats, ARRAY_SIZE(formats),
- false);
+ priv);
+ if (err) {
+ DRM_ERROR("failed to initialize plane\n");
+ kfree(exynos_plane);
+ return NULL;
+ }
+
+ return &exynos_plane->base;
}
int exynos_plane_set_zpos_ioctl(struct drm_device *dev, void *data,
@@ -168,3 +175,10 @@ out:
mutex_unlock(&dev->mode_config.mutex);
return ret;
}
+
+struct exynos_drm_overlay *get_exynos_drm_overlay(struct drm_plane *plane)
+{
+ struct exynos_plane *exynos_plane = to_exynos_plane(plane);
+
+ return &exynos_plane->overlay;
+}