Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0c1bbb0 authored by Damien Lespiau's avatar Damien Lespiau Committed by Daniel Vetter
Browse files

drm: Check the fb size against the adjusted v/hdisplay for stereo modes



Some stereo modes, like frame packing, need a larger CRTC viewport than
the "natural" underlying 2D mode and thus drm_crtc_check_viewport()
needs to query the adjusted mode to use the correct h/vdisplay.

Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDamien Lespiau <damien.lespiau@intel.com>
Acked-by: default avatarDave Airlie <airlied@gmail.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c11e9283
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -2078,6 +2078,14 @@ static int drm_crtc_check_viewport(const struct drm_crtc *crtc,
	hdisplay = mode->hdisplay;
	hdisplay = mode->hdisplay;
	vdisplay = mode->vdisplay;
	vdisplay = mode->vdisplay;


	if (drm_mode_is_stereo(mode)) {
		struct drm_display_mode adjusted = *mode;

		drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE);
		hdisplay = adjusted.crtc_hdisplay;
		vdisplay = adjusted.crtc_vdisplay;
	}

	if (crtc->invert_dimensions)
	if (crtc->invert_dimensions)
		swap(hdisplay, vdisplay);
		swap(hdisplay, vdisplay);