diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2010-09-27 20:23:20 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-10-04 19:58:03 -0400 |
commit | 62acdc71cfbc816b26a57d89f433f8afaf4ff78d (patch) | |
tree | 90c99f53efb6b2d9060e62ac1ede1fb5366c6224 /drivers | |
parent | 85341f27b49833325f97580edcd687b4d90bb30b (diff) |
drm/nouveau: fix required mode bandwidth calculation for DP
This should fix eDP on certain laptops with 18-bit panels, we were rejecting
the panel's native mode due to thinking there was insufficient bandwidth
for it.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.c | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_connector.h | 3 |
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c index 4b286a8c30c8..0871495096fa 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.c +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c | |||
@@ -76,6 +76,22 @@ nouveau_encoder_connector_get(struct nouveau_encoder *encoder) | |||
76 | return NULL; | 76 | return NULL; |
77 | } | 77 | } |
78 | 78 | ||
79 | /*TODO: This could use improvement, and learn to handle the fixed | ||
80 | * BIOS tables etc. It's fine currently, for its only user. | ||
81 | */ | ||
82 | int | ||
83 | nouveau_connector_bpp(struct drm_connector *connector) | ||
84 | { | ||
85 | struct nouveau_connector *nv_connector = nouveau_connector(connector); | ||
86 | |||
87 | if (nv_connector->edid && nv_connector->edid->revision >= 4) { | ||
88 | u8 bpc = ((nv_connector->edid->input & 0x70) >> 3) + 4; | ||
89 | if (bpc > 4) | ||
90 | return bpc; | ||
91 | } | ||
92 | |||
93 | return 18; | ||
94 | } | ||
79 | 95 | ||
80 | static void | 96 | static void |
81 | nouveau_connector_destroy(struct drm_connector *drm_connector) | 97 | nouveau_connector_destroy(struct drm_connector *drm_connector) |
@@ -666,7 +682,7 @@ nouveau_connector_mode_valid(struct drm_connector *connector, | |||
666 | else | 682 | else |
667 | max_clock = nv_encoder->dp.link_nr * 162000; | 683 | max_clock = nv_encoder->dp.link_nr * 162000; |
668 | 684 | ||
669 | clock *= 3; | 685 | clock = clock * nouveau_connector_bpp(connector) / 8; |
670 | break; | 686 | break; |
671 | default: | 687 | default: |
672 | BUG_ON(1); | 688 | BUG_ON(1); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.h b/drivers/gpu/drm/nouveau/nouveau_connector.h index 0d2e668ccfe5..c21ed6b16f88 100644 --- a/drivers/gpu/drm/nouveau/nouveau_connector.h +++ b/drivers/gpu/drm/nouveau/nouveau_connector.h | |||
@@ -55,4 +55,7 @@ nouveau_connector_create(struct drm_device *, int index); | |||
55 | void | 55 | void |
56 | nouveau_connector_set_polling(struct drm_connector *); | 56 | nouveau_connector_set_polling(struct drm_connector *); |
57 | 57 | ||
58 | int | ||
59 | nouveau_connector_bpp(struct drm_connector *); | ||
60 | |||
58 | #endif /* __NOUVEAU_CONNECTOR_H__ */ | 61 | #endif /* __NOUVEAU_CONNECTOR_H__ */ |