• Home
  • Raw
  • Download

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 if (mode->flags & DRM_MODE_FLAG_INTERLACE) in drm_mode_vrefresh()
767 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in drm_mode_vrefresh()
769 if (mode->vscan > 1) in drm_mode_vrefresh()
770 den *= mode->vscan; in drm_mode_vrefresh()
772 if (check_mul_overflow(mode->clock, num, &num)) in drm_mode_vrefresh()
775 if (check_mul_overflow(mode->htotal * mode->vtotal, den, &den)) in drm_mode_vrefresh()
783 * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
784 * @mode: mode to query
788 * The vdisplay value will be doubled if the specified mode is a stereo mode of
791 void drm_mode_get_hv_timing(const struct drm_display_mode *mode, in drm_mode_get_hv_timing() argument
794 struct drm_display_mode adjusted = *mode; in drm_mode_get_hv_timing()
804 * @p: mode
882 * drm_mode_copy - copy the mode
883 * @dst: mode to overwrite
884 * @src: mode to copy
886 * Copy an existing mode into another mode, preserving the object id and
887 * list head of the destination mode.
899 * drm_mode_duplicate - allocate and duplicate an existing mode
900 * @dev: drm_device to allocate the duplicated mode for
901 * @mode: mode to duplicate
903 * Just allocate a new mode, copy the existing mode into it, and return
907 * Pointer to duplicated mode on success, NULL on error.
910 const struct drm_display_mode *mode) in drm_mode_duplicate() argument
918 drm_mode_copy(nmode, mode); in drm_mode_duplicate()
974 * @mode1: first mode
975 * @mode2: second mode
1019 * @mode1: first mode
1020 * @mode2: second mode
1041 * @mode1: first mode
1042 * @mode2: second mode
1062 * @mode1: first mode
1063 * @mode2: second mode
1081 drm_mode_validate_basic(const struct drm_display_mode *mode) in drm_mode_validate_basic() argument
1083 if (mode->type & ~DRM_MODE_TYPE_ALL) in drm_mode_validate_basic()
1086 if (mode->flags & ~DRM_MODE_FLAG_ALL) in drm_mode_validate_basic()
1089 if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) in drm_mode_validate_basic()
1092 if (mode->clock == 0) in drm_mode_validate_basic()
1095 if (mode->hdisplay == 0 || in drm_mode_validate_basic()
1096 mode->hsync_start < mode->hdisplay || in drm_mode_validate_basic()
1097 mode->hsync_end < mode->hsync_start || in drm_mode_validate_basic()
1098 mode->htotal < mode->hsync_end) in drm_mode_validate_basic()
1101 if (mode->vdisplay == 0 || in drm_mode_validate_basic()
1102 mode->vsync_start < mode->vdisplay || in drm_mode_validate_basic()
1103 mode->vsync_end < mode->vsync_start || in drm_mode_validate_basic()
1104 mode->vtotal < mode->vsync_end) in drm_mode_validate_basic()
1111 * drm_mode_validate_driver - make sure the mode is somewhat sane
1113 * @mode: mode to check
1115 * First do basic validation on the mode, and then allow the driver
1120 * The mode status
1124 const struct drm_display_mode *mode) in drm_mode_validate_driver() argument
1128 status = drm_mode_validate_basic(mode); in drm_mode_validate_driver()
1133 return dev->mode_config.funcs->mode_valid(dev, mode); in drm_mode_validate_driver()
1141 * @mode: mode to check
1146 * limitations of the DRM device/connector. If a mode is too big its status
1151 * The mode status
1154 drm_mode_validate_size(const struct drm_display_mode *mode, in drm_mode_validate_size() argument
1157 if (maxX > 0 && mode->hdisplay > maxX) in drm_mode_validate_size()
1160 if (maxY > 0 && mode->vdisplay > maxY) in drm_mode_validate_size()
1169 * @mode: mode to check
1173 * only mode, when the source doesn't support it.
1176 * The mode status
1179 drm_mode_validate_ycbcr420(const struct drm_display_mode *mode, in drm_mode_validate_ycbcr420() argument
1182 u8 vic = drm_match_cea_mode(mode); in drm_mode_validate_ycbcr420()
1253 * drm_mode_prune_invalid - remove invalid modes from mode list
1258 * This helper function can be used to prune a display mode list after
1260 * removed from the list, and if @verbose the status code and mode name is also
1266 struct drm_display_mode *mode, *t; in drm_mode_prune_invalid() local
1268 list_for_each_entry_safe(mode, t, mode_list, head) { in drm_mode_prune_invalid()
1269 if (mode->status != MODE_OK) { in drm_mode_prune_invalid()
1270 list_del(&mode->head); in drm_mode_prune_invalid()
1272 drm_mode_debug_printmodeline(mode); in drm_mode_prune_invalid()
1273 DRM_DEBUG_KMS("Not using %s mode: %s\n", in drm_mode_prune_invalid()
1274 mode->name, in drm_mode_prune_invalid()
1275 drm_get_mode_status_name(mode->status)); in drm_mode_prune_invalid()
1277 drm_mode_destroy(dev, mode); in drm_mode_prune_invalid()
1286 * @lh_a: list_head for first mode
1287 * @lh_b: list_head for second mode
1320 * drm_mode_sort - sort mode list
1332 * drm_connector_list_update - update the mode list for the connector
1336 * to the actual mode list. It compares the probed mode against the current
1349 struct drm_display_mode *mode; in drm_connector_list_update() local
1352 /* go through current modes checking for the new probed mode */ in drm_connector_list_update()
1353 list_for_each_entry(mode, &connector->modes, head) { in drm_connector_list_update()
1354 if (!drm_mode_equal(pmode, mode)) in drm_connector_list_update()
1360 * If the old matching mode is stale (ie. left over in drm_connector_list_update()
1369 * the mode added to the probed_modes list first. in drm_connector_list_update()
1371 if (mode->status == MODE_STALE) { in drm_connector_list_update()
1372 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1373 } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && in drm_connector_list_update()
1375 pmode->type |= mode->type; in drm_connector_list_update()
1376 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1378 mode->type |= pmode->type; in drm_connector_list_update()
1394 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_bpp() argument
1406 mode->bpp = bpp; in drm_mode_parse_cmdline_bpp()
1407 mode->bpp_specified = true; in drm_mode_parse_cmdline_bpp()
1413 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_refresh() argument
1425 mode->refresh = refresh; in drm_mode_parse_cmdline_refresh()
1426 mode->refresh_specified = true; in drm_mode_parse_cmdline_refresh()
1434 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_extra() argument
1444 mode->interlace = true; in drm_mode_parse_cmdline_extra()
1450 mode->margins = true; in drm_mode_parse_cmdline_extra()
1453 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1458 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1460 mode->force = DRM_FORCE_ON_DIGITAL; in drm_mode_parse_cmdline_extra()
1463 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1466 mode->force = DRM_FORCE_OFF; in drm_mode_parse_cmdline_extra()
1469 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1472 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1485 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_res_mode() argument
1529 mode); in drm_mode_parse_cmdline_res_mode()
1538 mode->xres = xres; in drm_mode_parse_cmdline_res_mode()
1539 mode->yres = yres; in drm_mode_parse_cmdline_res_mode()
1540 mode->cvt = cvt; in drm_mode_parse_cmdline_res_mode()
1541 mode->rb = rb; in drm_mode_parse_cmdline_res_mode()
1570 struct drm_cmdline_mode *mode) in drm_mode_parse_panel_orientation() argument
1583 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; in drm_mode_parse_panel_orientation()
1585 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP; in drm_mode_parse_panel_orientation()
1587 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP; in drm_mode_parse_panel_orientation()
1589 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP; in drm_mode_parse_panel_orientation()
1599 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_options() argument
1646 mode->tv_margins.right = margin; in drm_mode_parse_cmdline_options()
1651 mode->tv_margins.left = margin; in drm_mode_parse_cmdline_options()
1656 mode->tv_margins.top = margin; in drm_mode_parse_cmdline_options()
1661 mode->tv_margins.bottom = margin; in drm_mode_parse_cmdline_options()
1663 if (drm_mode_parse_panel_orientation(delim, mode)) in drm_mode_parse_cmdline_options()
1682 mode->rotation_reflection = rotation; in drm_mode_parse_cmdline_options()
1694 * @mode_option: optional per connector mode option
1696 * @mode: preallocated drm_cmdline_mode structure to fill out
1707 * Additionals options can be provided following the mode, using a comma to
1719 struct drm_cmdline_mode *mode) in drm_mode_parse_command_line_for_connector() argument
1730 memset(mode, 0, sizeof(*mode)); in drm_mode_parse_command_line_for_connector()
1731 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; in drm_mode_parse_command_line_for_connector()
1765 /* First check for a named mode */ in drm_mode_parse_command_line_for_connector()
1772 strcpy(mode->name, drm_named_modes_whitelist[i]); in drm_mode_parse_command_line_for_connector()
1773 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1778 /* No named mode? Check for a normal mode argument, e.g. 1024x768 */ in drm_mode_parse_command_line_for_connector()
1779 if (!mode->specified && isdigit(name[0])) { in drm_mode_parse_command_line_for_connector()
1783 mode); in drm_mode_parse_command_line_for_connector()
1787 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1790 /* No mode? Check for freestanding extras and/or options */ in drm_mode_parse_command_line_for_connector()
1791 if (!mode->specified) { in drm_mode_parse_command_line_for_connector()
1806 ret = drm_mode_parse_cmdline_bpp(bpp_ptr, &bpp_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1810 mode->bpp_specified = true; in drm_mode_parse_command_line_for_connector()
1815 &refresh_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1819 mode->refresh_specified = true; in drm_mode_parse_command_line_for_connector()
1840 connector, mode); in drm_mode_parse_command_line_for_connector()
1848 connector, mode); in drm_mode_parse_command_line_for_connector()
1858 * drm_mode_create_from_cmdline_mode - convert a command line modeline into a DRM display mode
1859 * @dev: DRM device to create the new mode for
1863 * Pointer to converted mode on success, NULL on error.
1869 struct drm_display_mode *mode; in drm_mode_create_from_cmdline_mode() local
1872 mode = drm_cvt_mode(dev, in drm_mode_create_from_cmdline_mode()
1878 mode = drm_gtf_mode(dev, in drm_mode_create_from_cmdline_mode()
1883 if (!mode) in drm_mode_create_from_cmdline_mode()
1886 mode->type |= DRM_MODE_TYPE_USERDEF; in drm_mode_create_from_cmdline_mode()
1889 drm_mode_fixup_1366x768(mode); in drm_mode_create_from_cmdline_mode()
1890 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); in drm_mode_create_from_cmdline_mode()
1891 return mode; in drm_mode_create_from_cmdline_mode()
1935 WARN(1, "Invalid aspect ratio (0%x) on mode\n", in drm_mode_convert_to_umode()
1990 * flags for kernel-mode, but in picture_aspect_ratio. in drm_mode_convert_umode()
2028 * @mode: video mode to be tested.
2031 * true if the mode can be supported in YCBCR420 format
2035 const struct drm_display_mode *mode) in drm_mode_is_420_only() argument
2037 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_only()
2048 * @mode: video mode to be tested.
2051 * true if the mode can be support YCBCR420 format
2055 const struct drm_display_mode *mode) in drm_mode_is_420_also() argument
2057 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_also()
2067 * @mode: video mode to be tested.
2070 * true if the mode can be supported in YCBCR420 format
2074 const struct drm_display_mode *mode) in drm_mode_is_420() argument
2076 return drm_mode_is_420_only(display, mode) || in drm_mode_is_420()
2077 drm_mode_is_420_also(display, mode); in drm_mode_is_420()