/* some reasonable defaults */
if (type == CONNECTOR_DVI_D || type == CONNECTOR_DVI_I || type == CONNECTOR_LVDS)
- connector->scaling_mode = SCALE_FULLSCREEN;
+ connector->requested_scaling_mode = SCALE_FULLSCREEN;
else
- connector->scaling_mode = SCALE_NON_GPU;
+ connector->requested_scaling_mode = SCALE_NON_GPU;
connector->use_dithering = false;
NV50_DEBUG("\n");
- switch (crtc->scaling_mode) {
+ switch (crtc->requested_scaling_mode) {
case SCALE_ASPECT:
nv50_crtc_calc_scale(crtc, &outX, &outY);
break;
OUT_MODE(NV50_CRTC0_SCALE_RES1 + offset, outY << 16 | outX);
OUT_MODE(NV50_CRTC0_SCALE_RES2 + offset, outY << 16 | outX);
+ /* processed */
+ crtc->scaling_mode = crtc->requested_scaling_mode;
+
return 0;
}
crtc->mode = kzalloc(sizeof(struct nouveau_hw_mode), GFP_KERNEL);
crtc->native_mode = kzalloc(sizeof(struct nouveau_hw_mode), GFP_KERNEL);
+ crtc->requested_scaling_mode = SCALE_INVALID;
+ crtc->scaling_mode = SCALE_INVALID;
+
if (!crtc->mode || !crtc->native_mode) {
rval = -ENOMEM;
goto out;
if (connector->output != output)
continue;
- crtc->scaling_mode = connector->scaling_mode;
+ crtc->requested_scaling_mode = connector->requested_scaling_mode;
crtc->use_dithering = connector->use_dithering;
break;
}
- if (crtc->scaling_mode == SCALE_NON_GPU)
+ if (crtc->requested_scaling_mode == SCALE_NON_GPU)
crtc->use_native_mode = false;
else
crtc->use_native_mode = true;
struct drm_device *dev = drm_connector->dev;
struct nv50_connector *connector = to_nv50_connector(drm_connector);
int rval = 0;
+ bool delay_change = false;
/* DPMS */
if (property == dev->mode_config.dpms_property && drm_connector->encoder) {
if (connector->type == CONNECTOR_LVDS && internal_value == SCALE_NON_GPU)
return -EINVAL;
- connector->scaling_mode = internal_value;
+ connector->requested_scaling_mode = internal_value;
if (drm_connector->encoder && drm_connector->encoder->crtc)
crtc = to_nv50_crtc(drm_connector->encoder->crtc);
if (!crtc)
return 0;
- crtc->scaling_mode = connector->scaling_mode;
+ crtc->requested_scaling_mode = connector->requested_scaling_mode;
+
+ /* going from and to a gpu scaled regime requires a modesetting, so wait until next modeset */
+ if (crtc->scaling_mode == SCALE_NON_GPU || internal_value == SCALE_NON_GPU) {
+ DRM_INFO("Moving from or to a non-gpu scaled mode, this will be processed upon next modeset.");
+ delay_change = true;
+ }
+
+ if (delay_change)
+ return 0;
+
rval = crtc->set_scale(crtc);
if (rval)
return rval;
connector = to_nv50_connector(drm_connector);
- switch (connector->scaling_mode) {
+ switch (connector->requested_scaling_mode) {
case SCALE_NON_GPU:
drm_mode = DRM_MODE_SCALE_NON_GPU;
break;