Commit 8896ceef authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau/kms/nv50: remove code to support non-atomic dpms

Made completely unreachable (and broken) by atomic commits.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f7aa20e8
...@@ -1117,43 +1117,6 @@ nouveau_connector_funcs_lvds = { ...@@ -1117,43 +1117,6 @@ nouveau_connector_funcs_lvds = {
.atomic_get_property = nouveau_conn_atomic_get_property, .atomic_get_property = nouveau_conn_atomic_get_property,
}; };
static int
nouveau_connector_dp_dpms(struct drm_connector *connector, int mode)
{
struct nouveau_encoder *nv_encoder = NULL;
if (connector->encoder)
nv_encoder = nouveau_encoder(connector->encoder);
if (nv_encoder && nv_encoder->dcb &&
nv_encoder->dcb->type == DCB_OUTPUT_DP) {
if (mode == DRM_MODE_DPMS_ON) {
u8 data = DP_SET_POWER_D0;
nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
usleep_range(1000, 2000);
} else {
u8 data = DP_SET_POWER_D3;
nvkm_wraux(nv_encoder->aux, DP_SET_POWER, &data, 1);
}
}
return drm_helper_connector_dpms(connector, mode);
}
static const struct drm_connector_funcs
nouveau_connector_funcs_dp = {
.dpms = nouveau_connector_dp_dpms,
.reset = nouveau_conn_reset,
.detect = nouveau_connector_detect,
.force = nouveau_connector_force,
.fill_modes = drm_helper_probe_single_connector_modes,
.set_property = nouveau_connector_set_property,
.destroy = nouveau_connector_destroy,
.atomic_duplicate_state = nouveau_conn_atomic_duplicate_state,
.atomic_destroy_state = nouveau_conn_atomic_destroy_state,
.atomic_set_property = nouveau_conn_atomic_set_property,
.atomic_get_property = nouveau_conn_atomic_get_property,
};
static int static int
nouveau_connector_hotplug(struct nvif_notify *notify) nouveau_connector_hotplug(struct nvif_notify *notify)
{ {
...@@ -1348,10 +1311,7 @@ nouveau_connector_create(struct drm_device *dev, int index) ...@@ -1348,10 +1311,7 @@ nouveau_connector_create(struct drm_device *dev, int index)
return ERR_PTR(ret); return ERR_PTR(ret);
} }
if (dev->mode_config.funcs->atomic_commit)
funcs = &nouveau_connector_funcs; funcs = &nouveau_connector_funcs;
else
funcs = &nouveau_connector_funcs_dp;
break; break;
default: default:
funcs = &nouveau_connector_funcs; funcs = &nouveau_connector_funcs;
......
...@@ -3116,42 +3116,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode) ...@@ -3116,42 +3116,8 @@ nv50_sor_dpms(struct drm_encoder *encoder, int mode)
.base.hashm = nv_encoder->dcb->hashm, .base.hashm = nv_encoder->dcb->hashm,
.pwr.state = mode == DRM_MODE_DPMS_ON, .pwr.state = mode == DRM_MODE_DPMS_ON,
}; };
struct {
struct nv50_disp_mthd_v1 base;
struct nv50_disp_sor_dp_pwr_v0 pwr;
} link = {
.base.version = 1,
.base.method = NV50_DISP_MTHD_V1_SOR_DP_PWR,
.base.hasht = nv_encoder->dcb->hasht,
.base.hashm = nv_encoder->dcb->hashm,
.pwr.state = mode == DRM_MODE_DPMS_ON,
};
struct drm_device *dev = encoder->dev;
struct drm_encoder *partner;
nv_encoder->last_dpms = mode;
list_for_each_entry(partner, &dev->mode_config.encoder_list, head) {
struct nouveau_encoder *nv_partner = nouveau_encoder(partner);
if (partner->encoder_type != DRM_MODE_ENCODER_TMDS)
continue;
if (nv_partner != nv_encoder &&
nv_partner->dcb->or == nv_encoder->dcb->or) {
if (nv_partner->last_dpms == DRM_MODE_DPMS_ON)
return;
break;
}
}
if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
args.pwr.state = 1;
nvif_mthd(disp->disp, 0, &args, sizeof(args)); nvif_mthd(disp->disp, 0, &args, sizeof(args));
nvif_mthd(disp->disp, 0, &link, sizeof(link));
} else {
nvif_mthd(disp->disp, 0, &args, sizeof(args));
}
} }
static void static void
...@@ -3177,7 +3143,6 @@ nv50_sor_disable(struct drm_encoder *encoder) ...@@ -3177,7 +3143,6 @@ nv50_sor_disable(struct drm_encoder *encoder)
struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc); struct nouveau_crtc *nv_crtc = nouveau_crtc(nv_encoder->crtc);
nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
nv_encoder->crtc = NULL; nv_encoder->crtc = NULL;
if (nv_crtc) { if (nv_crtc) {
...@@ -3380,7 +3345,6 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe) ...@@ -3380,7 +3345,6 @@ nv50_sor_create(struct drm_connector *connector, struct dcb_output *dcbe)
return -ENOMEM; return -ENOMEM;
nv_encoder->dcb = dcbe; nv_encoder->dcb = dcbe;
nv_encoder->or = ffs(dcbe->or) - 1; nv_encoder->or = ffs(dcbe->or) - 1;
nv_encoder->last_dpms = DRM_MODE_DPMS_OFF;
encoder = to_drm_encoder(nv_encoder); encoder = to_drm_encoder(nv_encoder);
encoder->possible_crtcs = dcbe->heads; encoder->possible_crtcs = dcbe->heads;
...@@ -4126,15 +4090,9 @@ nv50_display_init(struct drm_device *dev) ...@@ -4126,15 +4090,9 @@ nv50_display_init(struct drm_device *dev)
struct nouveau_encoder *nv_encoder; struct nouveau_encoder *nv_encoder;
nv_encoder = nouveau_encoder(encoder); nv_encoder = nouveau_encoder(encoder);
if (nv_encoder->dcb->type == DCB_OUTPUT_DP)
nv_encoder->dcb->type = DCB_OUTPUT_EOL;
help = encoder->helper_private; help = encoder->helper_private;
if (help && help->dpms) if (help && help->dpms)
help->dpms(encoder, DRM_MODE_DPMS_ON); help->dpms(encoder, DRM_MODE_DPMS_ON);
if (nv_encoder->dcb->type == DCB_OUTPUT_EOL)
nv_encoder->dcb->type = DCB_OUTPUT_DP;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment