diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2016-11-04 17:20:35 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-11-07 10:06:21 +1000 |
commit | e026728c9c650bd56e6498572a01750c28f73347 (patch) | |
tree | 41e23b268ce28d1752cfa8e5e2cc4cfe04dd1754 /drm/nouveau | |
parent | a7ac4f583db061885b9c376f753b1b17bb8a330e (diff) | |
download | nouveau-e026728c9c650bd56e6498572a01750c28f73347.tar.gz |
kms: prepare to support legacy connector dpms with atomic
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drm/nouveau')
-rw-r--r-- | drm/nouveau/nouveau_connector.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drm/nouveau/nouveau_connector.c b/drm/nouveau/nouveau_connector.c index c08d5e6c3..705c700fd 100644 --- a/drm/nouveau/nouveau_connector.c +++ b/drm/nouveau/nouveau_connector.c @@ -1074,9 +1074,17 @@ nouveau_connector_helper_funcs = { .best_encoder = nouveau_connector_best_encoder, }; +static int +nouveau_connector_dpms(struct drm_connector *connector, int mode) +{ + if (connector->dev->mode_config.funcs->atomic_commit) + return drm_atomic_helper_connector_dpms(connector, mode); + return drm_helper_connector_dpms(connector, mode); +} + static const struct drm_connector_funcs nouveau_connector_funcs = { - .dpms = drm_helper_connector_dpms, + .dpms = nouveau_connector_dpms, .reset = nouveau_conn_reset, .detect = nouveau_connector_detect, .force = nouveau_connector_force, @@ -1091,7 +1099,7 @@ nouveau_connector_funcs = { static const struct drm_connector_funcs nouveau_connector_funcs_lvds = { - .dpms = drm_helper_connector_dpms, + .dpms = nouveau_connector_dpms, .reset = nouveau_conn_reset, .detect = nouveau_connector_detect_lvds, .force = nouveau_connector_force, @@ -1335,7 +1343,10 @@ nouveau_connector_create(struct drm_device *dev, int index) return ERR_PTR(ret); } - funcs = &nouveau_connector_funcs_dp; + if (dev->mode_config.funcs->atomic_commit) + funcs = &nouveau_connector_funcs; + else + funcs = &nouveau_connector_funcs_dp; break; default: funcs = &nouveau_connector_funcs; |