Rev 1126 | Rev 1179 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1126 | Rev 1128 | ||
---|---|---|---|
Line 1171... | Line 1171... | ||
1171 | return info; |
1171 | return info; |
1172 | #undef PADDING |
1172 | #undef PADDING |
1173 | #undef BYTES_PER_LONG |
1173 | #undef BYTES_PER_LONG |
1174 | }>>>>>>>>>>>><>>> |
1174 | } |
Line -... | Line 1175... | ||
- | 1175 | ||
- | 1176 | static char *manufacturer_name(unsigned char *x) |
|
- | 1177 | { |
|
- | 1178 | static char name[4]; |
|
- | 1179 | ||
- | 1180 | name[0] = ((x[0] & 0x7C) >> 2) + '@'; |
|
- | 1181 | name[1] = ((x[0] & 0x03) << 3) + ((x[1] & 0xE0) >> 5) + '@'; |
|
- | 1182 | name[2] = (x[1] & 0x1F) + '@'; |
|
- | 1183 | name[3] = 0; |
|
- | 1184 | ||
- | 1185 | return name; |
|
- | 1186 | } |
|
- | 1187 | ||
- | 1188 | ||
- | 1189 | bool set_mode(struct drm_device *dev, int width, int height) |
|
- | 1190 | { |
|
- | 1191 | struct drm_connector *connector; |
|
- | 1192 | ||
- | 1193 | bool ret; |
|
- | 1194 | ||
- | 1195 | ENTRY(); |
|
- | 1196 | ||
- | 1197 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) |
|
- | 1198 | { |
|
- | 1199 | struct drm_display_mode *mode; |
|
- | 1200 | ||
- | 1201 | struct drm_encoder *encoder; |
|
- | 1202 | struct drm_crtc *crtc; |
|
- | 1203 | ||
- | 1204 | if( connector->status != connector_status_connected) |
|
- | 1205 | continue; |
|
- | 1206 | ||
- | 1207 | encoder = connector->encoder; |
|
- | 1208 | if( encoder == NULL) |
|
- | 1209 | continue; |
|
- | 1210 | ||
- | 1211 | crtc = encoder->crtc; |
|
- | 1212 | ||
- | 1213 | if(crtc == NULL) |
|
- | 1214 | continue; |
|
- | 1215 | ||
- | 1216 | list_for_each_entry(mode, &connector->modes, head) |
|
- | 1217 | { |
|
- | 1218 | char *con_name, *enc_name; |
|
- | 1219 | ||
- | 1220 | struct drm_framebuffer *fb; |
|
- | 1221 | ||
- | 1222 | if (drm_mode_width(mode) == width && |
|
- | 1223 | drm_mode_height(mode) == height) |
|
- | 1224 | { |
|
- | 1225 | char con_edid[128]; |
|
- | 1226 | ||
- | 1227 | fb = list_first_entry(&dev->mode_config.fb_kernel_list, |
|
- | 1228 | struct drm_framebuffer, filp_head); |
|
- | 1229 | ||
- | 1230 | memcpy(con_edid, connector->edid_blob_ptr->data, 128); |
|
- | 1231 | ||
- | 1232 | dbgprintf("Manufacturer: %s Model %x Serial Number %u\n", |
|
- | 1233 | manufacturer_name(con_edid + 0x08), |
|
- | 1234 | (unsigned short)(con_edid[0x0A] + (con_edid[0x0B] << 8)), |
|
- | 1235 | (unsigned int)(con_edid[0x0C] + (con_edid[0x0D] << 8) |
|
- | 1236 | + (con_edid[0x0E] << 16) + (con_edid[0x0F] << 24))); |
|
- | 1237 | ||
- | 1238 | ||
- | 1239 | con_name = drm_get_connector_name(connector); |
|
- | 1240 | enc_name = drm_get_encoder_name(encoder); |
|
- | 1241 | ||
- | 1242 | dbgprintf("set mode %d %d connector %s encoder %s\n", |
|
- | 1243 | width, height, con_name, enc_name); |
|
- | 1244 | ||
- | 1245 | fb->width = width; |
|
- | 1246 | fb->height = height; |
|
- | 1247 | fb->pitch = radeon_align_pitch(dev->dev_private, width, 32) |
|
- | 1248 | * ((32 + 1) / 8); |
|
- | 1249 | ||
- | 1250 | crtc->fb = fb; |
|
- | 1251 | ||
- | 1252 | ret = drm_crtc_helper_set_mode(crtc, mode, 0, 0, fb); |
|
- | 1253 | ||
- | 1254 | sysSetScreen(width,height); |
|
- | 1255 | ||
- | 1256 | if (ret == true) |
|
- | 1257 | { |
|
- | 1258 | } |
|
- | 1259 | else |
|
- | 1260 | { |
|
- | 1261 | DRM_ERROR("failed to set mode %d_%d on crtc %p\n", |
|
- | 1262 | width, height, crtc); |
|
- | 1263 | }; |
|
- | 1264 | ||
- | 1265 | return ret; |
|
- | 1266 | }; |
|
- | 1267 | } |
|
- | 1268 | }; |
|
- | 1269 | ||
- | 1270 | return false; |
|
- | 1271 | };><>><>><>><>><>>>>>>>>>>>>><>>> |
|
- | 1272 |