Lines Matching full:mode
49 * drm_mode_debug_printmodeline - print a mode to dmesg
50 * @mode: mode to print
52 * Describe @mode using DRM_DEBUG.
54 void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) in drm_mode_debug_printmodeline() argument
56 DRM_DEBUG_KMS("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); in drm_mode_debug_printmodeline()
61 * drm_mode_create - create a new display mode
68 * Pointer to new mode on success, NULL on error.
83 * drm_mode_destroy - remove a mode
85 * @mode: mode to remove
87 * Release @mode's unique ID, then free it @mode structure itself using kfree.
89 void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode) in drm_mode_destroy() argument
91 if (!mode) in drm_mode_destroy()
94 kfree(mode); in drm_mode_destroy()
99 * drm_mode_probed_add - add a mode to a connector's probed_mode list
100 * @connector: connector the new mode
101 * @mode: mode data
103 * Add @mode to @connector's probed_mode list for later use. This list should
108 struct drm_display_mode *mode) in drm_mode_probed_add() argument
112 list_add_tail(&mode->head, &connector->probed_modes); in drm_mode_probed_add()
123 * @interlaced: whether to compute an interlaced mode
137 * The display mode object is allocated with drm_mode_create(). Returns NULL
138 * when no mode could be allocated.
326 /* ignore - just set the mode flag for interlaced */ in drm_cvt_mode()
331 /* Fill the mode line name */ in drm_cvt_mode()
350 * @interlaced: whether to compute an interlaced mode
362 * The display mode object is allocated with drm_mode_create(). Returns NULL
363 * when no mode could be allocated.
509 /* finally, pack the results in the mode struct */ in drm_gtf_mode_complex()
542 * @interlaced: whether to compute an interlaced mode
567 * The display mode object is allocated with drm_mode_create(). Returns NULL
568 * when no mode could be allocated.
586 * Fills out @dmode using the display mode specified in @vm.
627 * Fills out @vm using the display mode specified in @dmode.
701 * This function is expensive and should only be used, if only one mode is to be
723 pr_debug("%pOF: got %dx%d display mode\n", in of_get_drm_display_mode()
734 * drm_mode_set_name - set the name on a mode
735 * @mode: name will be set in this mode
737 * Set the name of @mode to a standard format which is <hdisplay>x<vdisplay>
740 void drm_mode_set_name(struct drm_display_mode *mode) in drm_mode_set_name() argument
742 bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_mode_set_name()
744 snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s", in drm_mode_set_name()
745 mode->hdisplay, mode->vdisplay, in drm_mode_set_name()
751 * drm_mode_vrefresh - get the vrefresh of a mode
752 * @mode: mode
758 int drm_mode_vrefresh(const struct drm_display_mode *mode) in drm_mode_vrefresh() argument
762 if (mode->htotal == 0 || mode->vtotal == 0) in drm_mode_vrefresh()
765 num = mode->clock * 1000; in drm_mode_vrefresh()
766 den = mode->htotal * mode->vtotal; in drm_mode_vrefresh()
768 if (mode->flags & DRM_MODE_FLAG_INTERLACE) in drm_mode_vrefresh()
770 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in drm_mode_vrefresh()
772 if (mode->vscan > 1) in drm_mode_vrefresh()
773 den *= mode->vscan; in drm_mode_vrefresh()
780 * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
781 * @mode: mode to query
785 * The vdisplay value will be doubled if the specified mode is a stereo mode of
788 void drm_mode_get_hv_timing(const struct drm_display_mode *mode, in drm_mode_get_hv_timing() argument
791 struct drm_display_mode adjusted = *mode; in drm_mode_get_hv_timing()
801 * @p: mode
879 * drm_mode_copy - copy the mode
880 * @dst: mode to overwrite
881 * @src: mode to copy
883 * Copy an existing mode into another mode, preserving the object id and
884 * list head of the destination mode.
896 * drm_mode_duplicate - allocate and duplicate an existing mode
897 * @dev: drm_device to allocate the duplicated mode for
898 * @mode: mode to duplicate
900 * Just allocate a new mode, copy the existing mode into it, and return
904 * Pointer to duplicated mode on success, NULL on error.
907 const struct drm_display_mode *mode) in drm_mode_duplicate() argument
915 drm_mode_copy(nmode, mode); in drm_mode_duplicate()
971 * @mode1: first mode
972 * @mode2: second mode
1016 * @mode1: first mode
1017 * @mode2: second mode
1038 * @mode1: first mode
1039 * @mode2: second mode
1059 * @mode1: first mode
1060 * @mode2: second mode
1078 drm_mode_validate_basic(const struct drm_display_mode *mode) in drm_mode_validate_basic() argument
1080 if (mode->type & ~DRM_MODE_TYPE_ALL) in drm_mode_validate_basic()
1083 if (mode->flags & ~DRM_MODE_FLAG_ALL) in drm_mode_validate_basic()
1086 if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) in drm_mode_validate_basic()
1089 if (mode->clock == 0) in drm_mode_validate_basic()
1092 if (mode->hdisplay == 0 || in drm_mode_validate_basic()
1093 mode->hsync_start < mode->hdisplay || in drm_mode_validate_basic()
1094 mode->hsync_end < mode->hsync_start || in drm_mode_validate_basic()
1095 mode->htotal < mode->hsync_end) in drm_mode_validate_basic()
1098 if (mode->vdisplay == 0 || in drm_mode_validate_basic()
1099 mode->vsync_start < mode->vdisplay || in drm_mode_validate_basic()
1100 mode->vsync_end < mode->vsync_start || in drm_mode_validate_basic()
1101 mode->vtotal < mode->vsync_end) in drm_mode_validate_basic()
1108 * drm_mode_validate_driver - make sure the mode is somewhat sane
1110 * @mode: mode to check
1112 * First do basic validation on the mode, and then allow the driver
1117 * The mode status
1121 const struct drm_display_mode *mode) in drm_mode_validate_driver() argument
1125 status = drm_mode_validate_basic(mode); in drm_mode_validate_driver()
1130 return dev->mode_config.funcs->mode_valid(dev, mode); in drm_mode_validate_driver()
1138 * @mode: mode to check
1143 * limitations of the DRM device/connector. If a mode is too big its status
1148 * The mode status
1151 drm_mode_validate_size(const struct drm_display_mode *mode, in drm_mode_validate_size() argument
1154 if (maxX > 0 && mode->hdisplay > maxX) in drm_mode_validate_size()
1157 if (maxY > 0 && mode->vdisplay > maxY) in drm_mode_validate_size()
1166 * @mode: mode to check
1170 * only mode, when the source doesn't support it.
1173 * The mode status
1176 drm_mode_validate_ycbcr420(const struct drm_display_mode *mode, in drm_mode_validate_ycbcr420() argument
1179 u8 vic = drm_match_cea_mode(mode); in drm_mode_validate_ycbcr420()
1250 * drm_mode_prune_invalid - remove invalid modes from mode list
1255 * This helper function can be used to prune a display mode list after
1257 * removed from the list, and if @verbose the status code and mode name is also
1263 struct drm_display_mode *mode, *t; in drm_mode_prune_invalid() local
1265 list_for_each_entry_safe(mode, t, mode_list, head) { in drm_mode_prune_invalid()
1266 if (mode->status != MODE_OK) { in drm_mode_prune_invalid()
1267 list_del(&mode->head); in drm_mode_prune_invalid()
1269 drm_mode_debug_printmodeline(mode); in drm_mode_prune_invalid()
1270 DRM_DEBUG_KMS("Not using %s mode: %s\n", in drm_mode_prune_invalid()
1271 mode->name, in drm_mode_prune_invalid()
1272 drm_get_mode_status_name(mode->status)); in drm_mode_prune_invalid()
1274 drm_mode_destroy(dev, mode); in drm_mode_prune_invalid()
1283 * @lh_a: list_head for first mode
1284 * @lh_b: list_head for second mode
1316 * drm_mode_sort - sort mode list
1328 * drm_connector_list_update - update the mode list for the connector
1332 * to the actual mode list. It compares the probed mode against the current
1345 struct drm_display_mode *mode; in drm_connector_list_update() local
1348 /* go through current modes checking for the new probed mode */ in drm_connector_list_update()
1349 list_for_each_entry(mode, &connector->modes, head) { in drm_connector_list_update()
1350 if (!drm_mode_equal(pmode, mode)) in drm_connector_list_update()
1356 * If the old matching mode is stale (ie. left over in drm_connector_list_update()
1365 * the mode added to the probed_modes list first. in drm_connector_list_update()
1367 if (mode->status == MODE_STALE) { in drm_connector_list_update()
1368 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1369 } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && in drm_connector_list_update()
1371 pmode->type |= mode->type; in drm_connector_list_update()
1372 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1374 mode->type |= pmode->type; in drm_connector_list_update()
1390 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_bpp() argument
1402 mode->bpp = bpp; in drm_mode_parse_cmdline_bpp()
1403 mode->bpp_specified = true; in drm_mode_parse_cmdline_bpp()
1409 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_refresh() argument
1421 mode->refresh = refresh; in drm_mode_parse_cmdline_refresh()
1422 mode->refresh_specified = true; in drm_mode_parse_cmdline_refresh()
1430 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_extra() argument
1440 mode->interlace = true; in drm_mode_parse_cmdline_extra()
1446 mode->margins = true; in drm_mode_parse_cmdline_extra()
1449 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1454 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1456 mode->force = DRM_FORCE_ON_DIGITAL; in drm_mode_parse_cmdline_extra()
1459 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1462 mode->force = DRM_FORCE_OFF; in drm_mode_parse_cmdline_extra()
1465 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1468 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1481 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_res_mode() argument
1525 mode); in drm_mode_parse_cmdline_res_mode()
1534 mode->xres = xres; in drm_mode_parse_cmdline_res_mode()
1535 mode->yres = yres; in drm_mode_parse_cmdline_res_mode()
1536 mode->cvt = cvt; in drm_mode_parse_cmdline_res_mode()
1537 mode->rb = rb; in drm_mode_parse_cmdline_res_mode()
1566 struct drm_cmdline_mode *mode) in drm_mode_parse_panel_orientation() argument
1579 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; in drm_mode_parse_panel_orientation()
1581 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP; in drm_mode_parse_panel_orientation()
1583 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP; in drm_mode_parse_panel_orientation()
1585 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP; in drm_mode_parse_panel_orientation()
1595 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_options() argument
1642 mode->tv_margins.right = margin; in drm_mode_parse_cmdline_options()
1647 mode->tv_margins.left = margin; in drm_mode_parse_cmdline_options()
1652 mode->tv_margins.top = margin; in drm_mode_parse_cmdline_options()
1657 mode->tv_margins.bottom = margin; in drm_mode_parse_cmdline_options()
1659 if (drm_mode_parse_panel_orientation(delim, mode)) in drm_mode_parse_cmdline_options()
1678 mode->rotation_reflection = rotation; in drm_mode_parse_cmdline_options()
1690 * @mode_option: optional per connector mode option
1692 * @mode: preallocated drm_cmdline_mode structure to fill out
1703 * Additionals options can be provided following the mode, using a comma to
1715 struct drm_cmdline_mode *mode) in drm_mode_parse_command_line_for_connector() argument
1726 memset(mode, 0, sizeof(*mode)); in drm_mode_parse_command_line_for_connector()
1727 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; in drm_mode_parse_command_line_for_connector()
1761 /* First check for a named mode */ in drm_mode_parse_command_line_for_connector()
1768 strcpy(mode->name, drm_named_modes_whitelist[i]); in drm_mode_parse_command_line_for_connector()
1769 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1774 /* No named mode? Check for a normal mode argument, e.g. 1024x768 */ in drm_mode_parse_command_line_for_connector()
1775 if (!mode->specified && isdigit(name[0])) { in drm_mode_parse_command_line_for_connector()
1779 mode); in drm_mode_parse_command_line_for_connector()
1783 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1786 /* No mode? Check for freestanding extras and/or options */ in drm_mode_parse_command_line_for_connector()
1787 if (!mode->specified) { in drm_mode_parse_command_line_for_connector()
1802 ret = drm_mode_parse_cmdline_bpp(bpp_ptr, &bpp_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1806 mode->bpp_specified = true; in drm_mode_parse_command_line_for_connector()
1811 &refresh_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1815 mode->refresh_specified = true; in drm_mode_parse_command_line_for_connector()
1836 connector, mode); in drm_mode_parse_command_line_for_connector()
1844 connector, mode); in drm_mode_parse_command_line_for_connector()
1854 * drm_mode_create_from_cmdline_mode - convert a command line modeline into a DRM display mode
1855 * @dev: DRM device to create the new mode for
1859 * Pointer to converted mode on success, NULL on error.
1865 struct drm_display_mode *mode; in drm_mode_create_from_cmdline_mode() local
1868 mode = drm_cvt_mode(dev, in drm_mode_create_from_cmdline_mode()
1874 mode = drm_gtf_mode(dev, in drm_mode_create_from_cmdline_mode()
1879 if (!mode) in drm_mode_create_from_cmdline_mode()
1882 mode->type |= DRM_MODE_TYPE_USERDEF; in drm_mode_create_from_cmdline_mode()
1885 drm_mode_fixup_1366x768(mode); in drm_mode_create_from_cmdline_mode()
1886 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); in drm_mode_create_from_cmdline_mode()
1887 return mode; in drm_mode_create_from_cmdline_mode()
1931 WARN(1, "Invalid aspect ratio (0%x) on mode\n", in drm_mode_convert_to_umode()
1986 * flags for kernel-mode, but in picture_aspect_ratio. in drm_mode_convert_umode()
2024 * @mode: video mode to be tested.
2027 * true if the mode can be supported in YCBCR420 format
2031 const struct drm_display_mode *mode) in drm_mode_is_420_only() argument
2033 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_only()
2044 * @mode: video mode to be tested.
2047 * true if the mode can be support YCBCR420 format
2051 const struct drm_display_mode *mode) in drm_mode_is_420_also() argument
2053 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_also()
2063 * @mode: video mode to be tested.
2066 * true if the mode can be supported in YCBCR420 format
2070 const struct drm_display_mode *mode) in drm_mode_is_420() argument
2072 return drm_mode_is_420_only(display, mode) || in drm_mode_is_420()
2073 drm_mode_is_420_also(display, mode); in drm_mode_is_420()