diff options
author | Adam Jackson <ajax@redhat.com> | 2010-03-29 17:43:22 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-05 20:40:19 -0400 |
commit | 2255be14cb82370a6af4054edb3b4cd170d80752 (patch) | |
tree | 8ed7bdf3119055e770ff312e031c55c5d684cd64 | |
parent | c867df7043b738da4f4d358d7039c243a29b4272 (diff) |
drm/edid: Add modes for Established Timings III section
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 858fedc33d9b..58b67932f04a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
@@ -1134,6 +1134,94 @@ static int drm_cvt_modes(struct drm_connector *connector, | |||
1134 | return modes; | 1134 | return modes; |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | static const struct { | ||
1138 | short w; | ||
1139 | short h; | ||
1140 | short r; | ||
1141 | short rb; | ||
1142 | } est3_modes[] = { | ||
1143 | /* byte 6 */ | ||
1144 | { 640, 350, 85, 0 }, | ||
1145 | { 640, 400, 85, 0 }, | ||
1146 | { 720, 400, 85, 0 }, | ||
1147 | { 640, 480, 85, 0 }, | ||
1148 | { 848, 480, 60, 0 }, | ||
1149 | { 800, 600, 85, 0 }, | ||
1150 | { 1024, 768, 85, 0 }, | ||
1151 | { 1152, 864, 75, 0 }, | ||
1152 | /* byte 7 */ | ||
1153 | { 1280, 768, 60, 1 }, | ||
1154 | { 1280, 768, 60, 0 }, | ||
1155 | { 1280, 768, 75, 0 }, | ||
1156 | { 1280, 768, 85, 0 }, | ||
1157 | { 1280, 960, 60, 0 }, | ||
1158 | { 1280, 960, 85, 0 }, | ||
1159 | { 1280, 1024, 60, 0 }, | ||
1160 | { 1280, 1024, 85, 0 }, | ||
1161 | /* byte 8 */ | ||
1162 | { 1360, 768, 60, 0 }, | ||
1163 | { 1440, 900, 60, 1 }, | ||
1164 | { 1440, 900, 60, 0 }, | ||
1165 | { 1440, 900, 75, 0 }, | ||
1166 | { 1440, 900, 85, 0 }, | ||
1167 | { 1400, 1050, 60, 1 }, | ||
1168 | { 1400, 1050, 60, 0 }, | ||
1169 | { 1400, 1050, 75, 0 }, | ||
1170 | /* byte 9 */ | ||
1171 | { 1400, 1050, 85, 0 }, | ||
1172 | { 1680, 1050, 60, 1 }, | ||
1173 | { 1680, 1050, 60, 0 }, | ||
1174 | { 1680, 1050, 75, 0 }, | ||
1175 | { 1680, 1050, 85, 0 }, | ||
1176 | { 1600, 1200, 60, 0 }, | ||
1177 | { 1600, 1200, 65, 0 }, | ||
1178 | { 1600, 1200, 70, 0 }, | ||
1179 | /* byte 10 */ | ||
1180 | { 1600, 1200, 75, 0 }, | ||
1181 | { 1600, 1200, 85, 0 }, | ||
1182 | { 1792, 1344, 60, 0 }, | ||
1183 | { 1792, 1344, 85, 0 }, | ||
1184 | { 1856, 1392, 60, 0 }, | ||
1185 | { 1856, 1392, 75, 0 }, | ||
1186 | { 1920, 1200, 60, 1 }, | ||
1187 | { 1920, 1200, 60, 0 }, | ||
1188 | /* byte 11 */ | ||
1189 | { 1920, 1200, 75, 0 }, | ||
1190 | { 1920, 1200, 85, 0 }, | ||
1191 | { 1920, 1440, 60, 0 }, | ||
1192 | { 1920, 1440, 75, 0 }, | ||
1193 | }; | ||
1194 | static const int num_est3_modes = sizeof(est3_modes) / sizeof(est3_modes[0]); | ||
1195 | |||
1196 | static int | ||
1197 | drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing) | ||
1198 | { | ||
1199 | int i, j, m, modes = 0; | ||
1200 | struct drm_display_mode *mode; | ||
1201 | u8 *est = ((u8 *)timing) + 5; | ||
1202 | |||
1203 | for (i = 0; i < 6; i++) { | ||
1204 | for (j = 7; j > 0; j--) { | ||
1205 | m = (i * 8) + (7 - j); | ||
1206 | if (m > num_est3_modes) | ||
1207 | break; | ||
1208 | if (est[i] & (1 << j)) { | ||
1209 | mode = drm_find_dmt(connector->dev, | ||
1210 | est3_modes[m].w, | ||
1211 | est3_modes[m].h, | ||
1212 | est3_modes[m].r | ||
1213 | /*, est3_modes[m].rb */); | ||
1214 | if (mode) { | ||
1215 | drm_mode_probed_add(connector, mode); | ||
1216 | modes++; | ||
1217 | } | ||
1218 | } | ||
1219 | } | ||
1220 | } | ||
1221 | |||
1222 | return modes; | ||
1223 | } | ||
1224 | |||
1137 | static int add_detailed_modes(struct drm_connector *connector, | 1225 | static int add_detailed_modes(struct drm_connector *connector, |
1138 | struct detailed_timing *timing, | 1226 | struct detailed_timing *timing, |
1139 | struct edid *edid, u32 quirks, int preferred) | 1227 | struct edid *edid, u32 quirks, int preferred) |
@@ -1181,6 +1269,9 @@ static int add_detailed_modes(struct drm_connector *connector, | |||
1181 | case EDID_DETAIL_CVT_3BYTE: | 1269 | case EDID_DETAIL_CVT_3BYTE: |
1182 | modes += drm_cvt_modes(connector, timing); | 1270 | modes += drm_cvt_modes(connector, timing); |
1183 | break; | 1271 | break; |
1272 | case EDID_DETAIL_EST_TIMINGS: | ||
1273 | modes += drm_est3_modes(connector, timing); | ||
1274 | break; | ||
1184 | default: | 1275 | default: |
1185 | break; | 1276 | break; |
1186 | } | 1277 | } |