Lines Matching refs:mode

43  * drm_mode_debug_printmodeline - debug print a mode
45 * @mode: mode to print
50 * Describe @mode using DRM_DEBUG.
52 void drm_mode_debug_printmodeline(struct drm_display_mode *mode)
56 mode->base.id, mode->name, mode->vrefresh, mode->clock,
57 mode->hdisplay, mode->hsync_start,
58 mode->hsync_end, mode->htotal,
59 mode->vdisplay, mode->vsync_start,
60 mode->vsync_end, mode->vtotal, mode->type, mode->flags);
265 /* ignore - just set the mode flag for interlaced */
270 /* Fill the mode line name */
441 /* finally, pack the results in the mode struct */
507 * drm_mode_set_name - set the name on a mode
508 * @mode: name will be set in this mode
513 * Set the name of @mode to a standard format.
515 void drm_mode_set_name(struct drm_display_mode *mode)
517 bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE);
519 snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s",
520 mode->hdisplay, mode->vdisplay,
545 * drm_mode_width - get the width of a mode
546 * @mode: mode
551 * Return @mode's width (hdisplay) value.
556 * @mode->hdisplay
558 int drm_mode_width(struct drm_display_mode *mode)
560 return mode->hdisplay;
565 * drm_mode_height - get the height of a mode
566 * @mode: mode
571 * Return @mode's height (vdisplay) value.
576 * @mode->vdisplay
578 int drm_mode_height(struct drm_display_mode *mode)
580 return mode->vdisplay;
583 /** drm_mode_hsync - get the hsync of a mode
584 * @mode: mode
591 int drm_mode_hsync(const struct drm_display_mode *mode)
595 if (mode->hsync)
596 return mode->hsync;
598 if (mode->htotal < 0)
601 calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
609 * drm_mode_vrefresh - get the vrefresh of a mode
610 * @mode: mode
615 * Return @mode's vrefresh rate in Hz or calculate it if necessary.
624 int drm_mode_vrefresh(const struct drm_display_mode *mode)
629 if (mode->vrefresh > 0)
630 refresh = mode->vrefresh;
631 else if (mode->htotal > 0 && mode->vtotal > 0) {
633 vtotal = mode->vtotal;
635 calc_val = (mode->clock * 1000);
636 calc_val /= mode->htotal;
639 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
641 if (mode->flags & DRM_MODE_FLAG_DBLSCAN)
643 if (mode->vscan > 1)
644 refresh /= mode->vscan;
651 * @p: mode
710 * drm_mode_duplicate - allocate and duplicate an existing mode
711 * @m: mode to duplicate
716 * Just allocate a new mode, copy the existing mode into it, and return
720 const struct drm_display_mode *mode)
730 *nmode = *mode;
738 * @mode1: first mode
739 * @mode2: second mode
794 struct drm_display_mode *mode;
796 list_for_each_entry(mode, mode_list, head) {
797 if (maxPitch > 0 && mode->hdisplay > maxPitch)
798 mode->status = MODE_BAD_WIDTH;
800 if (maxX > 0 && mode->hdisplay > maxX)
801 mode->status = MODE_VIRTUAL_X;
803 if (maxY > 0 && mode->vdisplay > maxY)
804 mode->status = MODE_VIRTUAL_Y;
819 * Some code may need to check a mode list against the clock limits of the
820 * device in question. This function walks the mode list, testing to make
821 * sure each mode falls within a given range (defined by @min and @max
822 * arrays) and sets @mode->status as needed.
828 struct drm_display_mode *mode;
831 list_for_each_entry(mode, mode_list, head) {
834 if (mode->clock >= min[i] && mode->clock <= max[i]) {
840 mode->status = MODE_CLOCK_RANGE;
845 * drm_mode_prune_invalid - remove invalid modes from mode list
853 * Once mode list generation is complete, a caller can use this routine to
854 * remove invalid modes from a mode list. If any of the modes have a
860 struct drm_display_mode *mode, *t;
862 list_for_each_entry_safe(mode, t, mode_list, head) {
863 if (mode->status != MODE_OK) {
864 list_del(&mode->head);
866 drm_mode_debug_printmodeline(mode);
867 DRM_DEBUG_KMS("Not using %s mode %d\n",
868 mode->name, mode->status);
870 drm_mode_destroy(dev, mode);
878 * @lh_a: list_head for first mode
879 * @lh_b: list_head for second mode
909 * drm_mode_sort - sort mode list
923 * drm_mode_connector_list_update - update the mode list for the connector
930 * to the actual mode list. It compares the probed mode against the current
936 struct drm_display_mode *mode;
943 /* go through current modes checking for the new probed mode */
944 list_for_each_entry(mode, &connector->modes, head) {
945 if (drm_mode_equal(pmode, mode)) {
947 /* if equal delete the probed mode */
948 mode->status = pmode->status;
950 mode->type |= pmode->type;
965 * @mode_option - per connector mode option
978 struct drm_cmdline_mode *mode)
995 mode->specified = false;
1089 /* catch mode that begins with digits but has no 'x' */
1094 printf("parse error at position %i in video mode '%s'\n",
1096 mode->specified = false;
1101 mode->specified = true;
1102 mode->xres = xres;
1103 mode->yres = yres;
1107 mode->refresh_specified = true;
1108 mode->refresh = refresh;
1112 mode->bpp_specified = true;
1113 mode->bpp = bpp;
1115 mode->rb = rb;
1116 mode->cvt = cvt;
1117 mode->interlace = interlace;
1118 mode->margins = margins;
1119 mode->force = force;
1128 struct drm_display_mode *mode;
1131 mode = drm_cvt_mode(dev,
1137 mode = drm_gtf_mode(dev,
1142 if (!mode)
1145 drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
1146 return mode;