blob: b0f0365efd235f570c1fd006fc8707f596e8a6fd [file] [log] [blame]
Liviu Dudauad49f862016-03-07 10:00:53 +00001/*
2 * (C) COPYRIGHT 2016 ARM Limited. All rights reserved.
3 * Author: Liviu Dudau <Liviu.Dudau@arm.com>
4 *
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
8 * of such GNU licence.
9 *
10 * ARM Mali DP500/DP550/DP650 driver (crtc operations)
11 */
12
13#include <drm/drmP.h>
14#include <drm/drm_atomic.h>
15#include <drm/drm_atomic_helper.h>
16#include <drm/drm_crtc.h>
17#include <drm/drm_crtc_helper.h>
18#include <linux/clk.h>
Liviu Dudau85f64212017-03-22 10:44:57 +000019#include <linux/pm_runtime.h>
Liviu Dudauad49f862016-03-07 10:00:53 +000020#include <video/videomode.h>
21
22#include "malidp_drv.h"
23#include "malidp_hw.h"
24
25static bool malidp_crtc_mode_fixup(struct drm_crtc *crtc,
26 const struct drm_display_mode *mode,
27 struct drm_display_mode *adjusted_mode)
28{
29 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
30 struct malidp_hw_device *hwdev = malidp->dev;
31
32 /*
33 * check that the hardware can drive the required clock rate,
34 * but skip the check if the clock is meant to be disabled (req_rate = 0)
35 */
36 long rate, req_rate = mode->crtc_clock * 1000;
37
38 if (req_rate) {
39 rate = clk_round_rate(hwdev->mclk, req_rate);
40 if (rate < req_rate) {
41 DRM_DEBUG_DRIVER("mclk clock unable to reach %d kHz\n",
42 mode->crtc_clock);
43 return false;
44 }
45
46 rate = clk_round_rate(hwdev->pxlclk, req_rate);
47 if (rate != req_rate) {
48 DRM_DEBUG_DRIVER("pxlclk doesn't support %ld Hz\n",
49 req_rate);
50 return false;
51 }
52 }
53
54 return true;
55}
56
57static void malidp_crtc_enable(struct drm_crtc *crtc)
58{
59 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
60 struct malidp_hw_device *hwdev = malidp->dev;
61 struct videomode vm;
Liviu Dudau85f64212017-03-22 10:44:57 +000062 int err = pm_runtime_get_sync(crtc->dev->dev);
63
64 if (err < 0) {
65 DRM_DEBUG_DRIVER("Failed to enable runtime power management: %d\n", err);
66 return;
67 }
Liviu Dudauad49f862016-03-07 10:00:53 +000068
69 drm_display_mode_to_videomode(&crtc->state->adjusted_mode, &vm);
Liviu Dudauad49f862016-03-07 10:00:53 +000070 clk_prepare_enable(hwdev->pxlclk);
71
Mihail Atanassov9a8b0a22017-02-15 14:00:15 +000072 /* We rely on firmware to set mclk to a sensible level. */
Liviu Dudauad49f862016-03-07 10:00:53 +000073 clk_set_rate(hwdev->pxlclk, crtc->state->adjusted_mode.crtc_clock * 1000);
74
75 hwdev->modeset(hwdev, &vm);
76 hwdev->leave_config_mode(hwdev);
77 drm_crtc_vblank_on(crtc);
78}
79
80static void malidp_crtc_disable(struct drm_crtc *crtc)
81{
82 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
83 struct malidp_hw_device *hwdev = malidp->dev;
Liviu Dudau85f64212017-03-22 10:44:57 +000084 int err;
Liviu Dudauad49f862016-03-07 10:00:53 +000085
86 drm_crtc_vblank_off(crtc);
87 hwdev->enter_config_mode(hwdev);
88 clk_disable_unprepare(hwdev->pxlclk);
Liviu Dudau85f64212017-03-22 10:44:57 +000089
90 err = pm_runtime_put(crtc->dev->dev);
91 if (err < 0) {
92 DRM_DEBUG_DRIVER("Failed to disable runtime power management: %d\n", err);
93 }
Liviu Dudauad49f862016-03-07 10:00:53 +000094}
95
Mihail Atanassov02725d32017-02-01 14:48:50 +000096static const struct gamma_curve_segment {
97 u16 start;
98 u16 end;
99} segments[MALIDP_COEFFTAB_NUM_COEFFS] = {
100 /* sector 0 */
101 { 0, 0 }, { 1, 1 }, { 2, 2 }, { 3, 3 },
102 { 4, 4 }, { 5, 5 }, { 6, 6 }, { 7, 7 },
103 { 8, 8 }, { 9, 9 }, { 10, 10 }, { 11, 11 },
104 { 12, 12 }, { 13, 13 }, { 14, 14 }, { 15, 15 },
105 /* sector 1 */
106 { 16, 19 }, { 20, 23 }, { 24, 27 }, { 28, 31 },
107 /* sector 2 */
108 { 32, 39 }, { 40, 47 }, { 48, 55 }, { 56, 63 },
109 /* sector 3 */
110 { 64, 79 }, { 80, 95 }, { 96, 111 }, { 112, 127 },
111 /* sector 4 */
112 { 128, 159 }, { 160, 191 }, { 192, 223 }, { 224, 255 },
113 /* sector 5 */
114 { 256, 319 }, { 320, 383 }, { 384, 447 }, { 448, 511 },
115 /* sector 6 */
116 { 512, 639 }, { 640, 767 }, { 768, 895 }, { 896, 1023 },
117 { 1024, 1151 }, { 1152, 1279 }, { 1280, 1407 }, { 1408, 1535 },
118 { 1536, 1663 }, { 1664, 1791 }, { 1792, 1919 }, { 1920, 2047 },
119 { 2048, 2175 }, { 2176, 2303 }, { 2304, 2431 }, { 2432, 2559 },
120 { 2560, 2687 }, { 2688, 2815 }, { 2816, 2943 }, { 2944, 3071 },
121 { 3072, 3199 }, { 3200, 3327 }, { 3328, 3455 }, { 3456, 3583 },
122 { 3584, 3711 }, { 3712, 3839 }, { 3840, 3967 }, { 3968, 4095 },
123};
124
125#define DE_COEFTAB_DATA(a, b) ((((a) & 0xfff) << 16) | (((b) & 0xfff)))
126
127static void malidp_generate_gamma_table(struct drm_property_blob *lut_blob,
128 u32 coeffs[MALIDP_COEFFTAB_NUM_COEFFS])
129{
130 struct drm_color_lut *lut = (struct drm_color_lut *)lut_blob->data;
131 int i;
132
133 for (i = 0; i < MALIDP_COEFFTAB_NUM_COEFFS; ++i) {
134 u32 a, b, delta_in, out_start, out_end;
135
136 delta_in = segments[i].end - segments[i].start;
137 /* DP has 12-bit internal precision for its LUTs. */
138 out_start = drm_color_lut_extract(lut[segments[i].start].green,
139 12);
140 out_end = drm_color_lut_extract(lut[segments[i].end].green, 12);
141 a = (delta_in == 0) ? 0 : ((out_end - out_start) * 256) / delta_in;
142 b = out_start;
143 coeffs[i] = DE_COEFTAB_DATA(a, b);
144 }
145}
146
147/*
148 * Check if there is a new gamma LUT and if it is of an acceptable size. Also,
149 * reject any LUTs that use distinct red, green, and blue curves.
150 */
151static int malidp_crtc_atomic_check_gamma(struct drm_crtc *crtc,
152 struct drm_crtc_state *state)
153{
154 struct malidp_crtc_state *mc = to_malidp_crtc_state(state);
155 struct drm_color_lut *lut;
156 size_t lut_size;
157 int i;
158
159 if (!state->color_mgmt_changed || !state->gamma_lut)
160 return 0;
161
162 if (crtc->state->gamma_lut &&
163 (crtc->state->gamma_lut->base.id == state->gamma_lut->base.id))
164 return 0;
165
166 if (state->gamma_lut->length % sizeof(struct drm_color_lut))
167 return -EINVAL;
168
169 lut_size = state->gamma_lut->length / sizeof(struct drm_color_lut);
170 if (lut_size != MALIDP_GAMMA_LUT_SIZE)
171 return -EINVAL;
172
173 lut = (struct drm_color_lut *)state->gamma_lut->data;
174 for (i = 0; i < lut_size; ++i)
175 if (!((lut[i].red == lut[i].green) &&
176 (lut[i].red == lut[i].blue)))
177 return -EINVAL;
178
179 if (!state->mode_changed) {
180 int ret;
181
182 state->mode_changed = true;
183 /*
184 * Kerneldoc for drm_atomic_helper_check_modeset mandates that
185 * it be invoked when the driver sets ->mode_changed. Since
186 * changing the gamma LUT doesn't depend on any external
187 * resources, it is safe to call it only once.
188 */
189 ret = drm_atomic_helper_check_modeset(crtc->dev, state->state);
190 if (ret)
191 return ret;
192 }
193
194 malidp_generate_gamma_table(state->gamma_lut, mc->gamma_coeffs);
195 return 0;
196}
197
Mihail Atanassov6954f242017-02-13 12:49:03 +0000198/*
199 * Check if there is a new CTM and if it contains valid input. Valid here means
200 * that the number is inside the representable range for a Q3.12 number,
201 * excluding truncating the fractional part of the input data.
202 *
203 * The COLORADJ registers can be changed atomically.
204 */
205static int malidp_crtc_atomic_check_ctm(struct drm_crtc *crtc,
206 struct drm_crtc_state *state)
207{
208 struct malidp_crtc_state *mc = to_malidp_crtc_state(state);
209 struct drm_color_ctm *ctm;
210 int i;
211
212 if (!state->color_mgmt_changed)
213 return 0;
214
215 if (!state->ctm)
216 return 0;
217
218 if (crtc->state->ctm && (crtc->state->ctm->base.id ==
219 state->ctm->base.id))
220 return 0;
221
222 /*
223 * The size of the ctm is checked in
224 * drm_atomic_replace_property_blob_from_id.
225 */
226 ctm = (struct drm_color_ctm *)state->ctm->data;
227 for (i = 0; i < ARRAY_SIZE(ctm->matrix); ++i) {
228 /* Convert from S31.32 to Q3.12. */
229 s64 val = ctm->matrix[i];
230 u32 mag = ((((u64)val) & ~BIT_ULL(63)) >> 20) &
231 GENMASK_ULL(14, 0);
232
233 /*
234 * Convert to 2s complement and check the destination's top bit
235 * for overflow. NB: Can't check before converting or it'd
236 * incorrectly reject the case:
237 * sign == 1
238 * mag == 0x2000
239 */
240 if (val & BIT_ULL(63))
241 mag = ~mag + 1;
242 if (!!(val & BIT_ULL(63)) != !!(mag & BIT(14)))
243 return -EINVAL;
244 mc->coloradj_coeffs[i] = mag;
245 }
246
247 return 0;
248}
249
Mihail Atanassov28ce6752017-02-13 15:14:05 +0000250static int malidp_crtc_atomic_check_scaling(struct drm_crtc *crtc,
251 struct drm_crtc_state *state)
252{
253 struct malidp_crtc_state *cs = to_malidp_crtc_state(state);
254 struct malidp_se_config *s = &cs->scaler_config;
255 struct drm_plane *plane;
256 const struct drm_plane_state *pstate;
257 u32 h_upscale_factor = 0; /* U16.16 */
258 u32 v_upscale_factor = 0; /* U16.16 */
259 u8 scaling = cs->scaled_planes_mask;
260
261 if (!scaling) {
262 s->scale_enable = false;
263 return 0;
264 }
265
266 /* The scaling engine can only handle one plane at a time. */
267 if (scaling & (scaling - 1))
268 return -EINVAL;
269
270 drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
271 struct malidp_plane *mp = to_malidp_plane(plane);
272 u64 crtc_w, crtc_h;
273 u32 phase;
274
275 if (!(mp->layer->id & scaling))
276 continue;
277
278 /*
279 * Convert crtc_[w|h] to U32.32, then divide by U16.16 src_[w|h]
280 * to get the U16.16 result.
281 */
282 crtc_w = (u64)pstate->crtc_w << 32;
283 crtc_h = (u64)pstate->crtc_h << 32;
284 h_upscale_factor = (u32)(crtc_w / pstate->src_w);
285 v_upscale_factor = (u32)(crtc_h / pstate->src_h);
286
287 /* Downscaling won't work when mclk == pxlclk. */
288 if (!(h_upscale_factor >> 16) || !(v_upscale_factor >> 16))
289 return -EINVAL;
290
Mihail Atanassov0274e6a2017-02-06 12:20:56 +0000291 s->enhancer_enable = ((h_upscale_factor >> 16) >= 2 ||
292 (v_upscale_factor >> 16) >= 2);
293
Mihail Atanassov28ce6752017-02-13 15:14:05 +0000294 s->input_w = pstate->src_w >> 16;
295 s->input_h = pstate->src_h >> 16;
296 s->output_w = pstate->crtc_w;
297 s->output_h = pstate->crtc_h;
298
299#define SE_N_PHASE 4
300#define SE_SHIFT_N_PHASE 12
301 /* Calculate initial_phase and delta_phase for horizontal. */
302 phase = s->input_w;
303 s->h_init_phase =
304 ((phase << SE_N_PHASE) / s->output_w + 1) / 2;
305
306 phase = s->input_w;
307 phase <<= (SE_SHIFT_N_PHASE + SE_N_PHASE);
308 s->h_delta_phase = phase / s->output_w;
309
310 /* Same for vertical. */
311 phase = s->input_h;
312 s->v_init_phase =
313 ((phase << SE_N_PHASE) / s->output_h + 1) / 2;
314
315 phase = s->input_h;
316 phase <<= (SE_SHIFT_N_PHASE + SE_N_PHASE);
317 s->v_delta_phase = phase / s->output_h;
318#undef SE_N_PHASE
319#undef SE_SHIFT_N_PHASE
320 s->plane_src_id = mp->layer->id;
321 }
322
323 s->scale_enable = true;
324 s->hcoeff = malidp_se_select_coeffs(h_upscale_factor);
325 s->vcoeff = malidp_se_select_coeffs(v_upscale_factor);
326 return 0;
327}
328
Liviu Dudauad49f862016-03-07 10:00:53 +0000329static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
330 struct drm_crtc_state *state)
331{
332 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
333 struct malidp_hw_device *hwdev = malidp->dev;
334 struct drm_plane *plane;
335 const struct drm_plane_state *pstate;
336 u32 rot_mem_free, rot_mem_usable;
337 int rotated_planes = 0;
Mihail Atanassov6954f242017-02-13 12:49:03 +0000338 int ret;
Liviu Dudauad49f862016-03-07 10:00:53 +0000339
340 /*
341 * check if there is enough rotation memory available for planes
342 * that need 90° and 270° rotation. Each plane has set its required
343 * memory size in the ->plane_check() callback, here we only make
344 * sure that the sums are less that the total usable memory.
345 *
346 * The rotation memory allocation algorithm (for each plane):
347 * a. If no more rotated planes exist, all remaining rotate
348 * memory in the bank is available for use by the plane.
349 * b. If other rotated planes exist, and plane's layer ID is
350 * DE_VIDEO1, it can use all the memory from first bank if
351 * secondary rotation memory bank is available, otherwise it can
352 * use up to half the bank's memory.
353 * c. If other rotated planes exist, and plane's layer ID is not
354 * DE_VIDEO1, it can use half of the available memory
355 *
356 * Note: this algorithm assumes that the order in which the planes are
357 * checked always has DE_VIDEO1 plane first in the list if it is
358 * rotated. Because that is how we create the planes in the first
359 * place, under current DRM version things work, but if ever the order
360 * in which drm_atomic_crtc_state_for_each_plane() iterates over planes
361 * changes, we need to pre-sort the planes before validation.
362 */
363
364 /* first count the number of rotated planes */
365 drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
366 if (pstate->rotation & MALIDP_ROTATED_MASK)
367 rotated_planes++;
368 }
369
370 rot_mem_free = hwdev->rotation_memory[0];
371 /*
372 * if we have more than 1 plane using rotation memory, use the second
373 * block of rotation memory as well
374 */
375 if (rotated_planes > 1)
376 rot_mem_free += hwdev->rotation_memory[1];
377
378 /* now validate the rotation memory requirements */
379 drm_atomic_crtc_state_for_each_plane_state(plane, pstate, state) {
380 struct malidp_plane *mp = to_malidp_plane(plane);
381 struct malidp_plane_state *ms = to_malidp_plane_state(pstate);
382
383 if (pstate->rotation & MALIDP_ROTATED_MASK) {
384 /* process current plane */
385 rotated_planes--;
386
387 if (!rotated_planes) {
388 /* no more rotated planes, we can use what's left */
389 rot_mem_usable = rot_mem_free;
390 } else {
391 if ((mp->layer->id != DE_VIDEO1) ||
392 (hwdev->rotation_memory[1] == 0))
393 rot_mem_usable = rot_mem_free / 2;
394 else
395 rot_mem_usable = hwdev->rotation_memory[0];
396 }
397
398 rot_mem_free -= rot_mem_usable;
399
400 if (ms->rotmem_size > rot_mem_usable)
401 return -EINVAL;
402 }
403 }
404
Mihail Atanassov6954f242017-02-13 12:49:03 +0000405 ret = malidp_crtc_atomic_check_gamma(crtc, state);
406 ret = ret ? ret : malidp_crtc_atomic_check_ctm(crtc, state);
Mihail Atanassov28ce6752017-02-13 15:14:05 +0000407 ret = ret ? ret : malidp_crtc_atomic_check_scaling(crtc, state);
Mihail Atanassov6954f242017-02-13 12:49:03 +0000408
409 return ret;
Liviu Dudauad49f862016-03-07 10:00:53 +0000410}
411
412static const struct drm_crtc_helper_funcs malidp_crtc_helper_funcs = {
413 .mode_fixup = malidp_crtc_mode_fixup,
414 .enable = malidp_crtc_enable,
415 .disable = malidp_crtc_disable,
416 .atomic_check = malidp_crtc_atomic_check,
417};
418
Mihail Atanassov99665d02017-02-01 14:48:49 +0000419static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc)
420{
Mihail Atanassov02725d32017-02-01 14:48:50 +0000421 struct malidp_crtc_state *state, *old_state;
Mihail Atanassov99665d02017-02-01 14:48:49 +0000422
423 if (WARN_ON(!crtc->state))
424 return NULL;
425
Mihail Atanassov02725d32017-02-01 14:48:50 +0000426 old_state = to_malidp_crtc_state(crtc->state);
Mihail Atanassov99665d02017-02-01 14:48:49 +0000427 state = kmalloc(sizeof(*state), GFP_KERNEL);
428 if (!state)
429 return NULL;
430
431 __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base);
Mihail Atanassov02725d32017-02-01 14:48:50 +0000432 memcpy(state->gamma_coeffs, old_state->gamma_coeffs,
433 sizeof(state->gamma_coeffs));
Mihail Atanassov6954f242017-02-13 12:49:03 +0000434 memcpy(state->coloradj_coeffs, old_state->coloradj_coeffs,
435 sizeof(state->coloradj_coeffs));
Mihail Atanassov28ce6752017-02-13 15:14:05 +0000436 memcpy(&state->scaler_config, &old_state->scaler_config,
437 sizeof(state->scaler_config));
438 state->scaled_planes_mask = 0;
Mihail Atanassov99665d02017-02-01 14:48:49 +0000439
440 return &state->base;
441}
442
443static void malidp_crtc_reset(struct drm_crtc *crtc)
444{
445 struct malidp_crtc_state *state = NULL;
446
447 if (crtc->state) {
448 state = to_malidp_crtc_state(crtc->state);
449 __drm_atomic_helper_crtc_destroy_state(crtc->state);
450 }
451
452 kfree(state);
453 state = kzalloc(sizeof(*state), GFP_KERNEL);
454 if (state) {
455 crtc->state = &state->base;
456 crtc->state->crtc = crtc;
457 }
458}
459
460static void malidp_crtc_destroy_state(struct drm_crtc *crtc,
461 struct drm_crtc_state *state)
462{
463 struct malidp_crtc_state *mali_state = NULL;
464
465 if (state) {
466 mali_state = to_malidp_crtc_state(state);
467 __drm_atomic_helper_crtc_destroy_state(state);
468 }
469
470 kfree(mali_state);
471}
472
Shawn Guod7ae94b2017-02-07 17:16:17 +0800473static int malidp_crtc_enable_vblank(struct drm_crtc *crtc)
474{
475 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
476 struct malidp_hw_device *hwdev = malidp->dev;
477
478 malidp_hw_enable_irq(hwdev, MALIDP_DE_BLOCK,
479 hwdev->map.de_irq_map.vsync_irq);
480 return 0;
481}
482
483static void malidp_crtc_disable_vblank(struct drm_crtc *crtc)
484{
485 struct malidp_drm *malidp = crtc_to_malidp_device(crtc);
486 struct malidp_hw_device *hwdev = malidp->dev;
487
488 malidp_hw_disable_irq(hwdev, MALIDP_DE_BLOCK,
489 hwdev->map.de_irq_map.vsync_irq);
490}
491
Liviu Dudauad49f862016-03-07 10:00:53 +0000492static const struct drm_crtc_funcs malidp_crtc_funcs = {
Mihail Atanassov02725d32017-02-01 14:48:50 +0000493 .gamma_set = drm_atomic_helper_legacy_gamma_set,
Liviu Dudauad49f862016-03-07 10:00:53 +0000494 .destroy = drm_crtc_cleanup,
495 .set_config = drm_atomic_helper_set_config,
496 .page_flip = drm_atomic_helper_page_flip,
Mihail Atanassov99665d02017-02-01 14:48:49 +0000497 .reset = malidp_crtc_reset,
498 .atomic_duplicate_state = malidp_crtc_duplicate_state,
499 .atomic_destroy_state = malidp_crtc_destroy_state,
Shawn Guod7ae94b2017-02-07 17:16:17 +0800500 .enable_vblank = malidp_crtc_enable_vblank,
501 .disable_vblank = malidp_crtc_disable_vblank,
Liviu Dudauad49f862016-03-07 10:00:53 +0000502};
503
504int malidp_crtc_init(struct drm_device *drm)
505{
506 struct malidp_drm *malidp = drm->dev_private;
507 struct drm_plane *primary = NULL, *plane;
508 int ret;
509
510 ret = malidp_de_planes_init(drm);
511 if (ret < 0) {
512 DRM_ERROR("Failed to initialise planes\n");
513 return ret;
514 }
515
516 drm_for_each_plane(plane, drm) {
517 if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
518 primary = plane;
519 break;
520 }
521 }
522
523 if (!primary) {
524 DRM_ERROR("no primary plane found\n");
525 ret = -EINVAL;
526 goto crtc_cleanup_planes;
527 }
528
529 ret = drm_crtc_init_with_planes(drm, &malidp->crtc, primary, NULL,
530 &malidp_crtc_funcs, NULL);
Mihail Atanassov02725d32017-02-01 14:48:50 +0000531 if (ret)
532 goto crtc_cleanup_planes;
Liviu Dudauad49f862016-03-07 10:00:53 +0000533
Mihail Atanassov02725d32017-02-01 14:48:50 +0000534 drm_crtc_helper_add(&malidp->crtc, &malidp_crtc_helper_funcs);
535 drm_mode_crtc_set_gamma_size(&malidp->crtc, MALIDP_GAMMA_LUT_SIZE);
Mihail Atanassov0274e6a2017-02-06 12:20:56 +0000536 /* No inverse-gamma: it is per-plane. */
Mihail Atanassov6954f242017-02-13 12:49:03 +0000537 drm_crtc_enable_color_mgmt(&malidp->crtc, 0, true, MALIDP_GAMMA_LUT_SIZE);
Mihail Atanassov02725d32017-02-01 14:48:50 +0000538
Mihail Atanassov0274e6a2017-02-06 12:20:56 +0000539 malidp_se_set_enh_coeffs(malidp->dev);
540
Mihail Atanassov02725d32017-02-01 14:48:50 +0000541 return 0;
Liviu Dudauad49f862016-03-07 10:00:53 +0000542
543crtc_cleanup_planes:
544 malidp_de_planes_destroy(drm);
545
546 return ret;
547}