1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright © 2018-2020 Intel Corporation
6 #include <drm/drm_atomic.h>
7 #include <drm/drm_atomic_helper.h>
8 #include <drm/drm_crtc.h>
9 #include <drm/drm_crtc_helper.h>
10 #include <drm/drm_fb_cma_helper.h>
11 #include <drm/drm_fb_helper.h>
12 #include <drm/drm_fourcc.h>
13 #include <drm/drm_gem_cma_helper.h>
14 #include <drm/drm_managed.h>
15 #include <drm/drm_plane_helper.h>
18 #include "kmb_plane.h"
21 const u32 layer_irqs[] = {
28 /* Conversion (yuv->rgb) matrix from myriadx */
29 static const u32 csc_coef_lcd[] = {
36 /* Graphics layer (layers 2 & 3) formats, only packed formats are supported */
37 static const u32 kmb_formats_g[] = {
39 DRM_FORMAT_XRGB4444, DRM_FORMAT_XBGR4444,
40 DRM_FORMAT_ARGB4444, DRM_FORMAT_ABGR4444,
41 DRM_FORMAT_XRGB1555, DRM_FORMAT_XBGR1555,
42 DRM_FORMAT_ARGB1555, DRM_FORMAT_ABGR1555,
43 DRM_FORMAT_RGB565, DRM_FORMAT_BGR565,
44 DRM_FORMAT_RGB888, DRM_FORMAT_BGR888,
45 DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888,
46 DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888,
49 /* Video layer ( 0 & 1) formats, packed and planar formats are supported */
50 static const u32 kmb_formats_v[] = {
53 DRM_FORMAT_XRGB4444, DRM_FORMAT_XBGR4444,
54 DRM_FORMAT_ARGB4444, DRM_FORMAT_ABGR4444,
55 DRM_FORMAT_XRGB1555, DRM_FORMAT_XBGR1555,
56 DRM_FORMAT_ARGB1555, DRM_FORMAT_ABGR1555,
57 DRM_FORMAT_RGB565, DRM_FORMAT_BGR565,
58 DRM_FORMAT_RGB888, DRM_FORMAT_BGR888,
59 DRM_FORMAT_XRGB8888, DRM_FORMAT_XBGR8888,
60 DRM_FORMAT_ARGB8888, DRM_FORMAT_ABGR8888,
62 DRM_FORMAT_YUV420, DRM_FORMAT_YVU420,
63 DRM_FORMAT_YUV422, DRM_FORMAT_YVU422,
64 DRM_FORMAT_YUV444, DRM_FORMAT_YVU444,
65 DRM_FORMAT_NV12, DRM_FORMAT_NV21,
68 static unsigned int check_pixel_format(struct drm_plane *plane, u32 format)
70 struct kmb_drm_private *kmb;
71 struct kmb_plane *kmb_plane = to_kmb_plane(plane);
73 int plane_id = kmb_plane->id;
74 struct disp_cfg init_disp_cfg;
76 kmb = to_kmb(plane->dev);
77 init_disp_cfg = kmb->init_disp_cfg[plane_id];
78 /* Due to HW limitations, changing pixel format after initial
79 * plane configuration is not supported.
81 if (init_disp_cfg.format && init_disp_cfg.format != format) {
82 drm_dbg(&kmb->drm, "Cannot change format after initial plane configuration");
85 for (i = 0; i < plane->format_count; i++) {
86 if (plane->format_types[i] == format)
92 static int kmb_plane_atomic_check(struct drm_plane *plane,
93 struct drm_atomic_state *state)
95 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
97 struct kmb_drm_private *kmb;
98 struct kmb_plane *kmb_plane = to_kmb_plane(plane);
99 int plane_id = kmb_plane->id;
100 struct disp_cfg init_disp_cfg;
101 struct drm_framebuffer *fb;
103 struct drm_crtc_state *crtc_state;
106 kmb = to_kmb(plane->dev);
107 init_disp_cfg = kmb->init_disp_cfg[plane_id];
108 fb = new_plane_state->fb;
109 if (!fb || !new_plane_state->crtc)
112 ret = check_pixel_format(plane, fb->format->format);
116 if (new_plane_state->crtc_w > KMB_FB_MAX_WIDTH ||
117 new_plane_state->crtc_h > KMB_FB_MAX_HEIGHT ||
118 new_plane_state->crtc_w < KMB_FB_MIN_WIDTH ||
119 new_plane_state->crtc_h < KMB_FB_MIN_HEIGHT)
122 /* Due to HW limitations, changing plane height or width after
123 * initial plane configuration is not supported.
125 if ((init_disp_cfg.width && init_disp_cfg.height) &&
126 (init_disp_cfg.width != fb->width ||
127 init_disp_cfg.height != fb->height)) {
128 drm_dbg(&kmb->drm, "Cannot change plane height or width after initial configuration");
131 can_position = (plane->type == DRM_PLANE_TYPE_OVERLAY);
133 drm_atomic_get_existing_crtc_state(state,
134 new_plane_state->crtc);
135 return drm_atomic_helper_check_plane_state(new_plane_state,
137 DRM_PLANE_HELPER_NO_SCALING,
138 DRM_PLANE_HELPER_NO_SCALING,
142 static void kmb_plane_atomic_disable(struct drm_plane *plane,
143 struct drm_atomic_state *state)
145 struct kmb_plane *kmb_plane = to_kmb_plane(plane);
146 int plane_id = kmb_plane->id;
147 struct kmb_drm_private *kmb;
149 kmb = to_kmb(plane->dev);
151 if (WARN_ON(plane_id >= KMB_MAX_PLANES))
156 kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL1_ENABLE;
159 kmb->plane_status[plane_id].ctrl = LCD_CTRL_VL2_ENABLE;
162 kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL1_ENABLE;
165 kmb->plane_status[plane_id].ctrl = LCD_CTRL_GL2_ENABLE;
169 kmb->plane_status[plane_id].disable = true;
172 static unsigned int get_pixel_format(u32 format)
174 unsigned int val = 0;
178 case DRM_FORMAT_YUV444:
179 val = LCD_LAYER_FORMAT_YCBCR444PLAN | LCD_LAYER_PLANAR_STORAGE;
181 case DRM_FORMAT_YVU444:
182 val = LCD_LAYER_FORMAT_YCBCR444PLAN | LCD_LAYER_PLANAR_STORAGE
183 | LCD_LAYER_CRCB_ORDER;
185 case DRM_FORMAT_YUV422:
186 val = LCD_LAYER_FORMAT_YCBCR422PLAN | LCD_LAYER_PLANAR_STORAGE;
188 case DRM_FORMAT_YVU422:
189 val = LCD_LAYER_FORMAT_YCBCR422PLAN | LCD_LAYER_PLANAR_STORAGE
190 | LCD_LAYER_CRCB_ORDER;
192 case DRM_FORMAT_YUV420:
193 val = LCD_LAYER_FORMAT_YCBCR420PLAN | LCD_LAYER_PLANAR_STORAGE;
195 case DRM_FORMAT_YVU420:
196 val = LCD_LAYER_FORMAT_YCBCR420PLAN | LCD_LAYER_PLANAR_STORAGE
197 | LCD_LAYER_CRCB_ORDER;
199 case DRM_FORMAT_NV12:
200 val = LCD_LAYER_FORMAT_NV12 | LCD_LAYER_PLANAR_STORAGE;
202 case DRM_FORMAT_NV21:
203 val = LCD_LAYER_FORMAT_NV12 | LCD_LAYER_PLANAR_STORAGE
204 | LCD_LAYER_CRCB_ORDER;
207 /* looks hw requires B & G to be swapped when RGB */
208 case DRM_FORMAT_RGB332:
209 val = LCD_LAYER_FORMAT_RGB332 | LCD_LAYER_BGR_ORDER;
211 case DRM_FORMAT_XBGR4444:
212 val = LCD_LAYER_FORMAT_RGBX4444;
214 case DRM_FORMAT_ARGB4444:
215 val = LCD_LAYER_FORMAT_RGBA4444 | LCD_LAYER_BGR_ORDER;
217 case DRM_FORMAT_ABGR4444:
218 val = LCD_LAYER_FORMAT_RGBA4444;
220 case DRM_FORMAT_XRGB1555:
221 val = LCD_LAYER_FORMAT_XRGB1555 | LCD_LAYER_BGR_ORDER;
223 case DRM_FORMAT_XBGR1555:
224 val = LCD_LAYER_FORMAT_XRGB1555;
226 case DRM_FORMAT_ARGB1555:
227 val = LCD_LAYER_FORMAT_RGBA1555 | LCD_LAYER_BGR_ORDER;
229 case DRM_FORMAT_ABGR1555:
230 val = LCD_LAYER_FORMAT_RGBA1555;
232 case DRM_FORMAT_RGB565:
233 val = LCD_LAYER_FORMAT_RGB565 | LCD_LAYER_BGR_ORDER;
235 case DRM_FORMAT_BGR565:
236 val = LCD_LAYER_FORMAT_RGB565;
238 case DRM_FORMAT_RGB888:
239 val = LCD_LAYER_FORMAT_RGB888 | LCD_LAYER_BGR_ORDER;
241 case DRM_FORMAT_BGR888:
242 val = LCD_LAYER_FORMAT_RGB888;
244 case DRM_FORMAT_XRGB8888:
245 val = LCD_LAYER_FORMAT_RGBX8888 | LCD_LAYER_BGR_ORDER;
247 case DRM_FORMAT_XBGR8888:
248 val = LCD_LAYER_FORMAT_RGBX8888;
250 case DRM_FORMAT_ARGB8888:
251 val = LCD_LAYER_FORMAT_RGBA8888 | LCD_LAYER_BGR_ORDER;
253 case DRM_FORMAT_ABGR8888:
254 val = LCD_LAYER_FORMAT_RGBA8888;
257 DRM_INFO_ONCE("%s : %d format=0x%x val=0x%x\n",
258 __func__, __LINE__, format, val);
262 static unsigned int get_bits_per_pixel(const struct drm_format_info *format)
265 unsigned int val = 0;
267 if (format->num_planes > 1) {
268 val = LCD_LAYER_8BPP;
272 bpp += 8 * format->cpp[0];
276 val = LCD_LAYER_8BPP;
279 val = LCD_LAYER_16BPP;
282 val = LCD_LAYER_24BPP;
285 val = LCD_LAYER_32BPP;
289 DRM_DEBUG("bpp=%d val=0x%x\n", bpp, val);
293 static void config_csc(struct kmb_drm_private *kmb, int plane_id)
295 /* YUV to RGB conversion using the fixed matrix csc_coef_lcd */
296 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF11(plane_id), csc_coef_lcd[0]);
297 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF12(plane_id), csc_coef_lcd[1]);
298 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF13(plane_id), csc_coef_lcd[2]);
299 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF21(plane_id), csc_coef_lcd[3]);
300 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF22(plane_id), csc_coef_lcd[4]);
301 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF23(plane_id), csc_coef_lcd[5]);
302 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF31(plane_id), csc_coef_lcd[6]);
303 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF32(plane_id), csc_coef_lcd[7]);
304 kmb_write_lcd(kmb, LCD_LAYERn_CSC_COEFF33(plane_id), csc_coef_lcd[8]);
305 kmb_write_lcd(kmb, LCD_LAYERn_CSC_OFF1(plane_id), csc_coef_lcd[9]);
306 kmb_write_lcd(kmb, LCD_LAYERn_CSC_OFF2(plane_id), csc_coef_lcd[10]);
307 kmb_write_lcd(kmb, LCD_LAYERn_CSC_OFF3(plane_id), csc_coef_lcd[11]);
310 static void kmb_plane_set_alpha(struct kmb_drm_private *kmb,
311 const struct drm_plane_state *state,
312 unsigned char plane_id,
315 u16 plane_alpha = state->alpha;
316 u16 pixel_blend_mode = state->pixel_blend_mode;
317 int has_alpha = state->fb->format->has_alpha;
319 if (plane_alpha != DRM_BLEND_ALPHA_OPAQUE)
320 *val |= LCD_LAYER_ALPHA_STATIC;
323 switch (pixel_blend_mode) {
324 case DRM_MODE_BLEND_PIXEL_NONE:
326 case DRM_MODE_BLEND_PREMULTI:
327 *val |= LCD_LAYER_ALPHA_EMBED | LCD_LAYER_ALPHA_PREMULT;
329 case DRM_MODE_BLEND_COVERAGE:
330 *val |= LCD_LAYER_ALPHA_EMBED;
333 DRM_DEBUG("Missing pixel blend mode case (%s == %ld)\n",
334 __stringify(pixel_blend_mode),
335 (long)pixel_blend_mode);
340 if (plane_alpha == DRM_BLEND_ALPHA_OPAQUE && !has_alpha) {
341 *val &= LCD_LAYER_ALPHA_DISABLED;
345 kmb_write_lcd(kmb, LCD_LAYERn_ALPHA(plane_id), plane_alpha);
348 static void kmb_plane_atomic_update(struct drm_plane *plane,
349 struct drm_atomic_state *state)
351 struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state,
353 struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
355 struct drm_framebuffer *fb;
356 struct kmb_drm_private *kmb;
359 unsigned int dma_len;
360 struct kmb_plane *kmb_plane;
361 unsigned int dma_cfg;
362 unsigned int ctrl = 0, val = 0, out_format = 0;
363 unsigned int src_w, src_h, crtc_x, crtc_y;
364 unsigned char plane_id;
366 static dma_addr_t addr[MAX_SUB_PLANES];
367 struct disp_cfg *init_disp_cfg;
369 if (!plane || !new_plane_state || !old_plane_state)
372 fb = new_plane_state->fb;
376 num_planes = fb->format->num_planes;
377 kmb_plane = to_kmb_plane(plane);
379 kmb = to_kmb(plane->dev);
380 plane_id = kmb_plane->id;
382 spin_lock_irq(&kmb->irq_lock);
383 if (kmb->kmb_under_flow || kmb->kmb_flush_done) {
384 spin_unlock_irq(&kmb->irq_lock);
385 drm_dbg(&kmb->drm, "plane_update:underflow!!!! returning");
388 spin_unlock_irq(&kmb->irq_lock);
390 init_disp_cfg = &kmb->init_disp_cfg[plane_id];
391 src_w = new_plane_state->src_w >> 16;
392 src_h = new_plane_state->src_h >> 16;
393 crtc_x = new_plane_state->crtc_x;
394 crtc_y = new_plane_state->crtc_y;
397 "src_w=%d src_h=%d, fb->format->format=0x%x fb->flags=0x%x\n",
398 src_w, src_h, fb->format->format, fb->flags);
402 dma_len = (width * height * fb->format->cpp[0]);
403 drm_dbg(&kmb->drm, "dma_len=%d ", dma_len);
404 kmb_write_lcd(kmb, LCD_LAYERn_DMA_LEN(plane_id), dma_len);
405 kmb_write_lcd(kmb, LCD_LAYERn_DMA_LEN_SHADOW(plane_id), dma_len);
406 kmb_write_lcd(kmb, LCD_LAYERn_DMA_LINE_VSTRIDE(plane_id),
408 kmb_write_lcd(kmb, LCD_LAYERn_DMA_LINE_WIDTH(plane_id),
409 (width * fb->format->cpp[0]));
411 addr[Y_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state, 0);
412 kmb_write_lcd(kmb, LCD_LAYERn_DMA_START_ADDR(plane_id),
413 addr[Y_PLANE] + fb->offsets[0]);
414 val = get_pixel_format(fb->format->format);
415 val |= get_bits_per_pixel(fb->format);
416 /* Program Cb/Cr for planar formats */
417 if (num_planes > 1) {
418 kmb_write_lcd(kmb, LCD_LAYERn_DMA_CB_LINE_VSTRIDE(plane_id),
419 width * fb->format->cpp[0]);
420 kmb_write_lcd(kmb, LCD_LAYERn_DMA_CB_LINE_WIDTH(plane_id),
421 (width * fb->format->cpp[0]));
423 addr[U_PLANE] = drm_fb_cma_get_gem_addr(fb, new_plane_state,
425 /* check if Cb/Cr is swapped*/
426 if (num_planes == 3 && (val & LCD_LAYER_CRCB_ORDER))
428 LCD_LAYERn_DMA_START_CR_ADR(plane_id),
432 LCD_LAYERn_DMA_START_CB_ADR(plane_id),
435 if (num_planes == 3) {
437 LCD_LAYERn_DMA_CR_LINE_VSTRIDE(plane_id),
438 ((width) * fb->format->cpp[0]));
441 LCD_LAYERn_DMA_CR_LINE_WIDTH(plane_id),
442 ((width) * fb->format->cpp[0]));
444 addr[V_PLANE] = drm_fb_cma_get_gem_addr(fb,
448 /* check if Cb/Cr is swapped*/
449 if (val & LCD_LAYER_CRCB_ORDER)
451 LCD_LAYERn_DMA_START_CB_ADR(plane_id),
455 LCD_LAYERn_DMA_START_CR_ADR(plane_id),
460 kmb_write_lcd(kmb, LCD_LAYERn_WIDTH(plane_id), src_w - 1);
461 kmb_write_lcd(kmb, LCD_LAYERn_HEIGHT(plane_id), src_h - 1);
462 kmb_write_lcd(kmb, LCD_LAYERn_COL_START(plane_id), crtc_x);
463 kmb_write_lcd(kmb, LCD_LAYERn_ROW_START(plane_id), crtc_y);
465 val |= LCD_LAYER_FIFO_100;
467 if (val & LCD_LAYER_PLANAR_STORAGE) {
468 val |= LCD_LAYER_CSC_EN;
470 /* Enable CSC if input is planar and output is RGB */
471 config_csc(kmb, plane_id);
474 kmb_plane_set_alpha(kmb, plane->state, plane_id, &val);
476 kmb_write_lcd(kmb, LCD_LAYERn_CFG(plane_id), val);
478 /* Configure LCD_CONTROL */
479 ctrl = kmb_read_lcd(kmb, LCD_CONTROL);
481 /* Set layer blending config */
482 ctrl &= ~LCD_CTRL_ALPHA_ALL;
483 ctrl |= LCD_CTRL_ALPHA_BOTTOM_VL1 |
484 LCD_CTRL_ALPHA_BLEND_VL2;
486 ctrl &= ~LCD_CTRL_ALPHA_BLEND_BKGND_DISABLE;
490 ctrl |= LCD_CTRL_VL1_ENABLE;
493 ctrl |= LCD_CTRL_VL2_ENABLE;
496 ctrl |= LCD_CTRL_GL1_ENABLE;
499 ctrl |= LCD_CTRL_GL2_ENABLE;
503 ctrl |= LCD_CTRL_PROGRESSIVE | LCD_CTRL_TIM_GEN_ENABLE
504 | LCD_CTRL_CONTINUOUS | LCD_CTRL_OUTPUT_ENABLED;
506 /* LCD is connected to MIPI on kmb
507 * Therefore this bit is required for DSI Tx
509 ctrl |= LCD_CTRL_VHSYNC_IDLE_LVL;
511 kmb_write_lcd(kmb, LCD_CONTROL, ctrl);
513 /* Enable pipeline AXI read transactions for the DMA
514 * after setting graphics layers. This must be done
515 * in a separate write cycle.
517 kmb_set_bitmask_lcd(kmb, LCD_CONTROL, LCD_CTRL_PIPELINE_DMA);
519 /* FIXME no doc on how to set output format, these values are taken
520 * from the Myriadx tests
522 out_format |= LCD_OUTF_FORMAT_RGB888;
524 /* Leave RGB order,conversion mode and clip mode to default */
525 /* do not interleave RGB channels for mipi Tx compatibility */
526 out_format |= LCD_OUTF_MIPI_RGB_MODE;
527 kmb_write_lcd(kmb, LCD_OUT_FORMAT_CFG, out_format);
529 dma_cfg = LCD_DMA_LAYER_ENABLE | LCD_DMA_LAYER_VSTRIDE_EN |
530 LCD_DMA_LAYER_CONT_UPDATE | LCD_DMA_LAYER_AXI_BURST_16;
533 kmb_write_lcd(kmb, LCD_LAYERn_DMA_CFG(plane_id), dma_cfg);
535 /* Save initial display config */
536 if (!init_disp_cfg->width ||
537 !init_disp_cfg->height ||
538 !init_disp_cfg->format) {
539 init_disp_cfg->width = width;
540 init_disp_cfg->height = height;
541 init_disp_cfg->format = fb->format->format;
544 drm_dbg(&kmb->drm, "dma_cfg=0x%x LCD_DMA_CFG=0x%x\n", dma_cfg,
545 kmb_read_lcd(kmb, LCD_LAYERn_DMA_CFG(plane_id)));
547 kmb_set_bitmask_lcd(kmb, LCD_INT_CLEAR, LCD_INT_EOF |
549 kmb_set_bitmask_lcd(kmb, LCD_INT_ENABLE, LCD_INT_EOF |
553 static const struct drm_plane_helper_funcs kmb_plane_helper_funcs = {
554 .atomic_check = kmb_plane_atomic_check,
555 .atomic_update = kmb_plane_atomic_update,
556 .atomic_disable = kmb_plane_atomic_disable
559 void kmb_plane_destroy(struct drm_plane *plane)
561 struct kmb_plane *kmb_plane = to_kmb_plane(plane);
563 drm_plane_cleanup(plane);
567 static const struct drm_plane_funcs kmb_plane_funcs = {
568 .update_plane = drm_atomic_helper_update_plane,
569 .disable_plane = drm_atomic_helper_disable_plane,
570 .destroy = kmb_plane_destroy,
571 .reset = drm_atomic_helper_plane_reset,
572 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
573 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
576 struct kmb_plane *kmb_plane_init(struct drm_device *drm)
578 struct kmb_drm_private *kmb = to_kmb(drm);
579 struct kmb_plane *plane = NULL;
580 struct kmb_plane *primary = NULL;
583 enum drm_plane_type plane_type;
584 const u32 *plane_formats;
585 int num_plane_formats;
586 unsigned int blend_caps = BIT(DRM_MODE_BLEND_PIXEL_NONE) |
587 BIT(DRM_MODE_BLEND_PREMULTI) |
588 BIT(DRM_MODE_BLEND_COVERAGE);
590 for (i = 0; i < KMB_MAX_PLANES; i++) {
591 plane = drmm_kzalloc(drm, sizeof(*plane), GFP_KERNEL);
594 drm_err(drm, "Failed to allocate plane\n");
595 return ERR_PTR(-ENOMEM);
598 plane_type = (i == 0) ? DRM_PLANE_TYPE_PRIMARY :
599 DRM_PLANE_TYPE_OVERLAY;
601 plane_formats = kmb_formats_v;
602 num_plane_formats = ARRAY_SIZE(kmb_formats_v);
604 plane_formats = kmb_formats_g;
605 num_plane_formats = ARRAY_SIZE(kmb_formats_g);
608 ret = drm_universal_plane_init(drm, &plane->base_plane,
609 POSSIBLE_CRTCS, &kmb_plane_funcs,
610 plane_formats, num_plane_formats,
611 NULL, plane_type, "plane %d", i);
613 drm_err(drm, "drm_universal_plane_init failed (ret=%d)",
617 drm_dbg(drm, "%s : %d i=%d type=%d",
620 drm_plane_create_alpha_property(&plane->base_plane);
622 drm_plane_create_blend_mode_property(&plane->base_plane,
625 drm_plane_create_zpos_immutable_property(&plane->base_plane, i);
627 drm_plane_helper_add(&plane->base_plane,
628 &kmb_plane_helper_funcs);
630 if (plane_type == DRM_PLANE_TYPE_PRIMARY) {
634 drm_dbg(drm, "%s : %d primary=%p\n", __func__, __LINE__,
635 &primary->base_plane);
639 /* Disable pipeline AXI read transactions for the DMA
640 * prior to setting graphics layers
642 kmb_clr_bitmask_lcd(kmb, LCD_CONTROL, LCD_CTRL_PIPELINE_DMA);
646 drmm_kfree(drm, plane);