Lines Matching refs:mode
50 void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) in drm_mode_debug_printmodeline() argument
52 DRM_DEBUG_KMS("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); in drm_mode_debug_printmodeline()
90 void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode) in drm_mode_destroy() argument
92 if (!mode) in drm_mode_destroy()
95 drm_mode_object_unregister(dev, &mode->base); in drm_mode_destroy()
97 kfree(mode); in drm_mode_destroy()
111 struct drm_display_mode *mode) in drm_mode_probed_add() argument
115 list_add_tail(&mode->head, &connector->probed_modes); in drm_mode_probed_add()
736 void drm_mode_set_name(struct drm_display_mode *mode) in drm_mode_set_name() argument
738 bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_mode_set_name()
740 snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s", in drm_mode_set_name()
741 mode->hdisplay, mode->vdisplay, in drm_mode_set_name()
754 int drm_mode_hsync(const struct drm_display_mode *mode) in drm_mode_hsync() argument
758 if (mode->hsync) in drm_mode_hsync()
759 return mode->hsync; in drm_mode_hsync()
761 if (mode->htotal < 0) in drm_mode_hsync()
764 calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */ in drm_mode_hsync()
780 int drm_mode_vrefresh(const struct drm_display_mode *mode) in drm_mode_vrefresh() argument
784 if (mode->vrefresh > 0) in drm_mode_vrefresh()
785 refresh = mode->vrefresh; in drm_mode_vrefresh()
786 else if (mode->htotal > 0 && mode->vtotal > 0) { in drm_mode_vrefresh()
789 num = mode->clock * 1000; in drm_mode_vrefresh()
790 den = mode->htotal * mode->vtotal; in drm_mode_vrefresh()
792 if (mode->flags & DRM_MODE_FLAG_INTERLACE) in drm_mode_vrefresh()
794 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in drm_mode_vrefresh()
796 if (mode->vscan > 1) in drm_mode_vrefresh()
797 den *= mode->vscan; in drm_mode_vrefresh()
814 void drm_mode_get_hv_timing(const struct drm_display_mode *mode, in drm_mode_get_hv_timing() argument
817 struct drm_display_mode adjusted = *mode; in drm_mode_get_hv_timing()
935 const struct drm_display_mode *mode) in drm_mode_duplicate() argument
943 drm_mode_copy(nmode, mode); in drm_mode_duplicate()
1106 drm_mode_validate_basic(const struct drm_display_mode *mode) in drm_mode_validate_basic() argument
1108 if (mode->type & ~DRM_MODE_TYPE_ALL) in drm_mode_validate_basic()
1111 if (mode->flags & ~DRM_MODE_FLAG_ALL) in drm_mode_validate_basic()
1114 if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) in drm_mode_validate_basic()
1117 if (mode->clock == 0) in drm_mode_validate_basic()
1120 if (mode->hdisplay == 0 || in drm_mode_validate_basic()
1121 mode->hsync_start < mode->hdisplay || in drm_mode_validate_basic()
1122 mode->hsync_end < mode->hsync_start || in drm_mode_validate_basic()
1123 mode->htotal < mode->hsync_end) in drm_mode_validate_basic()
1126 if (mode->vdisplay == 0 || in drm_mode_validate_basic()
1127 mode->vsync_start < mode->vdisplay || in drm_mode_validate_basic()
1128 mode->vsync_end < mode->vsync_start || in drm_mode_validate_basic()
1129 mode->vtotal < mode->vsync_end) in drm_mode_validate_basic()
1149 const struct drm_display_mode *mode) in drm_mode_validate_driver() argument
1153 status = drm_mode_validate_basic(mode); in drm_mode_validate_driver()
1158 return dev->mode_config.funcs->mode_valid(dev, mode); in drm_mode_validate_driver()
1179 drm_mode_validate_size(const struct drm_display_mode *mode, in drm_mode_validate_size() argument
1182 if (maxX > 0 && mode->hdisplay > maxX) in drm_mode_validate_size()
1185 if (maxY > 0 && mode->vdisplay > maxY) in drm_mode_validate_size()
1204 drm_mode_validate_ycbcr420(const struct drm_display_mode *mode, in drm_mode_validate_ycbcr420() argument
1207 u8 vic = drm_match_cea_mode(mode); in drm_mode_validate_ycbcr420()
1291 struct drm_display_mode *mode, *t; in drm_mode_prune_invalid() local
1293 list_for_each_entry_safe(mode, t, mode_list, head) { in drm_mode_prune_invalid()
1294 if (mode->status != MODE_OK) { in drm_mode_prune_invalid()
1295 list_del(&mode->head); in drm_mode_prune_invalid()
1297 drm_mode_debug_printmodeline(mode); in drm_mode_prune_invalid()
1299 mode->name, in drm_mode_prune_invalid()
1300 drm_get_mode_status_name(mode->status)); in drm_mode_prune_invalid()
1302 drm_mode_destroy(dev, mode); in drm_mode_prune_invalid()
1373 struct drm_display_mode *mode; in drm_connector_list_update() local
1377 list_for_each_entry(mode, &connector->modes, head) { in drm_connector_list_update()
1378 if (!drm_mode_equal(pmode, mode)) in drm_connector_list_update()
1395 if (mode->status == MODE_STALE) { in drm_connector_list_update()
1396 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1397 } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && in drm_connector_list_update()
1399 pmode->type |= mode->type; in drm_connector_list_update()
1400 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1402 mode->type |= pmode->type; in drm_connector_list_update()
1440 struct drm_cmdline_mode *mode) in drm_mode_parse_command_line_for_connector() argument
1457 mode->specified = false; in drm_mode_parse_command_line_for_connector()
1559 mode->specified = false; in drm_mode_parse_command_line_for_connector()
1564 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1565 mode->xres = xres; in drm_mode_parse_command_line_for_connector()
1566 mode->yres = yres; in drm_mode_parse_command_line_for_connector()
1570 mode->refresh_specified = true; in drm_mode_parse_command_line_for_connector()
1571 mode->refresh = refresh; in drm_mode_parse_command_line_for_connector()
1575 mode->bpp_specified = true; in drm_mode_parse_command_line_for_connector()
1576 mode->bpp = bpp; in drm_mode_parse_command_line_for_connector()
1578 mode->rb = rb; in drm_mode_parse_command_line_for_connector()
1579 mode->cvt = cvt; in drm_mode_parse_command_line_for_connector()
1580 mode->interlace = interlace; in drm_mode_parse_command_line_for_connector()
1581 mode->margins = margins; in drm_mode_parse_command_line_for_connector()
1582 mode->force = force; in drm_mode_parse_command_line_for_connector()
1600 struct drm_display_mode *mode; in drm_mode_create_from_cmdline_mode() local
1603 mode = drm_cvt_mode(dev, in drm_mode_create_from_cmdline_mode()
1609 mode = drm_gtf_mode(dev, in drm_mode_create_from_cmdline_mode()
1614 if (!mode) in drm_mode_create_from_cmdline_mode()
1617 mode->type |= DRM_MODE_TYPE_USERDEF; in drm_mode_create_from_cmdline_mode()
1620 drm_mode_fixup_1366x768(mode); in drm_mode_create_from_cmdline_mode()
1621 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); in drm_mode_create_from_cmdline_mode()
1622 return mode; in drm_mode_create_from_cmdline_mode()
1769 const struct drm_display_mode *mode) in drm_mode_is_420_only() argument
1771 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_only()
1789 const struct drm_display_mode *mode) in drm_mode_is_420_also() argument
1791 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_also()
1808 const struct drm_display_mode *mode) in drm_mode_is_420() argument
1810 return drm_mode_is_420_only(display, mode) || in drm_mode_is_420()
1811 drm_mode_is_420_also(display, mode); in drm_mode_is_420()