Rev 2332 | Rev 2338 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2332 | Rev 2336 | ||
---|---|---|---|
Line 51... | Line 51... | ||
51 | unsigned int i915_powersave __read_mostly = 0; |
51 | unsigned int i915_powersave __read_mostly = 0; |
Line 52... | Line 52... | ||
52 | 52 | ||
Line 53... | Line 53... | ||
53 | unsigned int i915_enable_rc6 __read_mostly = 0; |
53 | unsigned int i915_enable_rc6 __read_mostly = 0; |
Line 54... | Line 54... | ||
54 | 54 | ||
Line 55... | Line 55... | ||
55 | unsigned int i915_enable_fbc __read_mostly = 1; |
55 | unsigned int i915_enable_fbc __read_mostly = 0; |
Line 266... | Line 266... | ||
266 | spin_lock_init(&dev->count_lock); |
266 | spin_lock_init(&dev->count_lock); |
267 | mutex_init(&dev->struct_mutex); |
267 | mutex_init(&dev->struct_mutex); |
268 | mutex_init(&dev->ctxlist_mutex); |
268 | mutex_init(&dev->ctxlist_mutex); |
Line -... | Line 269... | ||
- | 269 | ||
- | 270 | ret = i915_driver_load(dev, ent->driver_data ); |
|
- | 271 | ||
- | 272 | { |
|
- | 273 | struct drm_connector *connector; |
|
Line -... | Line 274... | ||
- | 274 | struct drm_connector_helper_funcs *connector_funcs; |
|
- | 275 | ||
- | 276 | struct drm_connector *def_connector = NULL; |
|
- | 277 | struct drm_encoder *encoder; |
|
- | 278 | struct drm_crtc *crtc; |
|
- | 279 | ||
- | 280 | struct drm_framebuffer *fb; |
|
- | 281 | char *con_name; |
|
- | 282 | char *enc_name; |
|
- | 283 | ||
- | 284 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) |
|
- | 285 | { |
|
- | 286 | if( connector->status != connector_status_connected) |
|
- | 287 | continue; |
|
- | 288 | ||
- | 289 | connector_funcs = connector->helper_private; |
|
- | 290 | encoder = connector_funcs->best_encoder(connector); |
|
- | 291 | if( encoder == NULL) |
|
- | 292 | { |
|
- | 293 | dbgprintf("CONNECTOR %x ID: %d no active encoders\n", |
|
- | 294 | connector, connector->base.id); |
|
- | 295 | continue; |
|
- | 296 | } |
|
- | 297 | connector->encoder = encoder; |
|
- | 298 | ||
- | 299 | dbgprintf("CONNECTOR %x ID: %d status %d encoder %x\n crtc %x\n", |
|
- | 300 | connector, connector->base.id, |
|
- | 301 | connector->status, connector->encoder, |
|
- | 302 | encoder->crtc); |
|
- | 303 | ||
- | 304 | def_connector = connector; |
|
- | 305 | crtc = encoder->crtc; |
|
- | 306 | ||
- | 307 | break; |
|
- | 308 | }; |
|
- | 309 | ||
- | 310 | ||
- | 311 | if(crtc == NULL) |
|
- | 312 | { |
|
- | 313 | struct drm_crtc *tmp_crtc; |
|
- | 314 | int crtc_mask = 1; |
|
- | 315 | ||
- | 316 | list_for_each_entry(tmp_crtc, &dev->mode_config.crtc_list, head) |
|
- | 317 | { |
|
- | 318 | if (encoder->possible_crtcs & crtc_mask) |
|
- | 319 | { |
|
- | 320 | crtc = tmp_crtc; |
|
- | 321 | encoder->crtc = crtc; |
|
- | 322 | break; |
|
- | 323 | }; |
|
- | 324 | crtc_mask <<= 1; |
|
- | 325 | }; |
|
- | 326 | ||
- | 327 | if(crtc == NULL) |
|
- | 328 | { |
|
- | 329 | dbgprintf("No CRTC for encoder %d\n", encoder->base.id); |
|
- | 330 | goto out; |
|
- | 331 | } |
|
- | 332 | }; |
|
- | 333 | DRM_DEBUG_KMS("[CRTC:%d]\n", crtc->base.id); |
|
- | 334 | ||
- | 335 | drm_i915_private_t *dev_priv = dev->dev_private; |
|
- | 336 | struct drm_fb_helper *fb_helper = &dev_priv->fbdev->helper; |
|
- | 337 | struct drm_display_mode *mode = NULL, *tmpmode; |
|
- | 338 | ||
- | 339 | list_for_each_entry(tmpmode, &connector->modes, head) |
|
- | 340 | { |
|
- | 341 | if( (drm_mode_width(tmpmode) == 1024) && |
|
- | 342 | (drm_mode_height(tmpmode) == 768) && |
|
- | 343 | (drm_mode_vrefresh(tmpmode) == 60) ) |
|
- | 344 | { |
|
- | 345 | mode = tmpmode; |
|
- | 346 | goto do_set; |
|
- | 347 | } |
|
- | 348 | }; |
|
- | 349 | if( (mode == NULL) ) |
|
- | 350 | { |
|
- | 351 | list_for_each_entry(tmpmode, &connector->modes, head) |
|
- | 352 | { |
|
- | 353 | if( (drm_mode_width(tmpmode) == 1024) && |
|
- | 354 | (drm_mode_height(tmpmode) == 768) ) |
|
- | 355 | { |
|
- | 356 | mode = tmpmode; |
|
- | 357 | goto do_set; |
|
- | 358 | } |
|
- | 359 | }; |
|
- | 360 | }; |
|
- | 361 | goto out; |
|
- | 362 | ||
- | 363 | do_set: |
|
- | 364 | { |
|
- | 365 | ||
- | 366 | typedef struct tag_display display_t; |
|
- | 367 | ||
- | 368 | struct tag_display |
|
- | 369 | { |
|
- | 370 | int x; |
|
- | 371 | int y; |
|
- | 372 | int width; |
|
- | 373 | int height; |
|
- | 374 | int bpp; |
|
- | 375 | int vrefresh; |
|
- | 376 | int pitch; |
|
- | 377 | int lfb; |
|
- | 378 | ||
- | 379 | int supported_modes; |
|
- | 380 | struct drm_device *ddev; |
|
- | 381 | struct drm_connector *connector; |
|
- | 382 | struct drm_crtc *crtc; |
|
- | 383 | ||
- | 384 | }; |
|
- | 385 | ||
- | 386 | display_t *rdisplay; |
|
- | 387 | ||
- | 388 | rdisplay = GetDisplay(); |
|
- | 389 | ||
- | 390 | con_name = drm_get_connector_name(connector); |
|
- | 391 | enc_name = drm_get_encoder_name(encoder); |
|
- | 392 | ||
- | 393 | dbgprintf("set mode %d %d connector %s encoder %s\n", |
|
- | 394 | 1024, 768, con_name, enc_name); |
|
- | 395 | ||
- | 396 | fb = fb_helper->fb; |
|
- | 397 | ||
- | 398 | fb->width = 1024; |
|
- | 399 | fb->height = 768; |
|
- | 400 | fb->pitch = ALIGN(1024* ((32 + 7) / 8), 64); |
|
- | 401 | fb->bits_per_pixel = 32; |
|
- | 402 | fb->depth == 24; |
|
- | 403 | ||
- | 404 | crtc->fb = fb; |
|
- | 405 | crtc->enabled = true; |
|
- | 406 | ||
- | 407 | ret = drm_crtc_helper_set_mode(crtc, mode, 0, 0, fb); |
|
- | 408 | ||
- | 409 | if (ret == true) |
|
- | 410 | { |
|
- | 411 | rdisplay->width = fb->width; |
|
- | 412 | rdisplay->height = fb->height; |
|
- | 413 | rdisplay->pitch = fb->pitch; |
|
- | 414 | rdisplay->vrefresh = drm_mode_vrefresh(mode); |
|
- | 415 | ||
- | 416 | sysSetScreen(fb->width, fb->height, fb->pitch); |
|
- | 417 | ||
- | 418 | dbgprintf("new mode %d x %d pitch %d\n", |
|
- | 419 | fb->width, fb->height, fb->pitch); |
|
- | 420 | } |
|
- | 421 | else |
|
- | 422 | DRM_ERROR("failed to set mode %d_%d on crtc %p\n", |
|
- | 423 | fb->width, fb->height, crtc); |
|
- | 424 | }; |
|
- | 425 | }; |
|
Line 269... | Line -... | ||
269 | - | ||
270 | 426 | ||
271 | 427 | out: |
|
Line 272... | Line 428... | ||
272 | ret = i915_driver_load(dev, ent->driver_data ); |
428 | |
273 | // if (ret) |
429 | // if (ret) |