aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_plane.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_plane.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c
index 8ad5b7294eb4..4014c746a534 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_plane.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c
@@ -92,7 +92,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
92 uint32_t src_w, uint32_t src_h) 92 uint32_t src_w, uint32_t src_h)
93{ 93{
94 struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 94 struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
95 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
96 unsigned int actual_w; 95 unsigned int actual_w;
97 unsigned int actual_h; 96 unsigned int actual_h;
98 97
@@ -139,9 +138,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
139 exynos_plane->crtc_width, exynos_plane->crtc_height); 138 exynos_plane->crtc_width, exynos_plane->crtc_height);
140 139
141 plane->crtc = crtc; 140 plane->crtc = crtc;
142
143 if (exynos_crtc->ops->win_mode_set)
144 exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane);
145} 141}
146 142
147int 143int
@@ -184,11 +180,8 @@ static int exynos_disable_plane(struct drm_plane *plane)
184 180
185static void exynos_plane_destroy(struct drm_plane *plane) 181static void exynos_plane_destroy(struct drm_plane *plane)
186{ 182{
187 struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
188
189 exynos_disable_plane(plane); 183 exynos_disable_plane(plane);
190 drm_plane_cleanup(plane); 184 drm_plane_cleanup(plane);
191 kfree(exynos_plane);
192} 185}
193 186
194static int exynos_plane_set_property(struct drm_plane *plane, 187static int exynos_plane_set_property(struct drm_plane *plane,
@@ -233,24 +226,18 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane)
233 drm_object_attach_property(&plane->base, prop, 0); 226 drm_object_attach_property(&plane->base, prop, 0);
234} 227}
235 228
236struct drm_plane *exynos_plane_init(struct drm_device *dev, 229int exynos_plane_init(struct drm_device *dev,
237 unsigned long possible_crtcs, 230 struct exynos_drm_plane *exynos_plane,
238 enum drm_plane_type type) 231 unsigned long possible_crtcs, enum drm_plane_type type)
239{ 232{
240 struct exynos_drm_plane *exynos_plane;
241 int err; 233 int err;
242 234
243 exynos_plane = kzalloc(sizeof(struct exynos_drm_plane), GFP_KERNEL);
244 if (!exynos_plane)
245 return ERR_PTR(-ENOMEM);
246
247 err = drm_universal_plane_init(dev, &exynos_plane->base, possible_crtcs, 235 err = drm_universal_plane_init(dev, &exynos_plane->base, possible_crtcs,
248 &exynos_plane_funcs, formats, 236 &exynos_plane_funcs, formats,
249 ARRAY_SIZE(formats), type); 237 ARRAY_SIZE(formats), type);
250 if (err) { 238 if (err) {
251 DRM_ERROR("failed to initialize plane\n"); 239 DRM_ERROR("failed to initialize plane\n");
252 kfree(exynos_plane); 240 return err;
253 return ERR_PTR(err);
254 } 241 }
255 242
256 if (type == DRM_PLANE_TYPE_PRIMARY) 243 if (type == DRM_PLANE_TYPE_PRIMARY)
@@ -258,5 +245,5 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
258 else 245 else
259 exynos_plane_attach_zpos_property(&exynos_plane->base); 246 exynos_plane_attach_zpos_property(&exynos_plane->base);
260 247
261 return &exynos_plane->base; 248 return 0;
262} 249}