Lines Matching defs:mode
76 drm_mode_destroy(client->dev, modeset->mode);
77 modeset->mode = NULL;
120 struct drm_display_mode *mode;
122 list_for_each_entry(mode, &connector->modes, head) {
123 if (mode->hdisplay == connector->tile_h_size &&
124 mode->vdisplay == connector->tile_v_size)
125 return mode;
133 struct drm_display_mode *mode;
135 list_for_each_entry(mode, &connector->modes, head) {
136 if (mode->hdisplay == connector->tile_h_size &&
137 mode->vdisplay == connector->tile_v_size)
139 return mode;
147 struct drm_display_mode *mode;
149 list_for_each_entry(mode, &connector->modes, head) {
150 if (mode->hdisplay > width ||
151 mode->vdisplay > height)
153 if (mode->type & DRM_MODE_TYPE_PREFERRED)
154 return mode;
163 struct drm_display_mode *mode;
170 /* attempt to find a matching mode in the list of modes
171 * we have gotten so far, if not add a CVT mode that conforms
178 list_for_each_entry(mode, &connector->modes, head) {
179 /* Check (optional) mode name first */
180 if (!strcmp(mode->name, cmdline_mode->name))
181 return mode;
184 if (mode->hdisplay != cmdline_mode->xres ||
185 mode->vdisplay != cmdline_mode->yres)
189 if (drm_mode_vrefresh(mode) != cmdline_mode->refresh)
194 if (!(mode->flags & DRM_MODE_FLAG_INTERLACE))
197 if (mode->flags & DRM_MODE_FLAG_INTERLACE)
200 return mode;
209 mode = drm_mode_create_from_cmdline_mode(connector->dev, cmdline_mode);
210 if (mode)
211 list_add(&mode->head, &connector->modes);
213 return mode;
264 struct drm_display_mode *dmt_mode, *mode;
307 /* try and find a 1024x768 mode on each connector */
318 list_for_each_entry(mode, &connectors[i]->modes, head) {
319 if (drm_mode_match(mode, dmt_mode,
324 modes[i] = mode;
426 DRM_DEBUG_KMS("looking for cmdline mode on connector %d\n",
429 /* got for command line mode first */
432 DRM_DEBUG_KMS("looking for preferred mode on connector %d %d\n",
442 * In case of tiled mode if all tiles not present fallback to
443 * first available non tiled mode.
444 * After all tiles are present, try to find the tiled mode
445 * for all and if tiled mode not present due to fbcon size
446 * limitations, use first non tiled mode only for
447 * tile 0,0 and set to no mode for all other tiles.
455 DRM_DEBUG_KMS("Falling back to non tiled mode on Connector %d\n",
463 DRM_DEBUG_KMS("found mode %s\n", modes[i] ? modes[i]->name :
665 DRM_DEBUG_KMS("looking for cmdline mode on connector %s\n",
668 /* go for command line mode first */
673 DRM_DEBUG_KMS("looking for preferred mode on connector %s %d\n",
678 /* No preferred mode marked by the EDID? Are there any modes? */
680 DRM_DEBUG_KMS("using first mode listed on connector %s\n",
687 /* last resort: use current mode */
690 * IMPORTANT: We want to use the adjusted mode (i.e.
692 * config, not the input mode, which is what crtc->mode
694 * code puts a mode derived from the post-pfit timings
695 * into crtc->mode this works out correctly.
697 * This is crtc->mode and not crtc->state->mode for the
700 DRM_DEBUG_KMS("looking for current mode on connector %s\n",
702 modes[i] = &connector->state->crtc->mode;
706 * then fallback to a non tiled mode.
710 DRM_DEBUG_KMS("Falling back to non tiled mode on Connector %d\n",
760 * @width: Maximum display mode width (optional)
761 * @height: Maximum display mode height (optional)
850 struct drm_display_mode *mode = modes[i];
854 if (mode && crtc) {
858 DRM_DEBUG_KMS("desired mode %s set on crtc %d (%d,%d)\n",
859 mode->name, crtc->base.id, offset->x, offset->y);
867 kfree(modeset->mode);
868 modeset->mode = drm_mode_duplicate(dev, mode);
869 if (!modeset->mode) {
1041 * mode is set, unconditionally clear it if we force DPMS off
1214 * drm_client_modeset_dpms() - Set DPMS mode
1216 * @mode: DPMS mode
1218 * Note: For atomic drivers @mode is reduced to on/off.
1223 int drm_client_modeset_dpms(struct drm_client_dev *client, int mode)
1233 ret = drm_client_modeset_commit_atomic(client, mode == DRM_MODE_DPMS_ON, false);
1235 drm_client_modeset_dpms_legacy(client, mode);