Lines Matching full:mode

52  * drm_mode_debug_printmodeline - print a mode to dmesg
53 * @mode: mode to print
55 * Describe @mode using DRM_DEBUG.
57 void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) in drm_mode_debug_printmodeline() argument
59 DRM_DEBUG_KMS("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); in drm_mode_debug_printmodeline()
64 * drm_mode_create - create a new display mode
71 * Pointer to new mode on success, NULL on error.
86 * drm_mode_destroy - remove a mode
88 * @mode: mode to remove
90 * Release @mode's unique ID, then free it @mode structure itself using kfree.
92 void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode) in drm_mode_destroy() argument
94 if (!mode) in drm_mode_destroy()
97 kfree(mode); in drm_mode_destroy()
102 * drm_mode_probed_add - add a mode to a connector's probed_mode list
103 * @connector: connector the new mode
104 * @mode: mode data
106 * Add @mode to @connector's probed_mode list for later use. This list should
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()
126 * @interlaced: whether to compute an interlaced mode
140 * The display mode object is allocated with drm_mode_create(). Returns NULL
141 * when no mode could be allocated.
329 /* ignore - just set the mode flag for interlaced */ in drm_cvt_mode()
334 /* Fill the mode line name */ in drm_cvt_mode()
353 * @interlaced: whether to compute an interlaced mode
365 * The display mode object is allocated with drm_mode_create(). Returns NULL
366 * when no mode could be allocated.
512 /* finally, pack the results in the mode struct */ in drm_gtf_mode_complex()
545 * @interlaced: whether to compute an interlaced mode
570 * The display mode object is allocated with drm_mode_create(). Returns NULL
571 * when no mode could be allocated.
589 * Fills out @dmode using the display mode specified in @vm.
630 * Fills out @vm using the display mode specified in @dmode.
704 * This function is expensive and should only be used, if only one mode is to be
726 pr_debug("%pOF: got %dx%d display mode\n", in of_get_drm_display_mode()
741 * are read and set on the display mode.
785 * drm_mode_set_name - set the name on a mode
786 * @mode: name will be set in this mode
788 * Set the name of @mode to a standard format which is <hdisplay>x<vdisplay>
791 void drm_mode_set_name(struct drm_display_mode *mode) in drm_mode_set_name() argument
793 bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_mode_set_name()
795 snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s", in drm_mode_set_name()
796 mode->hdisplay, mode->vdisplay, in drm_mode_set_name()
802 * drm_mode_vrefresh - get the vrefresh of a mode
803 * @mode: mode
809 int drm_mode_vrefresh(const struct drm_display_mode *mode) in drm_mode_vrefresh() argument
813 if (mode->htotal == 0 || mode->vtotal == 0) in drm_mode_vrefresh()
816 num = mode->clock; in drm_mode_vrefresh()
817 den = mode->htotal * mode->vtotal; in drm_mode_vrefresh()
819 if (mode->flags & DRM_MODE_FLAG_INTERLACE) in drm_mode_vrefresh()
821 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in drm_mode_vrefresh()
823 if (mode->vscan > 1) in drm_mode_vrefresh()
824 den *= mode->vscan; in drm_mode_vrefresh()
831 * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
832 * @mode: mode to query
836 * The vdisplay value will be doubled if the specified mode is a stereo mode of
839 void drm_mode_get_hv_timing(const struct drm_display_mode *mode, in drm_mode_get_hv_timing() argument
844 drm_mode_init(&adjusted, mode); in drm_mode_get_hv_timing()
854 * @p: mode
932 * drm_mode_copy - copy the mode
933 * @dst: mode to overwrite
934 * @src: mode to copy
936 * Copy an existing mode into another mode, preserving the
937 * list head of the destination mode.
949 * drm_mode_init - initialize the mode from another mode
950 * @dst: mode to overwrite
951 * @src: mode to copy
953 * Copy an existing mode into another mode, zeroing the
954 * list head of the destination mode. Typically used
966 * drm_mode_duplicate - allocate and duplicate an existing mode
967 * @dev: drm_device to allocate the duplicated mode for
968 * @mode: mode to duplicate
970 * Just allocate a new mode, copy the existing mode into it, and return
974 * Pointer to duplicated mode on success, NULL on error.
977 const struct drm_display_mode *mode) in drm_mode_duplicate() argument
985 drm_mode_copy(nmode, mode); in drm_mode_duplicate()
1041 * @mode1: first mode
1042 * @mode2: second mode
1086 * @mode1: first mode
1087 * @mode2: second mode
1108 * @mode1: first mode
1109 * @mode2: second mode
1129 * @mode1: first mode
1130 * @mode2: second mode
1148 drm_mode_validate_basic(const struct drm_display_mode *mode) in drm_mode_validate_basic() argument
1150 if (mode->type & ~DRM_MODE_TYPE_ALL) in drm_mode_validate_basic()
1153 if (mode->flags & ~DRM_MODE_FLAG_ALL) in drm_mode_validate_basic()
1156 if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) in drm_mode_validate_basic()
1159 if (mode->clock == 0) in drm_mode_validate_basic()
1162 if (mode->hdisplay == 0 || in drm_mode_validate_basic()
1163 mode->hsync_start < mode->hdisplay || in drm_mode_validate_basic()
1164 mode->hsync_end < mode->hsync_start || in drm_mode_validate_basic()
1165 mode->htotal < mode->hsync_end) in drm_mode_validate_basic()
1168 if (mode->vdisplay == 0 || in drm_mode_validate_basic()
1169 mode->vsync_start < mode->vdisplay || in drm_mode_validate_basic()
1170 mode->vsync_end < mode->vsync_start || in drm_mode_validate_basic()
1171 mode->vtotal < mode->vsync_end) in drm_mode_validate_basic()
1178 * drm_mode_validate_driver - make sure the mode is somewhat sane
1180 * @mode: mode to check
1182 * First do basic validation on the mode, and then allow the driver
1187 * The mode status
1191 const struct drm_display_mode *mode) in drm_mode_validate_driver() argument
1195 status = drm_mode_validate_basic(mode); in drm_mode_validate_driver()
1200 return dev->mode_config.funcs->mode_valid(dev, mode); in drm_mode_validate_driver()
1208 * @mode: mode to check
1213 * limitations of the DRM device/connector. If a mode is too big its status
1218 * The mode status
1221 drm_mode_validate_size(const struct drm_display_mode *mode, in drm_mode_validate_size() argument
1224 if (maxX > 0 && mode->hdisplay > maxX) in drm_mode_validate_size()
1227 if (maxY > 0 && mode->vdisplay > maxY) in drm_mode_validate_size()
1236 * @mode: mode to check
1240 * only mode, when the source doesn't support it.
1243 * The mode status
1246 drm_mode_validate_ycbcr420(const struct drm_display_mode *mode, in drm_mode_validate_ycbcr420() argument
1250 drm_mode_is_420_only(&connector->display_info, mode)) in drm_mode_validate_ycbcr420()
1315 * drm_mode_prune_invalid - remove invalid modes from mode list
1320 * This helper function can be used to prune a display mode list after
1322 * removed from the list, and if @verbose the status code and mode name is also
1328 struct drm_display_mode *mode, *t; in drm_mode_prune_invalid() local
1330 list_for_each_entry_safe(mode, t, mode_list, head) { in drm_mode_prune_invalid()
1331 if (mode->status != MODE_OK) { in drm_mode_prune_invalid()
1332 list_del(&mode->head); in drm_mode_prune_invalid()
1333 if (mode->type & DRM_MODE_TYPE_USERDEF) { in drm_mode_prune_invalid()
1334 drm_warn(dev, "User-defined mode not supported: " in drm_mode_prune_invalid()
1335 DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); in drm_mode_prune_invalid()
1338 drm_mode_debug_printmodeline(mode); in drm_mode_prune_invalid()
1339 DRM_DEBUG_KMS("Not using %s mode: %s\n", in drm_mode_prune_invalid()
1340 mode->name, in drm_mode_prune_invalid()
1341 drm_get_mode_status_name(mode->status)); in drm_mode_prune_invalid()
1343 drm_mode_destroy(dev, mode); in drm_mode_prune_invalid()
1352 * @lh_a: list_head for first mode
1353 * @lh_b: list_head for second mode
1386 * drm_mode_sort - sort mode list
1398 * drm_connector_list_update - update the mode list for the connector
1402 * to the actual mode list. It compares the probed mode against the current
1415 struct drm_display_mode *mode; in drm_connector_list_update() local
1418 /* go through current modes checking for the new probed mode */ in drm_connector_list_update()
1419 list_for_each_entry(mode, &connector->modes, head) { in drm_connector_list_update()
1420 if (!drm_mode_equal(pmode, mode)) in drm_connector_list_update()
1426 * If the old matching mode is stale (ie. left over in drm_connector_list_update()
1435 * the mode added to the probed_modes list first. in drm_connector_list_update()
1437 if (mode->status == MODE_STALE) { in drm_connector_list_update()
1438 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1439 } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && in drm_connector_list_update()
1441 pmode->type |= mode->type; in drm_connector_list_update()
1442 drm_mode_copy(mode, pmode); in drm_connector_list_update()
1444 mode->type |= pmode->type; in drm_connector_list_update()
1460 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_bpp() argument
1472 mode->bpp = bpp; in drm_mode_parse_cmdline_bpp()
1473 mode->bpp_specified = true; in drm_mode_parse_cmdline_bpp()
1479 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_refresh() argument
1491 mode->refresh = refresh; in drm_mode_parse_cmdline_refresh()
1492 mode->refresh_specified = true; in drm_mode_parse_cmdline_refresh()
1500 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_extra() argument
1510 mode->interlace = true; in drm_mode_parse_cmdline_extra()
1516 mode->margins = true; in drm_mode_parse_cmdline_extra()
1519 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1524 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1526 mode->force = DRM_FORCE_ON_DIGITAL; in drm_mode_parse_cmdline_extra()
1529 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1532 mode->force = DRM_FORCE_OFF; in drm_mode_parse_cmdline_extra()
1535 if (mode->force != DRM_FORCE_UNSPECIFIED) in drm_mode_parse_cmdline_extra()
1538 mode->force = DRM_FORCE_ON; in drm_mode_parse_cmdline_extra()
1551 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_res_mode() argument
1595 mode); in drm_mode_parse_cmdline_res_mode()
1604 mode->xres = xres; in drm_mode_parse_cmdline_res_mode()
1605 mode->yres = yres; in drm_mode_parse_cmdline_res_mode()
1606 mode->cvt = cvt; in drm_mode_parse_cmdline_res_mode()
1607 mode->rb = rb; in drm_mode_parse_cmdline_res_mode()
1636 struct drm_cmdline_mode *mode) in drm_mode_parse_panel_orientation() argument
1649 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_NORMAL; in drm_mode_parse_panel_orientation()
1651 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP; in drm_mode_parse_panel_orientation()
1653 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_LEFT_UP; in drm_mode_parse_panel_orientation()
1655 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP; in drm_mode_parse_panel_orientation()
1665 struct drm_cmdline_mode *mode) in drm_mode_parse_cmdline_options() argument
1712 mode->tv_margins.right = margin; in drm_mode_parse_cmdline_options()
1717 mode->tv_margins.left = margin; in drm_mode_parse_cmdline_options()
1722 mode->tv_margins.top = margin; in drm_mode_parse_cmdline_options()
1727 mode->tv_margins.bottom = margin; in drm_mode_parse_cmdline_options()
1729 if (drm_mode_parse_panel_orientation(delim, mode)) in drm_mode_parse_cmdline_options()
1748 mode->rotation_reflection = rotation; in drm_mode_parse_cmdline_options()
1760 * @mode_option: optional per connector mode option
1762 * @mode: preallocated drm_cmdline_mode structure to fill out
1773 * Additionals options can be provided following the mode, using a comma to
1785 struct drm_cmdline_mode *mode) in drm_mode_parse_command_line_for_connector() argument
1796 memset(mode, 0, sizeof(*mode)); in drm_mode_parse_command_line_for_connector()
1797 mode->panel_orientation = DRM_MODE_PANEL_ORIENTATION_UNKNOWN; in drm_mode_parse_command_line_for_connector()
1831 /* First check for a named mode */ in drm_mode_parse_command_line_for_connector()
1838 strcpy(mode->name, drm_named_modes_whitelist[i]); in drm_mode_parse_command_line_for_connector()
1839 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1844 /* No named mode? Check for a normal mode argument, e.g. 1024x768 */ in drm_mode_parse_command_line_for_connector()
1845 if (!mode->specified && isdigit(name[0])) { in drm_mode_parse_command_line_for_connector()
1849 mode); in drm_mode_parse_command_line_for_connector()
1853 mode->specified = true; in drm_mode_parse_command_line_for_connector()
1856 /* No mode? Check for freestanding extras and/or options */ in drm_mode_parse_command_line_for_connector()
1857 if (!mode->specified) { in drm_mode_parse_command_line_for_connector()
1872 ret = drm_mode_parse_cmdline_bpp(bpp_ptr, &bpp_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1876 mode->bpp_specified = true; in drm_mode_parse_command_line_for_connector()
1881 &refresh_end_ptr, mode); in drm_mode_parse_command_line_for_connector()
1885 mode->refresh_specified = true; in drm_mode_parse_command_line_for_connector()
1906 connector, mode); in drm_mode_parse_command_line_for_connector()
1914 connector, mode); in drm_mode_parse_command_line_for_connector()
1924 * drm_mode_create_from_cmdline_mode - convert a command line modeline into a DRM display mode
1925 * @dev: DRM device to create the new mode for
1929 * Pointer to converted mode on success, NULL on error.
1935 struct drm_display_mode *mode; in drm_mode_create_from_cmdline_mode() local
1941 mode = drm_cvt_mode(dev, in drm_mode_create_from_cmdline_mode()
1947 mode = drm_gtf_mode(dev, in drm_mode_create_from_cmdline_mode()
1952 if (!mode) in drm_mode_create_from_cmdline_mode()
1955 mode->type |= DRM_MODE_TYPE_USERDEF; in drm_mode_create_from_cmdline_mode()
1958 drm_mode_fixup_1366x768(mode); in drm_mode_create_from_cmdline_mode()
1959 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); in drm_mode_create_from_cmdline_mode()
1960 return mode; in drm_mode_create_from_cmdline_mode()
2004 WARN(1, "Invalid aspect ratio (0%x) on mode\n", in drm_mode_convert_to_umode()
2059 * flags for kernel-mode, but in picture_aspect_ratio. in drm_mode_convert_umode()
2097 * @mode: video mode to be tested.
2100 * true if the mode can be supported in YCBCR420 format
2104 const struct drm_display_mode *mode) in drm_mode_is_420_only() argument
2106 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_only()
2117 * @mode: video mode to be tested.
2120 * true if the mode can be support YCBCR420 format
2124 const struct drm_display_mode *mode) in drm_mode_is_420_also() argument
2126 u8 vic = drm_match_cea_mode(mode); in drm_mode_is_420_also()
2136 * @mode: video mode to be tested.
2139 * true if the mode can be supported in YCBCR420 format
2143 const struct drm_display_mode *mode) in drm_mode_is_420() argument
2145 return drm_mode_is_420_only(display, mode) || in drm_mode_is_420()
2146 drm_mode_is_420_also(display, mode); in drm_mode_is_420()