drm: Check the fb size against the adjusted v/hdisplay for stereo modes
authorDamien Lespiau <damien.lespiau@intel.com>
Wed, 25 Sep 2013 15:45:31 +0000 (16:45 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 1 Oct 2013 05:45:37 +0000 (07:45 +0200)
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: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index db058643b01d12e51bc11fcb9e8f653e17a3c40f..807309f80b0b2766af2cff330ac28eeb362ac611 100644 (file)
@@ -2078,6 +2078,14 @@ static int drm_crtc_check_viewport(const struct drm_crtc *crtc,
        hdisplay = mode->hdisplay;
        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)
                swap(hdisplay, vdisplay);