提交 37aa2243 编写于 作者: A Alastair Bridgewater 提交者: Ben Skeggs

drm/nouveau: Handle frame-packing mode geometry and timing effects

Frame-packing modes add an extra vtotal raster lines to each frame
above and beyond what the basic mode description calls for.
Account for this during scaler configuration (possibly a bit of a
hack), during CRTC configuration (clearly not a hack), and when
checking that a mode is valid for a given connector (cribbed from
the i915 driver).
Signed-off-by: NAlastair Bridgewater <alastair.bridgewater@gmail.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 a8970743
...@@ -1045,6 +1045,9 @@ nouveau_connector_mode_valid(struct drm_connector *connector, ...@@ -1045,6 +1045,9 @@ nouveau_connector_mode_valid(struct drm_connector *connector,
return MODE_BAD; return MODE_BAD;
} }
if ((mode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING)
clock *= 2;
if (clock < min_clock) if (clock < min_clock)
return MODE_CLOCK_LOW; return MODE_CLOCK_LOW;
......
...@@ -1967,6 +1967,7 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, ...@@ -1967,6 +1967,7 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
struct drm_display_mode *umode = &asyh->state.mode; struct drm_display_mode *umode = &asyh->state.mode;
int mode = asyc->scaler.mode; int mode = asyc->scaler.mode;
struct edid *edid; struct edid *edid;
int umode_vdisplay, omode_hdisplay, omode_vdisplay;
if (connector->edid_blob_ptr) if (connector->edid_blob_ptr)
edid = (struct edid *)connector->edid_blob_ptr->data; edid = (struct edid *)connector->edid_blob_ptr->data;
...@@ -1981,12 +1982,18 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, ...@@ -1981,12 +1982,18 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
mode = DRM_MODE_SCALE_FULLSCREEN; mode = DRM_MODE_SCALE_FULLSCREEN;
} }
/* For the user-specified mode, we must ignore doublescan and
* the like, but honor frame packing.
*/
umode_vdisplay = umode->vdisplay;
if ((umode->flags & DRM_MODE_FLAG_3D_MASK) == DRM_MODE_FLAG_3D_FRAME_PACKING)
umode_vdisplay += umode->vtotal;
asyh->view.iW = umode->hdisplay; asyh->view.iW = umode->hdisplay;
asyh->view.iH = umode->vdisplay; asyh->view.iH = umode_vdisplay;
asyh->view.oW = omode->hdisplay; /* For the output mode, we can just use the stock helper. */
asyh->view.oH = omode->vdisplay; drm_mode_get_hv_timing(omode, &omode_hdisplay, &omode_vdisplay);
if (omode->flags & DRM_MODE_FLAG_DBLSCAN) asyh->view.oW = omode_hdisplay;
asyh->view.oH *= 2; asyh->view.oH = omode_vdisplay;
/* Add overscan compensation if necessary, will keep the aspect /* Add overscan compensation if necessary, will keep the aspect
* ratio the same as the backend mode unless overridden by the * ratio the same as the backend mode unless overridden by the
...@@ -2016,7 +2023,7 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh, ...@@ -2016,7 +2023,7 @@ nv50_head_atomic_check_view(struct nv50_head_atom *armh,
switch (mode) { switch (mode) {
case DRM_MODE_SCALE_CENTER: case DRM_MODE_SCALE_CENTER:
asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW); asyh->view.oW = min((u16)umode->hdisplay, asyh->view.oW);
asyh->view.oH = min((u16)umode->vdisplay, asyh->view.oH); asyh->view.oH = min((u16)umode_vdisplay, asyh->view.oH);
/* fall-through */ /* fall-through */
case DRM_MODE_SCALE_ASPECT: case DRM_MODE_SCALE_ASPECT:
if (asyh->view.oH < asyh->view.oW) { if (asyh->view.oH < asyh->view.oW) {
...@@ -2041,7 +2048,7 @@ nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh) ...@@ -2041,7 +2048,7 @@ nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
struct nv50_head_mode *m = &asyh->mode; struct nv50_head_mode *m = &asyh->mode;
u32 blankus; u32 blankus;
drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V | CRTC_STEREO_DOUBLE);
/* /*
* DRM modes are defined in terms of a repeating interval * DRM modes are defined in terms of a repeating interval
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册