Rev 4539 | Rev 4560 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4539 | Rev 4557 | ||
---|---|---|---|
Line 109... | Line 109... | ||
109 | struct drm_mode_set set; |
109 | struct drm_mode_set set; |
110 | const char *con_name; |
110 | const char *con_name; |
111 | const char *enc_name; |
111 | const char *enc_name; |
112 | unsigned hdisplay, vdisplay; |
112 | unsigned hdisplay, vdisplay; |
113 | int ret; |
113 | int stride; |
- | 114 | int ret; |
|
114 | 115 | ||
Line 115... | Line 116... | ||
115 | mutex_lock(&dev->mode_config.mutex); |
116 | mutex_lock(&dev->mode_config.mutex); |
Line 116... | Line 117... | ||
116 | 117 | ||
Line 167... | Line 168... | ||
167 | 168 | ||
Line 168... | Line 169... | ||
168 | fb->width = reqmode->width; |
169 | fb->width = reqmode->width; |
169 | fb->height = reqmode->height; |
170 | fb->height = reqmode->height; |
Line 170... | Line 171... | ||
170 | 171 | ||
- | 172 | if(dev_priv->mm.bit_6_swizzle_x != I915_BIT_6_SWIZZLE_NONE) |
|
171 | fb->pitches[0] = fb->pitches[1] = fb->pitches[2] = |
173 | { |
Line -... | Line 174... | ||
- | 174 | fb_obj->tiling_mode = I915_TILING_X; |
|
- | 175 | ||
- | 176 | if(IS_GEN3(dev)) |
|
- | 177 | for (stride = 512; stride < reqmode->width * 4; stride <<= 1); |
|
- | 178 | else |
|
- | 179 | stride = ALIGN(reqmode->width * 4, 512); |
|
- | 180 | } |
|
- | 181 | else |
|
- | 182 | { |
|
- | 183 | fb_obj->tiling_mode = I915_TILING_NONE; |
|
- | 184 | stride = ALIGN(reqmode->width * 4, 64); |
|
- | 185 | } |
|
- | 186 | ||
- | 187 | fb->pitches[0] = |
|
- | 188 | fb->pitches[1] = |
|
- | 189 | fb->pitches[2] = |
|
172 | fb->pitches[3] = ALIGN(reqmode->width * 4, 512); |
190 | fb->pitches[3] = stride; |
Line 173... | Line 191... | ||
173 | 191 | ||
174 | fb_obj->stride = fb->pitches[0]; |
192 | fb_obj->stride = stride; |
Line 175... | Line 193... | ||
175 | 193 | ||
Line 588... | Line 606... | ||
588 | return 0; |
606 | return 0; |
589 | } |
607 | } |
Line 590... | Line -... | ||
590 | - | ||
591 | - | ||
592 | static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base) |
- | |
593 | { |
- | |
594 | struct drm_device *dev = crtc->dev; |
- | |
595 | struct drm_i915_private *dev_priv = dev->dev_private; |
- | |
596 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
- | |
597 | int pipe = intel_crtc->pipe; |
- | |
598 | bool visible = base != 0; |
- | |
599 | - | ||
600 | if (intel_crtc->cursor_visible != visible) { |
- | |
601 | uint32_t cntl = I915_READ(CURCNTR(pipe)); |
- | |
602 | if (base) { |
- | |
603 | cntl &= ~(CURSOR_MODE | MCURSOR_PIPE_SELECT); |
- | |
604 | cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE; |
- | |
605 | cntl |= pipe << 28; /* Connect to correct pipe */ |
- | |
606 | } else { |
- | |
607 | cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE); |
- | |
608 | cntl |= CURSOR_MODE_DISABLE; |
- | |
609 | } |
- | |
610 | I915_WRITE(CURCNTR(pipe), cntl); |
- | |
611 | - | ||
612 | intel_crtc->cursor_visible = visible; |
- | |
613 | } |
- | |
614 | /* and commit changes on next vblank */ |
- | |
615 | I915_WRITE(CURBASE(pipe), base); |
- | |
616 | } |
608 | |
617 | 609 | ||
618 | void __stdcall move_cursor_kms(cursor_t *cursor, int x, int y) |
- | |
619 | { |
610 | void __stdcall move_cursor_kms(cursor_t *cursor, int x, int y) |
620 | struct drm_i915_private *dev_priv = os_display->ddev->dev_private; |
611 | { |
621 | struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
612 | struct drm_crtc *crtc = os_display->crtc; |
622 | u32 base, pos; |
- | |
623 | bool visible; |
- | |
Line 624... | Line -... | ||
624 | - | ||
625 | int pipe = intel_crtc->pipe; |
613 | x-= cursor->hot_x; |
626 | - | ||
627 | intel_crtc->cursor_x = x; |
- | |
628 | intel_crtc->cursor_y = y; |
- | |
629 | - | ||
630 | x = x - cursor->hot_x; |
- | |
631 | y = y - cursor->hot_y; |
- | |
632 | - | ||
633 | - | ||
634 | pos = 0; |
- | |
635 | - | ||
636 | base = intel_crtc->cursor_addr; |
- | |
637 | if (x >= os_display->width) |
- | |
638 | base = 0; |
- | |
639 | - | ||
640 | if (y >= os_display->height) |
- | |
641 | base = 0; |
- | |
642 | - | ||
643 | if (x < 0) |
- | |
644 | { |
- | |
645 | if (x + intel_crtc->cursor_width < 0) |
- | |
646 | base = 0; |
- | |
647 | - | ||
648 | pos |= CURSOR_POS_SIGN << CURSOR_X_SHIFT; |
- | |
649 | x = -x; |
- | |
650 | } |
- | |
651 | pos |= x << CURSOR_X_SHIFT; |
- | |
652 | - | ||
653 | if (y < 0) |
- | |
654 | { |
- | |
655 | if (y + intel_crtc->cursor_height < 0) |
- | |
656 | base = 0; |
- | |
657 | - | ||
658 | pos |= CURSOR_POS_SIGN << CURSOR_Y_SHIFT; |
- | |
659 | y = -y; |
- | |
660 | } |
- | |
661 | pos |= y << CURSOR_Y_SHIFT; |
- | |
662 | - | ||
663 | visible = base != 0; |
- | |
664 | if (!visible && !intel_crtc->cursor_visible) |
- | |
665 | return; |
- | |
666 | 614 | y-= cursor->hot_y; |
|
667 | I915_WRITE(CURPOS(pipe), pos); |
- | |
668 | // if (IS_845G(dev) || IS_I865G(dev)) |
- | |
Line 669... | Line 615... | ||
669 | // i845_update_cursor(crtc, base); |
615 | |
Line 670... | Line 616... | ||
670 | // else |
616 | if (crtc->funcs->cursor_move) |
Line 681... | Line 627... | ||
681 | 627 | ||
Line 682... | Line 628... | ||
682 | old = os_display->cursor; |
628 | old = os_display->cursor; |
683 | os_display->cursor = cursor; |
629 | os_display->cursor = cursor; |
Line -... | Line 630... | ||
- | 630 | ||
- | 631 | intel_crtc->cursor_bo = cursor->cobj; |
|
684 | 632 | ||
685 | if (!dev_priv->info->cursor_needs_physical) |
633 | if (!dev_priv->info->cursor_needs_physical) |
686 | intel_crtc->cursor_addr = i915_gem_obj_ggtt_offset(cursor->cobj); |
634 | intel_crtc->cursor_addr = i915_gem_obj_ggtt_offset(cursor->cobj); |
687 | else |
635 | else |