Lines Matching full:mode

54 /* First detailed mode wrong, use largest 60Hz mode */
58 /* Prefer the largest mode at 75 Hz */
68 /* use +hsync +vsync for detailed mode */
490 * @connector: has mode list to fix up
493 * Walk the mode list for @connector, clearing the preferred status
494 * on existing modes and setting it anew for the right mode ala @quirks.
519 /* Largest mode is preferred */ in edid_fixup_preferred()
535 mode_is_rb(const struct drm_display_mode *mode) in mode_is_rb() argument
537 return (mode->htotal - mode->hdisplay == 160) && in mode_is_rb()
538 (mode->hsync_end - mode->hdisplay == 80) && in mode_is_rb()
539 (mode->hsync_end - mode->hsync_start == 32) && in mode_is_rb()
540 (mode->vsync_start - mode->vdisplay == 3); in mode_is_rb()
544 * drm_mode_find_dmt - Create a copy of a mode if present in DMT
546 * @hsize: Mode width
547 * @vsize: Mode height
548 * @fresh: Mode refresh rate
549 * @rb: Mode reduced-blanking-ness
551 * Walk the DMT mode list looking for a match for the given parameters.
552 * Return a newly allocated copy of the mode, or NULL if not found.
732 * drm_mode_std - convert standard mode info (width, height, refresh) into mode
737 * and convert them into a real mode using CVT/GTF/DMT.
744 struct drm_display_mode *m, *mode = NULL; in drm_mode_std() local
782 * If this connector already has a mode for this size and refresh in drm_mode_std()
794 mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, in drm_mode_std()
796 mode->hdisplay = 1366; in drm_mode_std()
797 mode->hsync_start = mode->hsync_start - 1; in drm_mode_std()
798 mode->hsync_end = mode->hsync_end - 1; in drm_mode_std()
799 return mode; in drm_mode_std()
802 /* check whether it can be found in default mode table */ in drm_mode_std()
804 mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate, in drm_mode_std()
806 if (mode) in drm_mode_std()
807 return mode; in drm_mode_std()
809 mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate, false); in drm_mode_std()
810 if (mode) in drm_mode_std()
811 return mode; in drm_mode_std()
818 mode = drm_gtf_mode(dev, hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
826 mode = drm_gtf_mode(dev, hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
827 if (!mode) in drm_mode_std()
829 if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) { in drm_mode_std()
830 drm_mode_destroy(dev, mode); in drm_mode_std()
831 mode = drm_gtf_mode_complex(dev, hsize, vsize, in drm_mode_std()
840 mode = drm_cvt_mode(dev, hsize, vsize, vrefresh_rate, 0, 0, in drm_mode_std()
844 return mode; in drm_mode_std()
856 drm_mode_do_interlace_quirk(struct drm_display_mode *mode, in drm_mode_do_interlace_quirk() argument
876 if ((mode->hdisplay == cea_interlaced[i].w) && in drm_mode_do_interlace_quirk()
877 (mode->vdisplay == cea_interlaced[i].h / 2)) { in drm_mode_do_interlace_quirk()
878 mode->vdisplay *= 2; in drm_mode_do_interlace_quirk()
879 mode->vsync_start *= 2; in drm_mode_do_interlace_quirk()
880 mode->vsync_end *= 2; in drm_mode_do_interlace_quirk()
881 mode->vtotal *= 2; in drm_mode_do_interlace_quirk()
882 mode->vtotal |= 1; in drm_mode_do_interlace_quirk()
886 mode->flags |= DRM_MODE_FLAG_INTERLACE; in drm_mode_do_interlace_quirk()
890 * drm_mode_detailed - create a new mode from an EDID detailed timing section
891 * @dev: DRM device (needed to create new mode)
904 struct drm_display_mode *mode; in drm_mode_detailed() local
920 printf("stereo mode not supported\n"); in drm_mode_detailed()
935 mode = drm_cvt_mode(dev, hactive, vactive, 60, true, false, false); in drm_mode_detailed()
936 if (!mode) in drm_mode_detailed()
942 mode = drm_mode_create(dev); in drm_mode_detailed()
943 if (!mode) in drm_mode_detailed()
949 mode->clock = le16_to_cpu(timing->pixel_clock) * 10; in drm_mode_detailed()
951 mode->hdisplay = hactive; in drm_mode_detailed()
952 mode->hsync_start = mode->hdisplay + hsync_offset; in drm_mode_detailed()
953 mode->hsync_end = mode->hsync_start + hsync_pulse_width; in drm_mode_detailed()
954 mode->htotal = mode->hdisplay + hblank; in drm_mode_detailed()
956 mode->vdisplay = vactive; in drm_mode_detailed()
957 mode->vsync_start = mode->vdisplay + vsync_offset; in drm_mode_detailed()
958 mode->vsync_end = mode->vsync_start + vsync_pulse_width; in drm_mode_detailed()
959 mode->vtotal = mode->vdisplay + vblank; in drm_mode_detailed()
962 if (mode->hsync_end > mode->htotal) in drm_mode_detailed()
963 mode->htotal = mode->hsync_end + 1; in drm_mode_detailed()
964 if (mode->vsync_end > mode->vtotal) in drm_mode_detailed()
965 mode->vtotal = mode->vsync_end + 1; in drm_mode_detailed()
967 drm_mode_do_interlace_quirk(mode, pt); in drm_mode_detailed()
973 mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? in drm_mode_detailed()
975 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? in drm_mode_detailed()
979 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; in drm_mode_detailed()
980 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; in drm_mode_detailed()
983 mode->width_mm *= 10; in drm_mode_detailed()
984 mode->height_mm *= 10; in drm_mode_detailed()
988 mode->width_mm = edid->width_cm * 10; in drm_mode_detailed()
989 mode->height_mm = edid->height_cm * 10; in drm_mode_detailed()
992 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_detailed()
993 mode->vrefresh = drm_mode_vrefresh(mode); in drm_mode_detailed()
994 drm_mode_set_name(mode); in drm_mode_detailed()
996 return mode; in drm_mode_detailed()
1000 mode_in_hsync_range(const struct drm_display_mode *mode, in mode_in_hsync_range() argument
1011 hsync = drm_mode_hsync(mode); in mode_in_hsync_range()
1017 mode_in_vsync_range(const struct drm_display_mode *mode, in mode_in_vsync_range() argument
1028 vsync = drm_mode_vrefresh(mode); in mode_in_vsync_range()
1049 mode_in_range(const struct drm_display_mode *mode, struct edid *edid, in mode_in_range() argument
1055 if (!mode_in_hsync_range(mode, edid, t)) in mode_in_range()
1058 if (!mode_in_vsync_range(mode, edid, t)) in mode_in_range()
1062 if (mode->clock > max_clock) in mode_in_range()
1067 if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3)))) in mode_in_range()
1070 if (mode_is_rb(mode) && !drm_monitor_supports_rb(edid)) in mode_in_range()
1077 const struct drm_display_mode *mode) in valid_inferred_mode() argument
1083 if (mode->hdisplay == m->hdisplay && in valid_inferred_mode()
1084 mode->vdisplay == m->vdisplay && in valid_inferred_mode()
1085 drm_mode_vrefresh(mode) == drm_mode_vrefresh(m)) in valid_inferred_mode()
1087 if (mode->hdisplay <= m->hdisplay && in valid_inferred_mode()
1088 mode->vdisplay <= m->vdisplay) in valid_inferred_mode()
1116 /* fix up 1366x768 mode from 1368x768;
1119 static void fixup_mode_1366x768(struct drm_display_mode *mode) in fixup_mode_1366x768() argument
1121 if (mode->hdisplay == 1368 && mode->vdisplay == 768) { in fixup_mode_1366x768()
1122 mode->hdisplay = 1366; in fixup_mode_1366x768()
1123 mode->hsync_start--; in fixup_mode_1366x768()
1124 mode->hsync_end--; in fixup_mode_1366x768()
1125 drm_mode_set_name(mode); in fixup_mode_1366x768()
1242 struct drm_display_mode *mode; in drm_est3_modes() local
1251 mode = drm_mode_find_dmt(connector->dev, in drm_est3_modes()
1256 if (mode) { in drm_est3_modes()
1257 drm_mode_probed_add(connector, mode); in drm_est3_modes()
1534 * Looks for a CEA mode matching given drm_display_mode.
1540 u8 mode; in drm_match_cea_mode() local
1542 for (mode = 0; mode < drm_num_cea_modes; mode++) { in drm_match_cea_mode()
1543 cea_mode = (const struct drm_display_mode *)&edid_cea_modes[mode]; in drm_match_cea_mode()
1546 return mode + 1; in drm_match_cea_mode()
1557 u8 * mode, cea_mode; in do_cea_modes() local
1560 for (mode = db; mode < db + len; mode++) { in do_cea_modes()
1561 cea_mode = (*mode & 127) - 1; /* CEA modes are numbered 1..127 */ in do_cea_modes()
1786 * @mode: the display mode
1789 struct drm_display_mode *mode) in drm_av_sync_delay() argument
1791 int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_av_sync_delay()
1823 * @encoder: the encoder just changed display mode
1824 * @mode: the adjusted display mode
1830 struct drm_display_mode *mode) in drm_select_eld() argument
2002 * Add the specified modes to the connector's mode list.
2024 * - preferred detailed mode in drm_add_edid_modes()
2034 * XXX order for additional mode types in extension blocks? in drm_add_edid_modes()
2059 * Add the specified modes to the connector's mode list. Only when the
2068 struct drm_display_mode *mode; in drm_add_modes_noedid() local
2082 * whether the mode should be added to the mode list of in drm_add_modes_noedid()
2091 mode = drm_mode_duplicate(dev, ptr); in drm_add_modes_noedid()
2092 if (mode) { in drm_add_modes_noedid()
2093 drm_mode_probed_add(connector, mode); in drm_add_modes_noedid()
2102 * drm_mode_cea_vic - return the CEA-861 VIC of a given mode
2103 * @mode: mode
2106 * The VIC number, 0 in case it's not a CEA-861 mode.
2108 uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode) in drm_mode_cea_vic() argument
2113 if (drm_mode_equal(mode, &edid_cea_modes[i])) in drm_mode_cea_vic()