Lines Matching refs:mode
1449 mode_is_rb(const struct drm_display_mode *mode) in mode_is_rb() argument
1451 return (mode->htotal - mode->hdisplay == 160) && in mode_is_rb()
1452 (mode->hsync_end - mode->hdisplay == 80) && in mode_is_rb()
1453 (mode->hsync_end - mode->hsync_start == 32) && in mode_is_rb()
1454 (mode->vsync_start - mode->vdisplay == 3); in mode_is_rb()
1660 struct drm_display_mode *m, *mode = NULL; in drm_mode_std() local
1710 mode = drm_cvt_mode(dev, 1366, 768, vrefresh_rate, 0, 0, in drm_mode_std()
1712 mode->hdisplay = 1366; in drm_mode_std()
1713 mode->hsync_start = mode->hsync_start - 1; in drm_mode_std()
1714 mode->hsync_end = mode->hsync_end - 1; in drm_mode_std()
1715 return mode; in drm_mode_std()
1720 mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate, in drm_mode_std()
1722 if (mode) in drm_mode_std()
1723 return mode; in drm_mode_std()
1725 mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate, false); in drm_mode_std()
1726 if (mode) in drm_mode_std()
1727 return mode; in drm_mode_std()
1734 mode = drm_gtf_mode(dev, hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
1742 mode = drm_gtf_mode(dev, hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
1743 if (!mode) in drm_mode_std()
1745 if (drm_mode_hsync(mode) > drm_gtf2_hbreak(edid)) { in drm_mode_std()
1746 drm_mode_destroy(dev, mode); in drm_mode_std()
1747 mode = drm_gtf_mode_complex(dev, hsize, vsize, in drm_mode_std()
1756 mode = drm_cvt_mode(dev, hsize, vsize, vrefresh_rate, 0, 0, in drm_mode_std()
1760 return mode; in drm_mode_std()
1772 drm_mode_do_interlace_quirk(struct drm_display_mode *mode, in drm_mode_do_interlace_quirk() argument
1792 if ((mode->hdisplay == cea_interlaced[i].w) && in drm_mode_do_interlace_quirk()
1793 (mode->vdisplay == cea_interlaced[i].h / 2)) { in drm_mode_do_interlace_quirk()
1794 mode->vdisplay *= 2; in drm_mode_do_interlace_quirk()
1795 mode->vsync_start *= 2; in drm_mode_do_interlace_quirk()
1796 mode->vsync_end *= 2; in drm_mode_do_interlace_quirk()
1797 mode->vtotal *= 2; in drm_mode_do_interlace_quirk()
1798 mode->vtotal |= 1; in drm_mode_do_interlace_quirk()
1802 mode->flags |= DRM_MODE_FLAG_INTERLACE; in drm_mode_do_interlace_quirk()
1820 struct drm_display_mode *mode; in drm_mode_detailed() local
1851 mode = drm_cvt_mode(dev, hactive, vactive, 60, true, false, false); in drm_mode_detailed()
1852 if (!mode) in drm_mode_detailed()
1858 mode = drm_mode_create(dev); in drm_mode_detailed()
1859 if (!mode) in drm_mode_detailed()
1865 mode->clock = le16_to_cpu(timing->pixel_clock) * 10; in drm_mode_detailed()
1867 mode->hdisplay = hactive; in drm_mode_detailed()
1868 mode->hsync_start = mode->hdisplay + hsync_offset; in drm_mode_detailed()
1869 mode->hsync_end = mode->hsync_start + hsync_pulse_width; in drm_mode_detailed()
1870 mode->htotal = mode->hdisplay + hblank; in drm_mode_detailed()
1872 mode->vdisplay = vactive; in drm_mode_detailed()
1873 mode->vsync_start = mode->vdisplay + vsync_offset; in drm_mode_detailed()
1874 mode->vsync_end = mode->vsync_start + vsync_pulse_width; in drm_mode_detailed()
1875 mode->vtotal = mode->vdisplay + vblank; in drm_mode_detailed()
1878 if (mode->hsync_end > mode->htotal) in drm_mode_detailed()
1879 mode->htotal = mode->hsync_end + 1; in drm_mode_detailed()
1880 if (mode->vsync_end > mode->vtotal) in drm_mode_detailed()
1881 mode->vtotal = mode->vsync_end + 1; in drm_mode_detailed()
1883 drm_mode_do_interlace_quirk(mode, pt); in drm_mode_detailed()
1889 mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? in drm_mode_detailed()
1891 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? in drm_mode_detailed()
1895 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; in drm_mode_detailed()
1896 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; in drm_mode_detailed()
1899 mode->width_mm *= 10; in drm_mode_detailed()
1900 mode->height_mm *= 10; in drm_mode_detailed()
1904 mode->width_mm = edid->width_cm * 10; in drm_mode_detailed()
1905 mode->height_mm = edid->height_cm * 10; in drm_mode_detailed()
1908 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_detailed()
1909 mode->vrefresh = drm_mode_vrefresh(mode); in drm_mode_detailed()
1910 drm_mode_set_name(mode); in drm_mode_detailed()
1912 return mode; in drm_mode_detailed()
1916 mode_in_hsync_range(const struct drm_display_mode *mode, in mode_in_hsync_range() argument
1927 hsync = drm_mode_hsync(mode); in mode_in_hsync_range()
1933 mode_in_vsync_range(const struct drm_display_mode *mode, in mode_in_vsync_range() argument
1944 vsync = drm_mode_vrefresh(mode); in mode_in_vsync_range()
1965 mode_in_range(const struct drm_display_mode *mode, struct edid *edid, in mode_in_range() argument
1971 if (!mode_in_hsync_range(mode, edid, t)) in mode_in_range()
1974 if (!mode_in_vsync_range(mode, edid, t)) in mode_in_range()
1978 if (mode->clock > max_clock) in mode_in_range()
1983 if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3)))) in mode_in_range()
1986 if (mode_is_rb(mode) && !drm_monitor_supports_rb(edid)) in mode_in_range()
1993 const struct drm_display_mode *mode) in valid_inferred_mode() argument
1999 if (mode->hdisplay == m->hdisplay && in valid_inferred_mode()
2000 mode->vdisplay == m->vdisplay && in valid_inferred_mode()
2001 drm_mode_vrefresh(mode) == drm_mode_vrefresh(m)) in valid_inferred_mode()
2003 if (mode->hdisplay <= m->hdisplay && in valid_inferred_mode()
2004 mode->vdisplay <= m->vdisplay) in valid_inferred_mode()
2035 static void fixup_mode_1366x768(struct drm_display_mode *mode) in fixup_mode_1366x768() argument
2037 if (mode->hdisplay == 1368 && mode->vdisplay == 768) { in fixup_mode_1366x768()
2038 mode->hdisplay = 1366; in fixup_mode_1366x768()
2039 mode->hsync_start--; in fixup_mode_1366x768()
2040 mode->hsync_end--; in fixup_mode_1366x768()
2041 drm_mode_set_name(mode); in fixup_mode_1366x768()
2159 struct drm_display_mode *mode; in drm_est3_modes() local
2168 mode = drm_mode_find_dmt(connector->dev, in drm_est3_modes()
2173 if (mode) { in drm_est3_modes()
2174 drm_mode_probed_add(connector, mode); in drm_est3_modes()
2496 u8 mode; in drm_match_cea_mode() local
2501 for (mode = 0; mode < ARRAY_SIZE(edid_cea_modes); mode++) { in drm_match_cea_mode()
2502 const struct drm_display_mode *cea_mode = &edid_cea_modes[mode]; in drm_match_cea_mode()
2512 return mode + 1; in drm_match_cea_mode()
2561 u8 mode; in drm_match_hdmi_mode() local
2566 for (mode = 0; mode < ARRAY_SIZE(edid_4k_modes); mode++) { in drm_match_hdmi_mode()
2567 const struct drm_display_mode *hdmi_mode = &edid_4k_modes[mode]; in drm_match_hdmi_mode()
2577 return mode + 1; in drm_match_hdmi_mode()
2586 struct drm_display_mode *mode, *tmp; in add_alternate_cea_modes() local
2598 list_for_each_entry(mode, &connector->probed_modes, head) { in add_alternate_cea_modes()
2601 u8 mode_idx = drm_match_cea_mode(mode) - 1; in add_alternate_cea_modes()
2608 mode_idx = drm_match_hdmi_mode(mode) - 1; in add_alternate_cea_modes()
2623 if (mode->clock != clock1 && mode->clock != clock2) in add_alternate_cea_modes()
2631 newmode->flags |= mode->flags & DRM_MODE_FLAG_3D_MASK; in add_alternate_cea_modes()
2637 if (mode->clock != clock1) in add_alternate_cea_modes()
2645 list_for_each_entry_safe(mode, tmp, &list, head) { in add_alternate_cea_modes()
2646 list_del(&mode->head); in add_alternate_cea_modes()
2647 drm_mode_probed_add(connector, mode); in add_alternate_cea_modes()
2686 struct drm_display_mode *mode; in do_cea_modes() local
2687 mode = drm_display_mode_from_vic_index(connector, db, len, i); in do_cea_modes()
2688 if (mode) { in do_cea_modes()
2689 drm_mode_probed_add(connector, mode); in do_cea_modes()
2716 stereo_match_mandatory(const struct drm_display_mode *mode, in stereo_match_mandatory() argument
2719 unsigned int interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; in stereo_match_mandatory()
2721 return mode->hdisplay == stereo_mode->width && in stereo_match_mandatory()
2722 mode->vdisplay == stereo_mode->height && in stereo_match_mandatory()
2724 drm_mode_vrefresh(mode) == stereo_mode->vrefresh; in stereo_match_mandatory()
2730 const struct drm_display_mode *mode; in add_hdmi_mandatory_stereo_modes() local
2736 list_for_each_entry(mode, &connector->probed_modes, head) { in add_hdmi_mandatory_stereo_modes()
2741 if (!stereo_match_mandatory(mode, in add_hdmi_mandatory_stereo_modes()
2746 new_mode = drm_mode_duplicate(dev, mode); in add_hdmi_mandatory_stereo_modes()
3312 struct drm_display_mode *mode) in drm_av_sync_delay() argument
3314 int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_av_sync_delay()
3356 struct drm_display_mode *mode) in drm_select_eld() argument
3750 struct drm_display_mode *mode; in drm_add_modes_noedid() local
3773 mode = drm_mode_duplicate(dev, ptr); in drm_add_modes_noedid()
3774 if (mode) { in drm_add_modes_noedid()
3775 drm_mode_probed_add(connector, mode); in drm_add_modes_noedid()
3795 struct drm_display_mode *mode; in drm_set_preferred_mode() local
3797 list_for_each_entry(mode, &connector->probed_modes, head) { in drm_set_preferred_mode()
3798 if (mode->hdisplay == hpref && in drm_set_preferred_mode()
3799 mode->vdisplay == vpref) in drm_set_preferred_mode()
3800 mode->type |= DRM_MODE_TYPE_PREFERRED; in drm_set_preferred_mode()
3815 const struct drm_display_mode *mode) in drm_hdmi_avi_infoframe_from_display_mode() argument
3819 if (!frame || !mode) in drm_hdmi_avi_infoframe_from_display_mode()
3826 if (mode->flags & DRM_MODE_FLAG_DBLCLK) in drm_hdmi_avi_infoframe_from_display_mode()
3829 frame->video_code = drm_match_cea_mode(mode); in drm_hdmi_avi_infoframe_from_display_mode()
3837 if (mode->picture_aspect_ratio == HDMI_PICTURE_ASPECT_4_3 || in drm_hdmi_avi_infoframe_from_display_mode()
3838 mode->picture_aspect_ratio == HDMI_PICTURE_ASPECT_16_9) in drm_hdmi_avi_infoframe_from_display_mode()
3839 frame->picture_aspect = mode->picture_aspect_ratio; in drm_hdmi_avi_infoframe_from_display_mode()
3852 s3d_structure_from_display_mode(const struct drm_display_mode *mode) in s3d_structure_from_display_mode() argument
3854 u32 layout = mode->flags & DRM_MODE_FLAG_3D_MASK; in s3d_structure_from_display_mode()
3892 const struct drm_display_mode *mode) in drm_hdmi_vendor_infoframe_from_display_mode() argument
3898 if (!frame || !mode) in drm_hdmi_vendor_infoframe_from_display_mode()
3901 vic = drm_match_hdmi_mode(mode); in drm_hdmi_vendor_infoframe_from_display_mode()
3902 s3d_flags = mode->flags & DRM_MODE_FLAG_3D_MASK; in drm_hdmi_vendor_infoframe_from_display_mode()
3917 frame->s3d_struct = s3d_structure_from_display_mode(mode); in drm_hdmi_vendor_infoframe_from_display_mode()