@@ -172,6 +172,16 @@ static const struct drm_crtc_funcs exynos_crtc_funcs = {
.disable_vblank = exynos_drm_crtc_disable_vblank,
};
+int exynos_drm_crtc_init(struct exynos_drm_crtc *exynos_crtc,
+ struct drm_device *drm_dev)
+{
+ struct drm_crtc *crtc = &exynos_crtc->base;
+
+ drm_crtc_helper_add(crtc, &exynos_crtc_helper_funcs);
+ return drm_crtc_init_with_planes(drm_dev, crtc, NULL, NULL,
+ &exynos_crtc_funcs, NULL);
+}
+
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
struct drm_plane *plane,
enum exynos_drm_output_type type,
@@ -18,6 +18,8 @@
#include "exynos_drm_drv.h"
+int exynos_drm_crtc_init(struct exynos_drm_crtc *exynos_crtc,
+ struct drm_device *drm_dev);
struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
struct drm_plane *plane,
enum exynos_drm_output_type out_type,
Since exynos_drm_crtc is a struct which maps 1:1 to underlying device it is better to put it directly into device's context instead of allocating it separately. Another benefit is possibility of initialisation of its fields directly, without expanding exynos_drm_crtc_create which is already overloaded with number of arguments. As a first step of the transition initialisation function should be created. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 10 ++++++++++ drivers/gpu/drm/exynos/exynos_drm_crtc.h | 2 ++ 2 files changed, 12 insertions(+)