Lines Matching full:mode
45 * drm_mode_debug_printmodeline - print a mode to dmesg
46 * @mode: mode to print
48 * Describe @mode using DRM_DEBUG.
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()
57 * drm_mode_create - create a new display mode
64 * Pointer to new mode on success, NULL on error.
84 * drm_mode_destroy - remove a mode
86 * @mode: mode to remove
88 * Release @mode's unique ID, then free it @mode structure itself using kfree.
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()
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.
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.
505 /* finally, pack the results in the mode struct */ in drm_gtf_mode_complex()
538 * @interlaced: whether to compute an interlaced mode
563 * The display mode object is allocated with drm_mode_create(). Returns NULL
564 * when no mode could be allocated.
582 * Fills out @dmode using the display mode specified in @vm.
623 * Fills out @vm using the display mode specified in @dmode.
697 * This function is expensive and should only be used, if only one mode is to be
719 pr_debug("%pOF: got %dx%d display mode from %s\n", in of_get_drm_display_mode()
730 * drm_mode_set_name - set the name on a mode
731 * @mode: name will be set in this mode
733 * Set the name of @mode to a standard format which is <hdisplay>x<vdisplay>
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()
747 * drm_mode_hsync - get the hsync of a mode
748 * @mode: mode
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()
773 * drm_mode_vrefresh - get the vrefresh of a mode
774 * @mode: mode
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()
806 * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode
807 * @mode: mode to query
811 * The vdisplay value will be doubled if the specified mode is a stereo mode of
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()
827 * @p: mode
905 * drm_mode_copy - copy the mode
906 * @dst: mode to overwrite
907 * @src: mode to copy
909 * Copy an existing mode into another mode, preserving the object id and
910 * list head of the destination mode.
924 * drm_mode_duplicate - allocate and duplicate an existing mode
925 * @dev: drm_device to allocate the duplicated mode for
926 * @mode: mode to duplicate
928 * Just allocate a new mode, copy the existing mode into it, and return
932 * Pointer to duplicated mode on success, NULL on error.
935 const struct drm_display_mode *mode) in drm_mode_duplicate() argument
943 drm_mode_copy(nmode, mode); in drm_mode_duplicate()
999 * @mode1: first mode
1000 * @mode2: second mode
1044 * @mode1: first mode
1045 * @mode2: second mode
1066 * @mode1: first mode
1067 * @mode2: second mode
1087 * @mode1: first mode
1088 * @mode2: second mode
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()
1136 * drm_mode_validate_driver - make sure the mode is somewhat sane
1138 * @mode: mode to check
1140 * First do basic validation on the mode, and then allow the driver
1145 * The mode status
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()
1166 * @mode: mode to check
1171 * limitations of the DRM device/connector. If a mode is too big its status
1176 * The mode status
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()
1194 * @mode: mode to check
1198 * only mode, when the source doesn't support it.
1201 * The mode status
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()
1278 * drm_mode_prune_invalid - remove invalid modes from mode list
1283 * This helper function can be used to prune a display mode list after
1285 * removed from the list, and if @verbose the status code and mode name is also
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()
1298 DRM_DEBUG_KMS("Not using %s mode: %s\n", 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()
1311 * @lh_a: list_head for first mode
1312 * @lh_b: list_head for second mode
1344 * drm_mode_sort - sort mode list
1356 * drm_connector_list_update - update the mode list for the connector
1360 * to the actual mode list. It compares the probed mode against the current
1373 struct drm_display_mode *mode; in drm_connector_list_update() local
1376 /* go through current modes checking for the new probed mode */ in drm_connector_list_update()
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()
1384 * If the old matching mode is stale (ie. left over in drm_connector_list_update()
1393 * the mode added to the probed_modes list first. 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()
1419 * @mode_option: optional per connector mode option
1421 * @mode: preallocated drm_cmdline_mode structure to fill out
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()
1552 /* catch mode that begins with digits but has no 'x' */ in drm_mode_parse_command_line_for_connector()
1557 pr_warn("[drm] parse error at position %i in video mode '%s'\n", 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()
1589 * drm_mode_create_from_cmdline_mode - convert a command line modeline into a DRM display mode
1590 * @dev: DRM device to create the new mode for
1594 * Pointer to converted mode on success, NULL on error.
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()
1642 "timing values too large for mode info\n"); in drm_mode_convert_to_umode()
1726 * flags for kernel-mode, but in picture_aspect_ratio. in drm_mode_convert_umode()
1762 * @mode: video mode to be tested.
1765 * true if the mode can be supported in YCBCR420 format
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()
1782 * @mode: video mode to be tested.
1785 * true if the mode can be support YCBCR420 format
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()
1801 * @mode: video mode to be tested.
1804 * true if the mode can be supported in YCBCR420 format
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()