2 * Copyright © 2006-2010 Intel Corporation
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the next
13 * paragraph) shall be included in all copies or substantial portions of the
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
31 #include <linux/kernel.h>
32 #include <linux/pwm.h>
34 #include <drm/drm_edid.h>
37 #include "intel_backlight.h"
38 #include "intel_connector.h"
40 #include "intel_display_types.h"
41 #include "intel_drrs.h"
42 #include "intel_lvds_regs.h"
43 #include "intel_panel.h"
44 #include "intel_quirks.h"
46 bool intel_panel_use_ssc(struct drm_i915_private *i915)
48 if (i915->params.panel_use_ssc >= 0)
49 return i915->params.panel_use_ssc != 0;
50 return i915->display.vbt.lvds_use_ssc &&
51 !intel_has_quirk(i915, QUIRK_LVDS_SSC_DISABLE);
54 const struct drm_display_mode *
55 intel_panel_preferred_fixed_mode(struct intel_connector *connector)
57 return list_first_entry_or_null(&connector->panel.fixed_modes,
58 struct drm_display_mode, head);
61 const struct drm_display_mode *
62 intel_panel_fixed_mode(struct intel_connector *connector,
63 const struct drm_display_mode *mode)
65 const struct drm_display_mode *fixed_mode, *best_mode = NULL;
66 int vrefresh = drm_mode_vrefresh(mode);
68 /* pick the fixed_mode that is closest in terms of vrefresh */
69 list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
71 abs(drm_mode_vrefresh(fixed_mode) - vrefresh) <
72 abs(drm_mode_vrefresh(best_mode) - vrefresh))
73 best_mode = fixed_mode;
79 static bool is_alt_drrs_mode(const struct drm_display_mode *mode,
80 const struct drm_display_mode *preferred_mode)
82 return drm_mode_match(mode, preferred_mode,
83 DRM_MODE_MATCH_TIMINGS |
84 DRM_MODE_MATCH_FLAGS |
85 DRM_MODE_MATCH_3D_FLAGS) &&
86 mode->clock != preferred_mode->clock;
89 static bool is_alt_fixed_mode(const struct drm_display_mode *mode,
90 const struct drm_display_mode *preferred_mode)
92 u32 sync_flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NHSYNC |
93 DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC;
95 return (mode->flags & ~sync_flags) == (preferred_mode->flags & ~sync_flags) &&
96 mode->hdisplay == preferred_mode->hdisplay &&
97 mode->vdisplay == preferred_mode->vdisplay;
100 const struct drm_display_mode *
101 intel_panel_downclock_mode(struct intel_connector *connector,
102 const struct drm_display_mode *adjusted_mode)
104 const struct drm_display_mode *fixed_mode, *best_mode = NULL;
105 int min_vrefresh = connector->panel.vbt.seamless_drrs_min_refresh_rate;
106 int max_vrefresh = drm_mode_vrefresh(adjusted_mode);
108 /* pick the fixed_mode with the lowest refresh rate */
109 list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
110 int vrefresh = drm_mode_vrefresh(fixed_mode);
112 if (is_alt_drrs_mode(fixed_mode, adjusted_mode) &&
113 vrefresh >= min_vrefresh && vrefresh < max_vrefresh) {
114 max_vrefresh = vrefresh;
115 best_mode = fixed_mode;
122 const struct drm_display_mode *
123 intel_panel_highest_mode(struct intel_connector *connector,
124 const struct drm_display_mode *adjusted_mode)
126 const struct drm_display_mode *fixed_mode, *best_mode = adjusted_mode;
128 /* pick the fixed_mode that has the highest clock */
129 list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
130 if (fixed_mode->clock > best_mode->clock)
131 best_mode = fixed_mode;
137 int intel_panel_get_modes(struct intel_connector *connector)
139 const struct drm_display_mode *fixed_mode;
142 list_for_each_entry(fixed_mode, &connector->panel.fixed_modes, head) {
143 struct drm_display_mode *mode;
145 mode = drm_mode_duplicate(connector->base.dev, fixed_mode);
147 drm_mode_probed_add(&connector->base, mode);
155 static bool has_drrs_modes(struct intel_connector *connector)
157 const struct drm_display_mode *mode1;
159 list_for_each_entry(mode1, &connector->panel.fixed_modes, head) {
160 const struct drm_display_mode *mode2 = mode1;
162 list_for_each_entry_continue(mode2, &connector->panel.fixed_modes, head) {
163 if (is_alt_drrs_mode(mode1, mode2))
171 enum drrs_type intel_panel_drrs_type(struct intel_connector *connector)
173 return connector->panel.vbt.drrs_type;
176 int intel_panel_compute_config(struct intel_connector *connector,
177 struct drm_display_mode *adjusted_mode)
179 const struct drm_display_mode *fixed_mode =
180 intel_panel_fixed_mode(connector, adjusted_mode);
186 * We don't want to lie too much to the user about the refresh
187 * rate they're going to get. But we have to allow a bit of latitude
188 * for Xorg since it likes to automagically cook up modes with slightly
191 if (abs(drm_mode_vrefresh(adjusted_mode) - drm_mode_vrefresh(fixed_mode)) > 1) {
192 drm_dbg_kms(connector->base.dev,
193 "[CONNECTOR:%d:%s] Requested mode vrefresh (%d Hz) does not match fixed mode vrefresh (%d Hz)\n",
194 connector->base.base.id, connector->base.name,
195 drm_mode_vrefresh(adjusted_mode), drm_mode_vrefresh(fixed_mode));
200 drm_mode_copy(adjusted_mode, fixed_mode);
202 drm_mode_set_crtcinfo(adjusted_mode, 0);
207 static void intel_panel_add_edid_alt_fixed_modes(struct intel_connector *connector)
209 struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
210 const struct drm_display_mode *preferred_mode =
211 intel_panel_preferred_fixed_mode(connector);
212 struct drm_display_mode *mode, *next;
214 list_for_each_entry_safe(mode, next, &connector->base.probed_modes, head) {
215 if (!is_alt_fixed_mode(mode, preferred_mode))
218 drm_dbg_kms(&dev_priv->drm,
219 "[CONNECTOR:%d:%s] using alternate EDID fixed mode: " DRM_MODE_FMT "\n",
220 connector->base.base.id, connector->base.name,
223 list_move_tail(&mode->head, &connector->panel.fixed_modes);
227 static void intel_panel_add_edid_preferred_mode(struct intel_connector *connector)
229 struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
230 struct drm_display_mode *scan, *fixed_mode = NULL;
232 if (list_empty(&connector->base.probed_modes))
235 /* make sure the preferred mode is first */
236 list_for_each_entry(scan, &connector->base.probed_modes, head) {
237 if (scan->type & DRM_MODE_TYPE_PREFERRED) {
244 fixed_mode = list_first_entry(&connector->base.probed_modes,
245 typeof(*fixed_mode), head);
247 drm_dbg_kms(&dev_priv->drm,
248 "[CONNECTOR:%d:%s] using %s EDID fixed mode: " DRM_MODE_FMT "\n",
249 connector->base.base.id, connector->base.name,
250 fixed_mode->type & DRM_MODE_TYPE_PREFERRED ? "preferred" : "first",
251 DRM_MODE_ARG(fixed_mode));
253 fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
255 list_move_tail(&fixed_mode->head, &connector->panel.fixed_modes);
258 static void intel_panel_destroy_probed_modes(struct intel_connector *connector)
260 struct drm_i915_private *i915 = to_i915(connector->base.dev);
261 struct drm_display_mode *mode, *next;
263 list_for_each_entry_safe(mode, next, &connector->base.probed_modes, head) {
264 drm_dbg_kms(&i915->drm,
265 "[CONNECTOR:%d:%s] not using EDID mode: " DRM_MODE_FMT "\n",
266 connector->base.base.id, connector->base.name,
268 list_del(&mode->head);
269 drm_mode_destroy(&i915->drm, mode);
273 void intel_panel_add_edid_fixed_modes(struct intel_connector *connector,
274 bool use_alt_fixed_modes)
276 intel_panel_add_edid_preferred_mode(connector);
277 if (intel_panel_preferred_fixed_mode(connector) && use_alt_fixed_modes)
278 intel_panel_add_edid_alt_fixed_modes(connector);
279 intel_panel_destroy_probed_modes(connector);
282 static void intel_panel_add_fixed_mode(struct intel_connector *connector,
283 struct drm_display_mode *fixed_mode,
286 struct drm_i915_private *i915 = to_i915(connector->base.dev);
287 struct drm_display_info *info = &connector->base.display_info;
292 fixed_mode->type |= DRM_MODE_TYPE_PREFERRED | DRM_MODE_TYPE_DRIVER;
294 info->width_mm = fixed_mode->width_mm;
295 info->height_mm = fixed_mode->height_mm;
297 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] using %s fixed mode: " DRM_MODE_FMT "\n",
298 connector->base.base.id, connector->base.name, type,
299 DRM_MODE_ARG(fixed_mode));
301 list_add_tail(&fixed_mode->head, &connector->panel.fixed_modes);
304 void intel_panel_add_vbt_lfp_fixed_mode(struct intel_connector *connector)
306 struct drm_i915_private *i915 = to_i915(connector->base.dev);
307 const struct drm_display_mode *mode;
309 mode = connector->panel.vbt.lfp_lvds_vbt_mode;
313 intel_panel_add_fixed_mode(connector,
314 drm_mode_duplicate(&i915->drm, mode),
318 void intel_panel_add_vbt_sdvo_fixed_mode(struct intel_connector *connector)
320 struct drm_i915_private *i915 = to_i915(connector->base.dev);
321 const struct drm_display_mode *mode;
323 mode = connector->panel.vbt.sdvo_lvds_vbt_mode;
327 intel_panel_add_fixed_mode(connector,
328 drm_mode_duplicate(&i915->drm, mode),
332 void intel_panel_add_encoder_fixed_mode(struct intel_connector *connector,
333 struct intel_encoder *encoder)
335 intel_panel_add_fixed_mode(connector,
336 intel_encoder_current_mode(encoder),
340 /* adjusted_mode has been preset to be the panel's fixed mode */
341 static int pch_panel_fitting(struct intel_crtc_state *crtc_state,
342 const struct drm_connector_state *conn_state)
344 const struct drm_display_mode *adjusted_mode =
345 &crtc_state->hw.adjusted_mode;
346 int pipe_src_w = drm_rect_width(&crtc_state->pipe_src);
347 int pipe_src_h = drm_rect_height(&crtc_state->pipe_src);
348 int x, y, width, height;
350 /* Native modes don't need fitting */
351 if (adjusted_mode->crtc_hdisplay == pipe_src_w &&
352 adjusted_mode->crtc_vdisplay == pipe_src_h &&
353 crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420)
356 switch (conn_state->scaling_mode) {
357 case DRM_MODE_SCALE_CENTER:
360 x = (adjusted_mode->crtc_hdisplay - width + 1)/2;
361 y = (adjusted_mode->crtc_vdisplay - height + 1)/2;
364 case DRM_MODE_SCALE_ASPECT:
365 /* Scale but preserve the aspect ratio */
367 u32 scaled_width = adjusted_mode->crtc_hdisplay * pipe_src_h;
368 u32 scaled_height = pipe_src_w * adjusted_mode->crtc_vdisplay;
369 if (scaled_width > scaled_height) { /* pillar */
370 width = scaled_height / pipe_src_h;
373 x = (adjusted_mode->crtc_hdisplay - width + 1) / 2;
375 height = adjusted_mode->crtc_vdisplay;
376 } else if (scaled_width < scaled_height) { /* letter */
377 height = scaled_width / pipe_src_w;
380 y = (adjusted_mode->crtc_vdisplay - height + 1) / 2;
382 width = adjusted_mode->crtc_hdisplay;
385 width = adjusted_mode->crtc_hdisplay;
386 height = adjusted_mode->crtc_vdisplay;
391 case DRM_MODE_SCALE_NONE:
392 WARN_ON(adjusted_mode->crtc_hdisplay != pipe_src_w);
393 WARN_ON(adjusted_mode->crtc_vdisplay != pipe_src_h);
395 case DRM_MODE_SCALE_FULLSCREEN:
397 width = adjusted_mode->crtc_hdisplay;
398 height = adjusted_mode->crtc_vdisplay;
402 MISSING_CASE(conn_state->scaling_mode);
406 drm_rect_init(&crtc_state->pch_pfit.dst,
407 x, y, width, height);
408 crtc_state->pch_pfit.enabled = true;
414 centre_horizontally(struct drm_display_mode *adjusted_mode,
417 u32 border, sync_pos, blank_width, sync_width;
419 /* keep the hsync and hblank widths constant */
420 sync_width = adjusted_mode->crtc_hsync_end - adjusted_mode->crtc_hsync_start;
421 blank_width = adjusted_mode->crtc_hblank_end - adjusted_mode->crtc_hblank_start;
422 sync_pos = (blank_width - sync_width + 1) / 2;
424 border = (adjusted_mode->crtc_hdisplay - width + 1) / 2;
425 border += border & 1; /* make the border even */
427 adjusted_mode->crtc_hdisplay = width;
428 adjusted_mode->crtc_hblank_start = width + border;
429 adjusted_mode->crtc_hblank_end = adjusted_mode->crtc_hblank_start + blank_width;
431 adjusted_mode->crtc_hsync_start = adjusted_mode->crtc_hblank_start + sync_pos;
432 adjusted_mode->crtc_hsync_end = adjusted_mode->crtc_hsync_start + sync_width;
436 centre_vertically(struct drm_display_mode *adjusted_mode,
439 u32 border, sync_pos, blank_width, sync_width;
441 /* keep the vsync and vblank widths constant */
442 sync_width = adjusted_mode->crtc_vsync_end - adjusted_mode->crtc_vsync_start;
443 blank_width = adjusted_mode->crtc_vblank_end - adjusted_mode->crtc_vblank_start;
444 sync_pos = (blank_width - sync_width + 1) / 2;
446 border = (adjusted_mode->crtc_vdisplay - height + 1) / 2;
448 adjusted_mode->crtc_vdisplay = height;
449 adjusted_mode->crtc_vblank_start = height + border;
450 adjusted_mode->crtc_vblank_end = adjusted_mode->crtc_vblank_start + blank_width;
452 adjusted_mode->crtc_vsync_start = adjusted_mode->crtc_vblank_start + sync_pos;
453 adjusted_mode->crtc_vsync_end = adjusted_mode->crtc_vsync_start + sync_width;
456 static u32 panel_fitter_scaling(u32 source, u32 target)
459 * Floating point operation is not supported. So the FACTOR
460 * is defined, which can avoid the floating point computation
461 * when calculating the panel ratio.
464 #define FACTOR (1 << ACCURACY)
465 u32 ratio = source * FACTOR / target;
466 return (FACTOR * ratio + FACTOR/2) / FACTOR;
469 static void i965_scale_aspect(struct intel_crtc_state *crtc_state,
472 const struct drm_display_mode *adjusted_mode =
473 &crtc_state->hw.adjusted_mode;
474 int pipe_src_w = drm_rect_width(&crtc_state->pipe_src);
475 int pipe_src_h = drm_rect_height(&crtc_state->pipe_src);
476 u32 scaled_width = adjusted_mode->crtc_hdisplay * pipe_src_h;
477 u32 scaled_height = pipe_src_w * adjusted_mode->crtc_vdisplay;
479 /* 965+ is easy, it does everything in hw */
480 if (scaled_width > scaled_height)
481 *pfit_control |= PFIT_ENABLE |
483 else if (scaled_width < scaled_height)
484 *pfit_control |= PFIT_ENABLE |
486 else if (adjusted_mode->crtc_hdisplay != pipe_src_w)
487 *pfit_control |= PFIT_ENABLE | PFIT_SCALING_AUTO;
490 static void i9xx_scale_aspect(struct intel_crtc_state *crtc_state,
491 u32 *pfit_control, u32 *pfit_pgm_ratios,
494 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
495 int pipe_src_w = drm_rect_width(&crtc_state->pipe_src);
496 int pipe_src_h = drm_rect_height(&crtc_state->pipe_src);
497 u32 scaled_width = adjusted_mode->crtc_hdisplay * pipe_src_h;
498 u32 scaled_height = pipe_src_w * adjusted_mode->crtc_vdisplay;
502 * For earlier chips we have to calculate the scaling
503 * ratio by hand and program it into the
504 * PFIT_PGM_RATIO register
506 if (scaled_width > scaled_height) { /* pillar */
507 centre_horizontally(adjusted_mode,
508 scaled_height / pipe_src_h);
510 *border = LVDS_BORDER_ENABLE;
511 if (pipe_src_h != adjusted_mode->crtc_vdisplay) {
512 bits = panel_fitter_scaling(pipe_src_h,
513 adjusted_mode->crtc_vdisplay);
515 *pfit_pgm_ratios |= (bits << PFIT_HORIZ_SCALE_SHIFT |
516 bits << PFIT_VERT_SCALE_SHIFT);
517 *pfit_control |= (PFIT_ENABLE |
518 VERT_INTERP_BILINEAR |
519 HORIZ_INTERP_BILINEAR);
521 } else if (scaled_width < scaled_height) { /* letter */
522 centre_vertically(adjusted_mode,
523 scaled_width / pipe_src_w);
525 *border = LVDS_BORDER_ENABLE;
526 if (pipe_src_w != adjusted_mode->crtc_hdisplay) {
527 bits = panel_fitter_scaling(pipe_src_w,
528 adjusted_mode->crtc_hdisplay);
530 *pfit_pgm_ratios |= (bits << PFIT_HORIZ_SCALE_SHIFT |
531 bits << PFIT_VERT_SCALE_SHIFT);
532 *pfit_control |= (PFIT_ENABLE |
533 VERT_INTERP_BILINEAR |
534 HORIZ_INTERP_BILINEAR);
537 /* Aspects match, Let hw scale both directions */
538 *pfit_control |= (PFIT_ENABLE |
539 VERT_AUTO_SCALE | HORIZ_AUTO_SCALE |
540 VERT_INTERP_BILINEAR |
541 HORIZ_INTERP_BILINEAR);
545 static int gmch_panel_fitting(struct intel_crtc_state *crtc_state,
546 const struct drm_connector_state *conn_state)
548 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
549 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
550 u32 pfit_control = 0, pfit_pgm_ratios = 0, border = 0;
551 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
552 int pipe_src_w = drm_rect_width(&crtc_state->pipe_src);
553 int pipe_src_h = drm_rect_height(&crtc_state->pipe_src);
555 /* Native modes don't need fitting */
556 if (adjusted_mode->crtc_hdisplay == pipe_src_w &&
557 adjusted_mode->crtc_vdisplay == pipe_src_h)
560 switch (conn_state->scaling_mode) {
561 case DRM_MODE_SCALE_CENTER:
563 * For centered modes, we have to calculate border widths &
564 * heights and modify the values programmed into the CRTC.
566 centre_horizontally(adjusted_mode, pipe_src_w);
567 centre_vertically(adjusted_mode, pipe_src_h);
568 border = LVDS_BORDER_ENABLE;
570 case DRM_MODE_SCALE_ASPECT:
571 /* Scale but preserve the aspect ratio */
572 if (DISPLAY_VER(dev_priv) >= 4)
573 i965_scale_aspect(crtc_state, &pfit_control);
575 i9xx_scale_aspect(crtc_state, &pfit_control,
576 &pfit_pgm_ratios, &border);
578 case DRM_MODE_SCALE_FULLSCREEN:
580 * Full scaling, even if it changes the aspect ratio.
581 * Fortunately this is all done for us in hw.
583 if (pipe_src_h != adjusted_mode->crtc_vdisplay ||
584 pipe_src_w != adjusted_mode->crtc_hdisplay) {
585 pfit_control |= PFIT_ENABLE;
586 if (DISPLAY_VER(dev_priv) >= 4)
587 pfit_control |= PFIT_SCALING_AUTO;
589 pfit_control |= (VERT_AUTO_SCALE |
590 VERT_INTERP_BILINEAR |
592 HORIZ_INTERP_BILINEAR);
596 MISSING_CASE(conn_state->scaling_mode);
600 /* 965+ wants fuzzy fitting */
601 /* FIXME: handle multiple panels by failing gracefully */
602 if (DISPLAY_VER(dev_priv) >= 4)
603 pfit_control |= PFIT_PIPE(crtc->pipe) | PFIT_FILTER_FUZZY;
606 if ((pfit_control & PFIT_ENABLE) == 0) {
611 /* Make sure pre-965 set dither correctly for 18bpp panels. */
612 if (DISPLAY_VER(dev_priv) < 4 && crtc_state->pipe_bpp == 18)
613 pfit_control |= PANEL_8TO6_DITHER_ENABLE;
615 crtc_state->gmch_pfit.control = pfit_control;
616 crtc_state->gmch_pfit.pgm_ratios = pfit_pgm_ratios;
617 crtc_state->gmch_pfit.lvds_border_bits = border;
622 int intel_panel_fitting(struct intel_crtc_state *crtc_state,
623 const struct drm_connector_state *conn_state)
625 struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
626 struct drm_i915_private *i915 = to_i915(crtc->base.dev);
629 return gmch_panel_fitting(crtc_state, conn_state);
631 return pch_panel_fitting(crtc_state, conn_state);
634 enum drm_connector_status
635 intel_panel_detect(struct drm_connector *connector, bool force)
637 struct drm_i915_private *i915 = to_i915(connector->dev);
639 if (!INTEL_DISPLAY_ENABLED(i915))
640 return connector_status_disconnected;
642 return connector_status_connected;
646 intel_panel_mode_valid(struct intel_connector *connector,
647 const struct drm_display_mode *mode)
649 const struct drm_display_mode *fixed_mode =
650 intel_panel_fixed_mode(connector, mode);
655 if (mode->hdisplay != fixed_mode->hdisplay)
658 if (mode->vdisplay != fixed_mode->vdisplay)
661 if (drm_mode_vrefresh(mode) != drm_mode_vrefresh(fixed_mode))
667 void intel_panel_init_alloc(struct intel_connector *connector)
669 struct intel_panel *panel = &connector->panel;
671 connector->panel.vbt.panel_type = -1;
672 connector->panel.vbt.backlight.controller = -1;
673 INIT_LIST_HEAD(&panel->fixed_modes);
676 int intel_panel_init(struct intel_connector *connector,
677 const struct drm_edid *fixed_edid)
679 struct intel_panel *panel = &connector->panel;
681 panel->fixed_edid = fixed_edid;
683 intel_backlight_init_funcs(panel);
685 if (!has_drrs_modes(connector))
686 connector->panel.vbt.drrs_type = DRRS_TYPE_NONE;
688 drm_dbg_kms(connector->base.dev,
689 "[CONNECTOR:%d:%s] DRRS type: %s\n",
690 connector->base.base.id, connector->base.name,
691 intel_drrs_type_str(intel_panel_drrs_type(connector)));
696 void intel_panel_fini(struct intel_connector *connector)
698 struct intel_panel *panel = &connector->panel;
699 struct drm_display_mode *fixed_mode, *next;
701 if (!IS_ERR_OR_NULL(panel->fixed_edid))
702 drm_edid_free(panel->fixed_edid);
704 intel_backlight_destroy(panel);
706 intel_bios_fini_panel(panel);
708 list_for_each_entry_safe(fixed_mode, next, &panel->fixed_modes, head) {
709 list_del(&fixed_mode->head);
710 drm_mode_destroy(connector->base.dev, fixed_mode);