summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2016-11-04 17:20:36 +1000
committerBen Skeggs <bskeggs@redhat.com>2016-11-07 14:04:57 +1000
commit354d3508bca3d4379f1507eeefb64876c22b50e1 (patch)
treebd1d67de9310763fea72b69330a46065ef5efe67
parentaccdea2ef458ada6102cc0d33a0a9780244ac7d2 (diff)
drm/nouveau/kms/nv50: ensure encoder normal power state is enabled at startup
To handle low-power DPMS states, we currently change an OR's (Output Resource) normal (active) power state to be off, leaving the rest of the display configured as usual. Under atomic modesetting, we will instead be doing a full modeset to tear down the pipe fully when entering a low-power state. As we'll no longer be touching the OR's PWR registers during runtime operation, we need to ensure the normal power state is set correctly during initialisation. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 4c7b53fea37c..742ac7cbff55 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -3790,6 +3790,7 @@ int
nv50_display_init(struct drm_device *dev)
{
struct nv50_disp *disp = nv50_disp(dev);
+ struct drm_encoder *encoder;
struct drm_plane *plane;
struct drm_crtc *crtc;
u32 *push;
@@ -3809,6 +3810,24 @@ nv50_display_init(struct drm_device *dev)
evo_data(push, nv50_mast(dev)->base.sync.handle);
evo_kick(push, nv50_mast(dev));
+ list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
+ if (encoder->encoder_type != DRM_MODE_ENCODER_DPMST) {
+ const struct drm_encoder_helper_funcs *help;
+ struct nouveau_encoder *nv_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;
+ if (help && help->dpms)
+ help->dpms(encoder, DRM_MODE_DPMS_ON);
+
+ if (nv_encoder->dcb->type == DCB_OUTPUT_EOL)
+ nv_encoder->dcb->type = DCB_OUTPUT_DP;
+ }
+ }
+
drm_for_each_plane(plane, dev) {
struct nv50_wndw *wndw = nv50_wndw(plane);
if (plane->funcs != &nv50_wndw)