blob: 263c8d2603b6ddd5fd44f9ca846fa03c54087ac2 [file] [log] [blame]
Jani Nikula4e646492013-08-27 15:12:20 +03001/*
2 * Copyright © 2013 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 *
23 * Author: Jani Nikula <jani.nikula@intel.com>
24 */
25
26#include <drm/drmP.h>
27#include <drm/drm_crtc.h>
28#include <drm/drm_edid.h>
29#include <drm/i915_drm.h>
30#include <linux/slab.h>
31#include "i915_drv.h"
32#include "intel_drv.h"
33#include "intel_dsi.h"
34#include "intel_dsi_cmd.h"
35
36/* the sub-encoders aka panel drivers */
37static const struct intel_dsi_device intel_dsi_devices[] = {
38};
39
40static struct intel_dsi *intel_attached_dsi(struct drm_connector *connector)
41{
42 return container_of(intel_attached_encoder(connector),
43 struct intel_dsi, base);
44}
45
46static inline bool is_vid_mode(struct intel_dsi *intel_dsi)
47{
48 return intel_dsi->dev.type == INTEL_DSI_VIDEO_MODE;
49}
50
51static inline bool is_cmd_mode(struct intel_dsi *intel_dsi)
52{
53 return intel_dsi->dev.type == INTEL_DSI_COMMAND_MODE;
54}
55
56static void intel_dsi_hot_plug(struct intel_encoder *encoder)
57{
58 DRM_DEBUG_KMS("\n");
59}
60
61static bool intel_dsi_compute_config(struct intel_encoder *encoder,
62 struct intel_crtc_config *config)
63{
64 struct intel_dsi *intel_dsi = container_of(encoder, struct intel_dsi,
65 base);
66 struct intel_connector *intel_connector = intel_dsi->attached_connector;
67 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
68 struct drm_display_mode *adjusted_mode = &config->adjusted_mode;
69 struct drm_display_mode *mode = &config->requested_mode;
70
71 DRM_DEBUG_KMS("\n");
72
73 if (fixed_mode)
74 intel_fixed_panel_mode(fixed_mode, adjusted_mode);
75
76 if (intel_dsi->dev.dev_ops->mode_fixup)
77 return intel_dsi->dev.dev_ops->mode_fixup(&intel_dsi->dev,
78 mode, adjusted_mode);
79
80 return true;
81}
82
83static void intel_dsi_pre_pll_enable(struct intel_encoder *encoder)
84{
85 DRM_DEBUG_KMS("\n");
ymohanmabe4fc042013-08-27 23:40:56 +030086
87 vlv_enable_dsi_pll(encoder);
Jani Nikula4e646492013-08-27 15:12:20 +030088}
89
90static void intel_dsi_pre_enable(struct intel_encoder *encoder)
91{
92 DRM_DEBUG_KMS("\n");
93}
94
95static void intel_dsi_enable(struct intel_encoder *encoder)
96{
97 struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
98 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
99 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
100 int pipe = intel_crtc->pipe;
101 u32 temp;
102
103 DRM_DEBUG_KMS("\n");
104
105 temp = I915_READ(MIPI_DEVICE_READY(pipe));
106 if ((temp & DEVICE_READY) == 0) {
107 temp &= ~ULPS_STATE_MASK;
108 I915_WRITE(MIPI_DEVICE_READY(pipe), temp | DEVICE_READY);
109 } else if (temp & ULPS_STATE_MASK) {
110 temp &= ~ULPS_STATE_MASK;
111 I915_WRITE(MIPI_DEVICE_READY(pipe), temp | ULPS_STATE_EXIT);
112 /*
113 * We need to ensure that there is a minimum of 1 ms time
114 * available before clearing the UPLS exit state.
115 */
116 msleep(2);
117 I915_WRITE(MIPI_DEVICE_READY(pipe), temp);
118 }
119
120 if (is_cmd_mode(intel_dsi))
121 I915_WRITE(MIPI_MAX_RETURN_PKT_SIZE(pipe), 8 * 4);
122
123 if (is_vid_mode(intel_dsi)) {
124 msleep(20); /* XXX */
125 dpi_send_cmd(intel_dsi, TURN_ON);
126 msleep(100);
127
128 /* assert ip_tg_enable signal */
129 temp = I915_READ(MIPI_PORT_CTRL(pipe));
130 I915_WRITE(MIPI_PORT_CTRL(pipe), temp | DPI_ENABLE);
131 POSTING_READ(MIPI_PORT_CTRL(pipe));
132 }
133
134 intel_dsi->dev.dev_ops->enable(&intel_dsi->dev);
135}
136
137static void intel_dsi_disable(struct intel_encoder *encoder)
138{
139 struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
140 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
141 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
142 int pipe = intel_crtc->pipe;
143 u32 temp;
144
145 DRM_DEBUG_KMS("\n");
146
147 intel_dsi->dev.dev_ops->disable(&intel_dsi->dev);
148
149 if (is_vid_mode(intel_dsi)) {
150 dpi_send_cmd(intel_dsi, SHUTDOWN);
151 msleep(10);
152
153 /* de-assert ip_tg_enable signal */
154 temp = I915_READ(MIPI_PORT_CTRL(pipe));
155 I915_WRITE(MIPI_PORT_CTRL(pipe), temp & ~DPI_ENABLE);
156 POSTING_READ(MIPI_PORT_CTRL(pipe));
157
158 msleep(2);
159 }
160
161 temp = I915_READ(MIPI_DEVICE_READY(pipe));
162 if (temp & DEVICE_READY) {
163 temp &= ~DEVICE_READY;
164 temp &= ~ULPS_STATE_MASK;
165 I915_WRITE(MIPI_DEVICE_READY(pipe), temp);
166 }
167}
168
169static void intel_dsi_post_disable(struct intel_encoder *encoder)
170{
171 DRM_DEBUG_KMS("\n");
ymohanmabe4fc042013-08-27 23:40:56 +0300172
173 vlv_disable_dsi_pll(encoder);
Jani Nikula4e646492013-08-27 15:12:20 +0300174}
175
176static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
177 enum pipe *pipe)
178{
179 struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
180 u32 port, func;
181 enum pipe p;
182
183 DRM_DEBUG_KMS("\n");
184
185 /* XXX: this only works for one DSI output */
186 for (p = PIPE_A; p <= PIPE_B; p++) {
187 port = I915_READ(MIPI_PORT_CTRL(p));
188 func = I915_READ(MIPI_DSI_FUNC_PRG(p));
189
190 if ((port & DPI_ENABLE) || (func & CMD_MODE_DATA_WIDTH_MASK)) {
191 if (I915_READ(MIPI_DEVICE_READY(p)) & DEVICE_READY) {
192 *pipe = p;
193 return true;
194 }
195 }
196 }
197
198 return false;
199}
200
201static void intel_dsi_get_config(struct intel_encoder *encoder,
202 struct intel_crtc_config *pipe_config)
203{
204 DRM_DEBUG_KMS("\n");
205
206 /* XXX: read flags, set to adjusted_mode */
207}
208
209static int intel_dsi_mode_valid(struct drm_connector *connector,
210 struct drm_display_mode *mode)
211{
212 struct intel_connector *intel_connector = to_intel_connector(connector);
213 struct drm_display_mode *fixed_mode = intel_connector->panel.fixed_mode;
214 struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
215
216 DRM_DEBUG_KMS("\n");
217
218 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) {
219 DRM_DEBUG_KMS("MODE_NO_DBLESCAN\n");
220 return MODE_NO_DBLESCAN;
221 }
222
223 if (fixed_mode) {
224 if (mode->hdisplay > fixed_mode->hdisplay)
225 return MODE_PANEL;
226 if (mode->vdisplay > fixed_mode->vdisplay)
227 return MODE_PANEL;
228 }
229
230 return intel_dsi->dev.dev_ops->mode_valid(&intel_dsi->dev, mode);
231}
232
233/* return txclkesc cycles in terms of divider and duration in us */
234static u16 txclkesc(u32 divider, unsigned int us)
235{
236 switch (divider) {
237 case ESCAPE_CLOCK_DIVIDER_1:
238 default:
239 return 20 * us;
240 case ESCAPE_CLOCK_DIVIDER_2:
241 return 10 * us;
242 case ESCAPE_CLOCK_DIVIDER_4:
243 return 5 * us;
244 }
245}
246
247/* return pixels in terms of txbyteclkhs */
248static u16 txbyteclkhs(u16 pixels, int bpp, int lane_count)
249{
250 return DIV_ROUND_UP(DIV_ROUND_UP(pixels * bpp, 8), lane_count);
251}
252
253static void set_dsi_timings(struct drm_encoder *encoder,
254 const struct drm_display_mode *mode)
255{
256 struct drm_device *dev = encoder->dev;
257 struct drm_i915_private *dev_priv = dev->dev_private;
258 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
259 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
260 int pipe = intel_crtc->pipe;
261 unsigned int bpp = intel_crtc->config.pipe_bpp;
262 unsigned int lane_count = intel_dsi->lane_count;
263
264 u16 hactive, hfp, hsync, hbp, vfp, vsync, vbp;
265
266 hactive = mode->hdisplay;
267 hfp = mode->hsync_start - mode->hdisplay;
268 hsync = mode->hsync_end - mode->hsync_start;
269 hbp = mode->htotal - mode->hsync_end;
270
271 vfp = mode->vsync_start - mode->vdisplay;
272 vsync = mode->vsync_end - mode->vsync_start;
273 vbp = mode->vtotal - mode->vsync_end;
274
275 /* horizontal values are in terms of high speed byte clock */
276 hactive = txbyteclkhs(hactive, bpp, lane_count);
277 hfp = txbyteclkhs(hfp, bpp, lane_count);
278 hsync = txbyteclkhs(hsync, bpp, lane_count);
279 hbp = txbyteclkhs(hbp, bpp, lane_count);
280
281 I915_WRITE(MIPI_HACTIVE_AREA_COUNT(pipe), hactive);
282 I915_WRITE(MIPI_HFP_COUNT(pipe), hfp);
283
284 /* meaningful for video mode non-burst sync pulse mode only, can be zero
285 * for non-burst sync events and burst modes */
286 I915_WRITE(MIPI_HSYNC_PADDING_COUNT(pipe), hsync);
287 I915_WRITE(MIPI_HBP_COUNT(pipe), hbp);
288
289 /* vertical values are in terms of lines */
290 I915_WRITE(MIPI_VFP_COUNT(pipe), vfp);
291 I915_WRITE(MIPI_VSYNC_PADDING_COUNT(pipe), vsync);
292 I915_WRITE(MIPI_VBP_COUNT(pipe), vbp);
293}
294
295static void intel_dsi_mode_set(struct intel_encoder *intel_encoder)
296{
297 struct drm_encoder *encoder = &intel_encoder->base;
298 struct drm_device *dev = encoder->dev;
299 struct drm_i915_private *dev_priv = dev->dev_private;
300 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
301 struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
302 struct drm_display_mode *adjusted_mode =
303 &intel_crtc->config.adjusted_mode;
304 int pipe = intel_crtc->pipe;
305 unsigned int bpp = intel_crtc->config.pipe_bpp;
306 u32 val, tmp;
307
308 DRM_DEBUG_KMS("pipe %d\n", pipe);
309
ymohanmabe4fc042013-08-27 23:40:56 +0300310 /* Update the DSI PLL */
311 vlv_enable_dsi_pll(intel_encoder);
312
Jani Nikula4e646492013-08-27 15:12:20 +0300313 /* escape clock divider, 20MHz, shared for A and C. device ready must be
314 * off when doing this! txclkesc? */
315 tmp = I915_READ(MIPI_CTRL(0));
316 tmp &= ~ESCAPE_CLOCK_DIVIDER_MASK;
317 I915_WRITE(MIPI_CTRL(0), tmp | ESCAPE_CLOCK_DIVIDER_1);
318
319 /* read request priority is per pipe */
320 tmp = I915_READ(MIPI_CTRL(pipe));
321 tmp &= ~READ_REQUEST_PRIORITY_MASK;
322 I915_WRITE(MIPI_CTRL(pipe), tmp | READ_REQUEST_PRIORITY_HIGH);
323
324 /* XXX: why here, why like this? handling in irq handler?! */
325 I915_WRITE(MIPI_INTR_STAT(pipe), 0xffffffff);
326 I915_WRITE(MIPI_INTR_EN(pipe), 0xffffffff);
327
328 I915_WRITE(MIPI_DPHY_PARAM(pipe),
329 0x3c << EXIT_ZERO_COUNT_SHIFT |
330 0x1f << TRAIL_COUNT_SHIFT |
331 0xc5 << CLK_ZERO_COUNT_SHIFT |
332 0x1f << PREPARE_COUNT_SHIFT);
333
334 I915_WRITE(MIPI_DPI_RESOLUTION(pipe),
335 adjusted_mode->vdisplay << VERTICAL_ADDRESS_SHIFT |
336 adjusted_mode->hdisplay << HORIZONTAL_ADDRESS_SHIFT);
337
338 set_dsi_timings(encoder, adjusted_mode);
339
340 val = intel_dsi->lane_count << DATA_LANES_PRG_REG_SHIFT;
341 if (is_cmd_mode(intel_dsi)) {
342 val |= intel_dsi->channel << CMD_MODE_CHANNEL_NUMBER_SHIFT;
343 val |= CMD_MODE_DATA_WIDTH_8_BIT; /* XXX */
344 } else {
345 val |= intel_dsi->channel << VID_MODE_CHANNEL_NUMBER_SHIFT;
346
347 /* XXX: cross-check bpp vs. pixel format? */
348 val |= intel_dsi->pixel_format;
349 }
350 I915_WRITE(MIPI_DSI_FUNC_PRG(pipe), val);
351
352 /* timeouts for recovery. one frame IIUC. if counter expires, EOT and
353 * stop state. */
354
355 /*
356 * In burst mode, value greater than one DPI line Time in byte clock
357 * (txbyteclkhs) To timeout this timer 1+ of the above said value is
358 * recommended.
359 *
360 * In non-burst mode, Value greater than one DPI frame time in byte
361 * clock(txbyteclkhs) To timeout this timer 1+ of the above said value
362 * is recommended.
363 *
364 * In DBI only mode, value greater than one DBI frame time in byte
365 * clock(txbyteclkhs) To timeout this timer 1+ of the above said value
366 * is recommended.
367 */
368
369 if (is_vid_mode(intel_dsi) &&
370 intel_dsi->video_mode_format == VIDEO_MODE_BURST) {
371 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe),
372 txbyteclkhs(adjusted_mode->htotal, bpp,
373 intel_dsi->lane_count) + 1);
374 } else {
375 I915_WRITE(MIPI_HS_TX_TIMEOUT(pipe),
376 txbyteclkhs(adjusted_mode->vtotal *
377 adjusted_mode->htotal,
378 bpp, intel_dsi->lane_count) + 1);
379 }
380 I915_WRITE(MIPI_LP_RX_TIMEOUT(pipe), 8309); /* max */
381 I915_WRITE(MIPI_TURN_AROUND_TIMEOUT(pipe), 0x14); /* max */
382 I915_WRITE(MIPI_DEVICE_RESET_TIMER(pipe), 0xffff); /* max */
383
384 /* dphy stuff */
385
386 /* in terms of low power clock */
387 I915_WRITE(MIPI_INIT_COUNT(pipe), txclkesc(ESCAPE_CLOCK_DIVIDER_1, 100));
388
389 /* recovery disables */
390 I915_WRITE(MIPI_EOT_DISABLE(pipe), intel_dsi->eot_disable);
391
392 /* in terms of txbyteclkhs. actual high to low switch +
393 * MIPI_STOP_STATE_STALL * MIPI_LP_BYTECLK.
394 *
395 * XXX: write MIPI_STOP_STATE_STALL?
396 */
397 I915_WRITE(MIPI_HIGH_LOW_SWITCH_COUNT(pipe), 0x46);
398
399 /* XXX: low power clock equivalence in terms of byte clock. the number
400 * of byte clocks occupied in one low power clock. based on txbyteclkhs
401 * and txclkesc. txclkesc time / txbyteclk time * (105 +
402 * MIPI_STOP_STATE_STALL) / 105.???
403 */
404 I915_WRITE(MIPI_LP_BYTECLK(pipe), 4);
405
406 /* the bw essential for transmitting 16 long packets containing 252
407 * bytes meant for dcs write memory command is programmed in this
408 * register in terms of byte clocks. based on dsi transfer rate and the
409 * number of lanes configured the time taken to transmit 16 long packets
410 * in a dsi stream varies. */
411 I915_WRITE(MIPI_DBI_BW_CTRL(pipe), 0x820);
412
413 I915_WRITE(MIPI_CLK_LANE_SWITCH_TIME_CNT(pipe),
414 0xa << LP_HS_SSW_CNT_SHIFT |
415 0x14 << HS_LP_PWR_SW_CNT_SHIFT);
416
417 if (is_vid_mode(intel_dsi))
418 I915_WRITE(MIPI_VIDEO_MODE_FORMAT(pipe),
419 intel_dsi->video_mode_format);
420}
421
422static enum drm_connector_status
423intel_dsi_detect(struct drm_connector *connector, bool force)
424{
425 struct intel_dsi *intel_dsi = intel_attached_dsi(connector);
426 DRM_DEBUG_KMS("\n");
427 return intel_dsi->dev.dev_ops->detect(&intel_dsi->dev);
428}
429
430static int intel_dsi_get_modes(struct drm_connector *connector)
431{
432 struct intel_connector *intel_connector = to_intel_connector(connector);
433 struct drm_display_mode *mode;
434
435 DRM_DEBUG_KMS("\n");
436
437 if (!intel_connector->panel.fixed_mode) {
438 DRM_DEBUG_KMS("no fixed mode\n");
439 return 0;
440 }
441
442 mode = drm_mode_duplicate(connector->dev,
443 intel_connector->panel.fixed_mode);
444 if (!mode) {
445 DRM_DEBUG_KMS("drm_mode_duplicate failed\n");
446 return 0;
447 }
448
449 drm_mode_probed_add(connector, mode);
450 return 1;
451}
452
453static void intel_dsi_destroy(struct drm_connector *connector)
454{
455 struct intel_connector *intel_connector = to_intel_connector(connector);
456
457 DRM_DEBUG_KMS("\n");
458 intel_panel_fini(&intel_connector->panel);
459 drm_sysfs_connector_remove(connector);
460 drm_connector_cleanup(connector);
461 kfree(connector);
462}
463
464static const struct drm_encoder_funcs intel_dsi_funcs = {
465 .destroy = intel_encoder_destroy,
466};
467
468static const struct drm_connector_helper_funcs intel_dsi_connector_helper_funcs = {
469 .get_modes = intel_dsi_get_modes,
470 .mode_valid = intel_dsi_mode_valid,
471 .best_encoder = intel_best_encoder,
472};
473
474static const struct drm_connector_funcs intel_dsi_connector_funcs = {
475 .dpms = intel_connector_dpms,
476 .detect = intel_dsi_detect,
477 .destroy = intel_dsi_destroy,
478 .fill_modes = drm_helper_probe_single_connector_modes,
479};
480
481bool intel_dsi_init(struct drm_device *dev)
482{
483 struct intel_dsi *intel_dsi;
484 struct intel_encoder *intel_encoder;
485 struct drm_encoder *encoder;
486 struct intel_connector *intel_connector;
487 struct drm_connector *connector;
488 struct drm_display_mode *fixed_mode = NULL;
489 const struct intel_dsi_device *dsi;
490 unsigned int i;
491
492 DRM_DEBUG_KMS("\n");
493
494 intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
495 if (!intel_dsi)
496 return false;
497
498 intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
499 if (!intel_connector) {
500 kfree(intel_dsi);
501 return false;
502 }
503
504 intel_encoder = &intel_dsi->base;
505 encoder = &intel_encoder->base;
506 intel_dsi->attached_connector = intel_connector;
507
508 connector = &intel_connector->base;
509
510 drm_encoder_init(dev, encoder, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI);
511
512 /* XXX: very likely not all of these are needed */
513 intel_encoder->hot_plug = intel_dsi_hot_plug;
514 intel_encoder->compute_config = intel_dsi_compute_config;
515 intel_encoder->pre_pll_enable = intel_dsi_pre_pll_enable;
516 intel_encoder->pre_enable = intel_dsi_pre_enable;
517 intel_encoder->enable = intel_dsi_enable;
518 intel_encoder->mode_set = intel_dsi_mode_set;
519 intel_encoder->disable = intel_dsi_disable;
520 intel_encoder->post_disable = intel_dsi_post_disable;
521 intel_encoder->get_hw_state = intel_dsi_get_hw_state;
522 intel_encoder->get_config = intel_dsi_get_config;
523
524 intel_connector->get_hw_state = intel_connector_get_hw_state;
525
526 for (i = 0; i < ARRAY_SIZE(intel_dsi_devices); i++) {
527 dsi = &intel_dsi_devices[i];
528 intel_dsi->dev = *dsi;
529
530 if (dsi->dev_ops->init(&intel_dsi->dev))
531 break;
532 }
533
534 if (i == ARRAY_SIZE(intel_dsi_devices)) {
535 DRM_DEBUG_KMS("no device found\n");
536 goto err;
537 }
538
539 intel_encoder->type = INTEL_OUTPUT_DSI;
540 intel_encoder->crtc_mask = (1 << 0); /* XXX */
541
542 intel_encoder->cloneable = false;
543 drm_connector_init(dev, connector, &intel_dsi_connector_funcs,
544 DRM_MODE_CONNECTOR_DSI);
545
546 drm_connector_helper_add(connector, &intel_dsi_connector_helper_funcs);
547
548 connector->display_info.subpixel_order = SubPixelHorizontalRGB; /*XXX*/
549 connector->interlace_allowed = false;
550 connector->doublescan_allowed = false;
551
552 intel_connector_attach_encoder(intel_connector, intel_encoder);
553
554 drm_sysfs_connector_add(connector);
555
556 fixed_mode = dsi->dev_ops->get_modes(&intel_dsi->dev);
557 if (!fixed_mode) {
558 DRM_DEBUG_KMS("no fixed mode\n");
559 goto err;
560 }
561
562 fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
563 intel_panel_init(&intel_connector->panel, fixed_mode);
564
565 return true;
566
567err:
568 drm_encoder_cleanup(&intel_encoder->base);
569 kfree(intel_dsi);
570 kfree(intel_connector);
571
572 return false;
573}