Rev 4358 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4358 | Rev 5080 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | * Add textures as DRM framebuffers. |
59 | * Add textures as DRM framebuffers. |
60 | */ |
60 | */ |
61 | static boolean |
61 | static boolean |
62 | drm_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back) |
62 | drm_surface_init_framebuffers(struct native_surface *nsurf, boolean need_back) |
63 | { |
63 | { |
- | 64 | #if 0 |
|
64 | struct drm_surface *drmsurf = drm_surface(nsurf); |
65 | struct drm_surface *drmsurf = drm_surface(nsurf); |
65 | struct drm_display *drmdpy = drmsurf->drmdpy; |
66 | struct drm_display *drmdpy = drmsurf->drmdpy; |
66 | int num_framebuffers = (need_back) ? 2 : 1; |
67 | int num_framebuffers = (need_back) ? 2 : 1; |
67 | int i, err; |
68 | int i, err; |
Line 113... | Line 114... | ||
113 | return FALSE; |
114 | return FALSE; |
114 | } |
115 | } |
115 | } |
116 | } |
Line 116... | Line 117... | ||
116 | 117 | ||
- | 118 | return TRUE; |
|
- | 119 | #endif |
|
117 | return TRUE; |
120 | return FALSE; |
Line 118... | Line 121... | ||
118 | } |
121 | } |
119 | 122 | ||
120 | static boolean |
123 | static boolean |
121 | drm_surface_flush_frontbuffer(struct native_surface *nsurf) |
124 | drm_surface_flush_frontbuffer(struct native_surface *nsurf) |
122 | { |
- | |
123 | #ifdef DRM_MODE_FEATURE_DIRTYFB |
- | |
124 | struct drm_surface *drmsurf = drm_surface(nsurf); |
- | |
125 | struct drm_display *drmdpy = drmsurf->drmdpy; |
- | |
126 | - | ||
127 | if (drmsurf->front_fb.is_passive) |
125 | { |
Line 128... | Line 126... | ||
128 | drmModeDirtyFB(drmdpy->fd, drmsurf->front_fb.buffer_id, NULL, 0); |
126 | #ifdef DRM_MODE_FEATURE_DIRTYFB |
129 | #endif |
127 | #endif |
Line 151... | Line 149... | ||
151 | } |
149 | } |
Line 152... | Line 150... | ||
152 | 150 | ||
153 | static boolean |
151 | static boolean |
154 | drm_surface_swap_buffers(struct native_surface *nsurf) |
152 | drm_surface_swap_buffers(struct native_surface *nsurf) |
- | 153 | { |
|
155 | { |
154 | #if 0 |
156 | struct drm_surface *drmsurf = drm_surface(nsurf); |
155 | struct drm_surface *drmsurf = drm_surface(nsurf); |
157 | struct drm_crtc *drmcrtc = &drmsurf->current_crtc; |
156 | struct drm_crtc *drmcrtc = &drmsurf->current_crtc; |
158 | struct drm_display *drmdpy = drmsurf->drmdpy; |
157 | struct drm_display *drmdpy = drmsurf->drmdpy; |
159 | struct drm_framebuffer tmp_fb; |
158 | struct drm_framebuffer tmp_fb; |
Line 185... | Line 184... | ||
185 | NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, FALSE); |
184 | NATIVE_ATTACHMENT_FRONT_LEFT, NATIVE_ATTACHMENT_BACK_LEFT, FALSE); |
186 | /* the front/back textures are swapped */ |
185 | /* the front/back textures are swapped */ |
187 | drmsurf->sequence_number++; |
186 | drmsurf->sequence_number++; |
188 | drmdpy->event_handler->invalid_surface(&drmdpy->base, |
187 | drmdpy->event_handler->invalid_surface(&drmdpy->base, |
189 | &drmsurf->base, drmsurf->sequence_number); |
188 | &drmsurf->base, drmsurf->sequence_number); |
- | 189 | #endif |
|
Line 190... | Line 190... | ||
190 | 190 | ||
191 | return TRUE; |
191 | return TRUE; |
Line 192... | Line 192... | ||
192 | } |
192 | } |
Line 227... | Line 227... | ||
227 | } |
227 | } |
Line 228... | Line 228... | ||
228 | 228 | ||
229 | static void |
229 | static void |
230 | drm_surface_destroy(struct native_surface *nsurf) |
230 | drm_surface_destroy(struct native_surface *nsurf) |
- | 231 | { |
|
231 | { |
232 | #if 0 |
Line 232... | Line 233... | ||
232 | struct drm_surface *drmsurf = drm_surface(nsurf); |
233 | struct drm_surface *drmsurf = drm_surface(nsurf); |
233 | 234 | ||
234 | resource_surface_wait(drmsurf->rsurf); |
235 | resource_surface_wait(drmsurf->rsurf); |
Line 243... | Line 244... | ||
243 | drmModeRmFB(drmsurf->drmdpy->fd, drmsurf->back_fb.buffer_id); |
244 | drmModeRmFB(drmsurf->drmdpy->fd, drmsurf->back_fb.buffer_id); |
244 | pipe_resource_reference(&drmsurf->back_fb.texture, NULL); |
245 | pipe_resource_reference(&drmsurf->back_fb.texture, NULL); |
Line 245... | Line 246... | ||
245 | 246 | ||
246 | resource_surface_destroy(drmsurf->rsurf); |
247 | resource_surface_destroy(drmsurf->rsurf); |
- | 248 | FREE(drmsurf); |
|
247 | FREE(drmsurf); |
249 | #endif |
Line 248... | Line 250... | ||
248 | } |
250 | } |
249 | 251 | ||
250 | static struct drm_surface * |
252 | static struct drm_surface * |
Line 330... | Line 332... | ||
330 | drm_display_choose_crtc(struct native_display *ndpy, |
332 | drm_display_choose_crtc(struct native_display *ndpy, |
331 | uint32_t *connectors, int num_connectors) |
333 | uint32_t *connectors, int num_connectors) |
332 | { |
334 | { |
333 | struct drm_display *drmdpy = drm_display(ndpy); |
335 | struct drm_display *drmdpy = drm_display(ndpy); |
334 | int idx; |
336 | int idx; |
335 | 337 | #if 0 |
|
336 | for (idx = 0; idx < drmdpy->resources->count_crtcs; idx++) { |
338 | for (idx = 0; idx < drmdpy->resources->count_crtcs; idx++) { |
337 | boolean found_crtc = TRUE; |
339 | boolean found_crtc = TRUE; |
338 | int i, j; |
340 | int i, j; |
Line 339... | Line 341... | ||
339 | 341 | ||
Line 375... | Line 377... | ||
375 | num_connectors); |
377 | num_connectors); |
376 | return 0; |
378 | return 0; |
377 | } |
379 | } |
Line 378... | Line 380... | ||
378 | 380 | ||
- | 381 | return drmdpy->resources->crtcs[idx]; |
|
- | 382 | #endif |
|
379 | return drmdpy->resources->crtcs[idx]; |
383 | return 0; |
Line 380... | Line 384... | ||
380 | } |
384 | } |
381 | 385 | ||
382 | /** |
386 | /** |
Line 390... | Line 394... | ||
390 | { |
394 | { |
391 | struct drm_display *drmdpy = drm_display(ndpy); |
395 | struct drm_display *drmdpy = drm_display(ndpy); |
392 | struct drm_crtc *drmcrtc = &drmdpy->saved_crtcs[crtc_idx]; |
396 | struct drm_crtc *drmcrtc = &drmdpy->saved_crtcs[crtc_idx]; |
393 | uint32_t crtc_id; |
397 | uint32_t crtc_id; |
394 | int err; |
398 | int err; |
395 | 399 | #if 0 |
|
396 | if (drmcrtc->crtc) { |
400 | if (drmcrtc->crtc) { |
397 | crtc_id = drmcrtc->crtc->crtc_id; |
401 | crtc_id = drmcrtc->crtc->crtc_id; |
398 | } |
402 | } |
399 | else { |
403 | else { |
400 | int count = 0, i; |
404 | int count = 0, i; |
Line 439... | Line 443... | ||
439 | 443 | ||
440 | return FALSE; |
444 | return FALSE; |
Line 441... | Line 445... | ||
441 | } |
445 | } |
- | 446 | ||
- | 447 | return TRUE; |
|
- | 448 | #endif |
|
442 | 449 | return FALSE; |
|
Line 443... | Line 450... | ||
443 | return TRUE; |
450 | |
444 | } |
451 | } |
445 | 452 | ||
446 | static boolean |
453 | static boolean |
447 | drm_display_program(struct native_display *ndpy, int crtc_idx, |
454 | drm_display_program(struct native_display *ndpy, int crtc_idx, |
448 | struct native_surface *nsurf, uint x, uint y, |
455 | struct native_surface *nsurf, uint x, uint y, |
- | 456 | const struct native_connector **nconns, int num_nconns, |
|
449 | const struct native_connector **nconns, int num_nconns, |
457 | const struct native_mode *nmode) |
450 | const struct native_mode *nmode) |
458 | { |
451 | { |
459 | #if 0 |
452 | struct drm_display *drmdpy = drm_display(ndpy); |
460 | struct drm_display *drmdpy = drm_display(ndpy); |
453 | struct drm_surface *drmsurf = drm_surface(nsurf); |
461 | struct drm_surface *drmsurf = drm_surface(nsurf); |
Line 510... | Line 518... | ||
510 | 518 | ||
511 | drmsurf->is_shown = TRUE; |
519 | drmsurf->is_shown = TRUE; |
Line 512... | Line 520... | ||
512 | } |
520 | } |
- | 521 | ||
- | 522 | return TRUE; |
|
- | 523 | #endif |
|
513 | 524 | return FALSE; |
|
Line 514... | Line 525... | ||
514 | return TRUE; |
525 | |
515 | } |
526 | } |
516 | 527 | ||
517 | static const struct native_mode ** |
528 | static const struct native_mode ** |
518 | drm_display_get_modes(struct native_display *ndpy, |
529 | drm_display_get_modes(struct native_display *ndpy, |
- | 530 | const struct native_connector *nconn, |
|
519 | const struct native_connector *nconn, |
531 | int *num_modes) |
520 | int *num_modes) |
532 | { |
521 | { |
533 | #if 0 |
522 | struct drm_display *drmdpy = drm_display(ndpy); |
534 | struct drm_display *drmdpy = drm_display(ndpy); |
Line 570... | Line 582... | ||
570 | if (num_modes) |
582 | if (num_modes) |
571 | *num_modes = count; |
583 | *num_modes = count; |
572 | } |
584 | } |
Line 573... | Line 585... | ||
573 | 585 | ||
- | 586 | return nmodes_return; |
|
- | 587 | #endif |
|
574 | return nmodes_return; |
588 | return NULL; |
Line 575... | Line 589... | ||
575 | } |
589 | } |
576 | 590 | ||
577 | static const struct native_connector ** |
591 | static const struct native_connector ** |
578 | drm_display_get_connectors(struct native_display *ndpy, int *num_connectors, |
592 | drm_display_get_connectors(struct native_display *ndpy, int *num_connectors, |
- | 593 | int *num_crtc) |
|
579 | int *num_crtc) |
594 | { |
580 | { |
595 | #if 0 |
581 | struct drm_display *drmdpy = drm_display(ndpy); |
596 | struct drm_display *drmdpy = drm_display(ndpy); |
Line 582... | Line 597... | ||
582 | const struct native_connector **connectors; |
597 | const struct native_connector **connectors; |
Line 608... | Line 623... | ||
608 | 623 | ||
609 | if (num_crtc) |
624 | if (num_crtc) |
Line 610... | Line 625... | ||
610 | *num_crtc = drmdpy->resources->count_crtcs; |
625 | *num_crtc = drmdpy->resources->count_crtcs; |
- | 626 | ||
- | 627 | return connectors; |
|
611 | 628 | #endif |
|
Line 612... | Line 629... | ||
612 | return connectors; |
629 | return NULL; |
613 | } |
630 | } |
614 | 631 | ||
Line 631... | Line 648... | ||
631 | }; |
648 | }; |
Line 632... | Line 649... | ||
632 | 649 | ||
633 | void |
650 | void |
634 | drm_display_fini_modeset(struct native_display *ndpy) |
651 | drm_display_fini_modeset(struct native_display *ndpy) |
- | 652 | { |
|
635 | { |
653 | #if 0 |
636 | struct drm_display *drmdpy = drm_display(ndpy); |
654 | struct drm_display *drmdpy = drm_display(ndpy); |
Line 637... | Line 655... | ||
637 | int i; |
655 | int i; |
638 | 656 | ||
Line 671... | Line 689... | ||
671 | drmModeFreeResources(drmdpy->resources); |
689 | drmModeFreeResources(drmdpy->resources); |
672 | drmdpy->resources = NULL; |
690 | drmdpy->resources = NULL; |
673 | } |
691 | } |
Line 674... | Line 692... | ||
674 | 692 | ||
- | 693 | drmdpy->base.modeset = NULL; |
|
675 | drmdpy->base.modeset = NULL; |
694 | #endif |
Line 676... | Line 695... | ||
676 | } |
695 | } |
677 | 696 | ||
678 | boolean |
697 | boolean |
- | 698 | drm_display_init_modeset(struct native_display *ndpy) |
|
679 | drm_display_init_modeset(struct native_display *ndpy) |
699 | { |
Line 680... | Line 700... | ||
680 | { |
700 | #if 0 |
681 | struct drm_display *drmdpy = drm_display(ndpy); |
701 | struct drm_display *drmdpy = drm_display(ndpy); |
682 | 702 | ||
Line 700... | Line 720... | ||
700 | drm_display_fini_modeset(&drmdpy->base); |
720 | drm_display_fini_modeset(&drmdpy->base); |
701 | return FALSE; |
721 | return FALSE; |
702 | } |
722 | } |
Line 703... | Line 723... | ||
703 | 723 | ||
704 | drmdpy->base.modeset = &drm_display_modeset; |
724 | drmdpy->base.modeset = &drm_display_modeset; |
705 | 725 | #endif |
|
706 | return TRUE; |
726 | return TRUE; |