Lines Matching refs:mode

56 /* adjusted_mode has been preset to be the panel's fixed mode */
62 struct drm_display_mode *mode, *adjusted_mode;
65 mode = &pipe_config->requested_mode;
71 if (adjusted_mode->hdisplay == mode->hdisplay &&
72 adjusted_mode->vdisplay == mode->vdisplay)
77 width = mode->hdisplay;
78 height = mode->vdisplay;
86 u32 scaled_width = adjusted_mode->hdisplay * mode->vdisplay;
87 u32 scaled_height = mode->hdisplay * adjusted_mode->vdisplay;
89 width = scaled_height / mode->vdisplay;
96 height = scaled_width / mode->hdisplay;
117 DRM_ERROR("bad panel fit mode: %d\n", fitting_mode);
127 centre_horizontally(struct drm_display_mode *mode,
133 sync_width = mode->crtc_hsync_end - mode->crtc_hsync_start;
134 blank_width = mode->crtc_hblank_end - mode->crtc_hblank_start;
137 border = (mode->hdisplay - width + 1) / 2;
140 mode->crtc_hdisplay = width;
141 mode->crtc_hblank_start = width + border;
142 mode->crtc_hblank_end = mode->crtc_hblank_start + blank_width;
144 mode->crtc_hsync_start = mode->crtc_hblank_start + sync_pos;
145 mode->crtc_hsync_end = mode->crtc_hsync_start + sync_width;
149 centre_vertically(struct drm_display_mode *mode,
155 sync_width = mode->crtc_vsync_end - mode->crtc_vsync_start;
156 blank_width = mode->crtc_vblank_end - mode->crtc_vblank_start;
159 border = (mode->vdisplay - height + 1) / 2;
161 mode->crtc_vdisplay = height;
162 mode->crtc_vblank_start = height + border;
163 mode->crtc_vblank_end = mode->crtc_vblank_start + blank_width;
165 mode->crtc_vsync_start = mode->crtc_vblank_start + sync_pos;
166 mode->crtc_vsync_end = mode->crtc_vsync_start + sync_width;
188 struct drm_display_mode *mode, *adjusted_mode;
190 mode = &pipe_config->requested_mode;
194 if (adjusted_mode->hdisplay == mode->hdisplay &&
195 adjusted_mode->vdisplay == mode->vdisplay)
207 centre_horizontally(adjusted_mode, mode->hdisplay);
208 centre_vertically(adjusted_mode, mode->vdisplay);
215 mode->vdisplay;
216 u32 scaled_height = mode->hdisplay *
226 else if (adjusted_mode->hdisplay != mode->hdisplay)
230 mode->vdisplay;
231 u32 scaled_height = mode->hdisplay *
241 mode->vdisplay);
244 if (mode->vdisplay != adjusted_mode->vdisplay) {
245 u32 bits = panel_fitter_scaling(mode->vdisplay, adjusted_mode->vdisplay);
255 mode->hdisplay);
258 if (mode->hdisplay != adjusted_mode->hdisplay) {
259 u32 bits = panel_fitter_scaling(mode->hdisplay, adjusted_mode->hdisplay);
280 if (mode->vdisplay != adjusted_mode->vdisplay ||
281 mode->hdisplay != adjusted_mode->hdisplay) {
293 DRM_ERROR("bad panel fit mode: %d\n", fitting_mode);