Rev 6660 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6660 | Rev 6937 | ||
---|---|---|---|
Line 195... | Line 195... | ||
195 | struct intel_plane *intel_plane = to_intel_plane(drm_plane); |
195 | struct intel_plane *intel_plane = to_intel_plane(drm_plane); |
196 | struct drm_i915_gem_object *obj = intel_fb_obj(fb); |
196 | struct drm_i915_gem_object *obj = intel_fb_obj(fb); |
197 | const int pipe = intel_plane->pipe; |
197 | const int pipe = intel_plane->pipe; |
198 | const int plane = intel_plane->plane + 1; |
198 | const int plane = intel_plane->plane + 1; |
199 | u32 plane_ctl, stride_div, stride; |
199 | u32 plane_ctl, stride_div, stride; |
200 | int pixel_size = drm_format_plane_cpp(fb->pixel_format, 0); |
- | |
201 | const struct drm_intel_sprite_colorkey *key = |
200 | const struct drm_intel_sprite_colorkey *key = |
202 | &to_intel_plane_state(drm_plane->state)->ckey; |
201 | &to_intel_plane_state(drm_plane->state)->ckey; |
203 | u32 surf_addr; |
202 | u32 surf_addr; |
204 | u32 tile_height, plane_offset, plane_size; |
203 | u32 tile_height, plane_offset, plane_size; |
205 | unsigned int rotation; |
204 | unsigned int rotation; |
Line 215... | Line 214... | ||
215 | plane_ctl |= skl_plane_ctl_tiling(fb->modifier[0]); |
214 | plane_ctl |= skl_plane_ctl_tiling(fb->modifier[0]); |
Line 216... | Line 215... | ||
216 | 215 | ||
217 | rotation = drm_plane->state->rotation; |
216 | rotation = drm_plane->state->rotation; |
Line 218... | Line -... | ||
218 | plane_ctl |= skl_plane_ctl_rotation(rotation); |
- | |
219 | - | ||
220 | intel_update_sprite_watermarks(drm_plane, crtc, src_w, src_h, |
- | |
221 | pixel_size, true, |
- | |
222 | src_w != crtc_w || src_h != crtc_h); |
217 | plane_ctl |= skl_plane_ctl_rotation(rotation); |
223 | 218 | ||
Line 224... | Line 219... | ||
224 | stride_div = intel_fb_stride_alignment(dev, fb->modifier[0], |
219 | stride_div = intel_fb_stride_alignment(dev, fb->modifier[0], |
Line 300... | Line 295... | ||
300 | 295 | ||
Line 301... | Line 296... | ||
301 | I915_WRITE(PLANE_CTL(pipe, plane), 0); |
296 | I915_WRITE(PLANE_CTL(pipe, plane), 0); |
302 | 297 | ||
303 | I915_WRITE(PLANE_SURF(pipe, plane), 0); |
- | |
304 | POSTING_READ(PLANE_SURF(pipe, plane)); |
- | |
305 | 298 | I915_WRITE(PLANE_SURF(pipe, plane), 0); |
|
Line 306... | Line 299... | ||
306 | intel_update_sprite_watermarks(dplane, crtc, 0, 0, 0, false, false); |
299 | POSTING_READ(PLANE_SURF(pipe, plane)); |
307 | } |
300 | } |
308 | 301 | ||
Line 544... | Line 537... | ||
544 | sprctl |= SPRITE_TRICKLE_FEED_DISABLE; |
537 | sprctl |= SPRITE_TRICKLE_FEED_DISABLE; |
Line 545... | Line 538... | ||
545 | 538 | ||
546 | if (IS_HASWELL(dev) || IS_BROADWELL(dev)) |
539 | if (IS_HASWELL(dev) || IS_BROADWELL(dev)) |
Line 547... | Line -... | ||
547 | sprctl |= SPRITE_PIPE_CSC_ENABLE; |
- | |
548 | - | ||
549 | intel_update_sprite_watermarks(plane, crtc, src_w, src_h, pixel_size, |
- | |
550 | true, |
- | |
551 | src_w != crtc_w || src_h != crtc_h); |
540 | sprctl |= SPRITE_PIPE_CSC_ENABLE; |
552 | 541 | ||
553 | /* Sizes are 0 based */ |
542 | /* Sizes are 0 based */ |
554 | src_w--; |
543 | src_w--; |
555 | src_h--; |
544 | src_h--; |
Line 681... | Line 670... | ||
681 | dvscntr |= DVS_TILED; |
670 | dvscntr |= DVS_TILED; |
Line 682... | Line 671... | ||
682 | 671 | ||
683 | if (IS_GEN6(dev)) |
672 | if (IS_GEN6(dev)) |
Line 684... | Line -... | ||
684 | dvscntr |= DVS_TRICKLE_FEED_DISABLE; /* must disable */ |
- | |
685 | - | ||
686 | intel_update_sprite_watermarks(plane, crtc, src_w, src_h, |
- | |
687 | pixel_size, true, |
- | |
688 | src_w != crtc_w || src_h != crtc_h); |
673 | dvscntr |= DVS_TRICKLE_FEED_DISABLE; /* must disable */ |
689 | 674 | ||
690 | /* Sizes are 0 based */ |
675 | /* Sizes are 0 based */ |
691 | src_w--; |
676 | src_w--; |
692 | src_h--; |
677 | src_h--; |
Line 835... | Line 820... | ||
835 | if (state->visible) { |
820 | if (state->visible) { |
836 | /* check again in case clipping clamped the results */ |
821 | /* check again in case clipping clamped the results */ |
837 | hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); |
822 | hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale); |
838 | if (hscale < 0) { |
823 | if (hscale < 0) { |
839 | DRM_DEBUG_KMS("Horizontal scaling factor out of limits\n"); |
824 | DRM_DEBUG_KMS("Horizontal scaling factor out of limits\n"); |
840 | drm_rect_debug_print(src, true); |
825 | drm_rect_debug_print("src: ", src, true); |
841 | drm_rect_debug_print(dst, false); |
826 | drm_rect_debug_print("dst: ", dst, false); |
Line 842... | Line 827... | ||
842 | 827 | ||
843 | return hscale; |
828 | return hscale; |
Line 844... | Line 829... | ||
844 | } |
829 | } |
845 | 830 | ||
846 | vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); |
831 | vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale); |
847 | if (vscale < 0) { |
832 | if (vscale < 0) { |
848 | DRM_DEBUG_KMS("Vertical scaling factor out of limits\n"); |
833 | DRM_DEBUG_KMS("Vertical scaling factor out of limits\n"); |
Line 849... | Line 834... | ||
849 | drm_rect_debug_print(src, true); |
834 | drm_rect_debug_print("src: ", src, true); |
850 | drm_rect_debug_print(dst, false); |
835 | drm_rect_debug_print("dst: ", dst, false); |
Line 851... | Line 836... | ||
851 | 836 | ||
Line 941... | Line 926... | ||
941 | struct intel_plane *intel_plane = to_intel_plane(plane); |
926 | struct intel_plane *intel_plane = to_intel_plane(plane); |
942 | struct drm_framebuffer *fb = state->base.fb; |
927 | struct drm_framebuffer *fb = state->base.fb; |
Line 943... | Line 928... | ||
943 | 928 | ||
Line 944... | Line -... | ||
944 | crtc = crtc ? crtc : plane->crtc; |
- | |
945 | - | ||
946 | if (!crtc->state->active) |
- | |
947 | return; |
929 | crtc = crtc ? crtc : plane->crtc; |
948 | 930 | ||
949 | if (state->visible) { |
931 | if (state->visible) { |
950 | intel_plane->update_plane(plane, crtc, fb, |
932 | intel_plane->update_plane(plane, crtc, fb, |
951 | state->dst.x1, state->dst.y1, |
933 | state->dst.x1, state->dst.y1, |
Line 972... | Line 954... | ||
972 | 954 | ||
973 | /* Make sure we don't try to enable both src & dest simultaneously */ |
955 | /* Make sure we don't try to enable both src & dest simultaneously */ |
974 | if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) |
956 | if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) |
Line 975... | Line 957... | ||
975 | return -EINVAL; |
957 | return -EINVAL; |
976 | 958 | ||
977 | if (IS_VALLEYVIEW(dev) && |
959 | if ((IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) && |
Line 978... | Line 960... | ||
978 | set->flags & I915_SET_COLORKEY_DESTINATION) |
960 | set->flags & I915_SET_COLORKEY_DESTINATION) |
979 | return -EINVAL; |
961 | return -EINVAL; |
Line 1107... | Line 1089... | ||
1107 | } else { |
1089 | } else { |
1108 | intel_plane->can_scale = false; |
1090 | intel_plane->can_scale = false; |
1109 | intel_plane->max_downscale = 1; |
1091 | intel_plane->max_downscale = 1; |
1110 | } |
1092 | } |
Line 1111... | Line 1093... | ||
1111 | 1093 | ||
1112 | if (IS_VALLEYVIEW(dev)) { |
1094 | if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) { |
1113 | intel_plane->update_plane = vlv_update_plane; |
1095 | intel_plane->update_plane = vlv_update_plane; |
Line 1114... | Line 1096... | ||
1114 | intel_plane->disable_plane = vlv_disable_plane; |
1096 | intel_plane->disable_plane = vlv_disable_plane; |
1115 | 1097 | ||
Line 1144... | Line 1126... | ||
1144 | intel_plane->commit_plane = intel_commit_sprite_plane; |
1126 | intel_plane->commit_plane = intel_commit_sprite_plane; |
1145 | possible_crtcs = (1 << pipe); |
1127 | possible_crtcs = (1 << pipe); |
1146 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, |
1128 | ret = drm_universal_plane_init(dev, &intel_plane->base, possible_crtcs, |
1147 | &intel_plane_funcs, |
1129 | &intel_plane_funcs, |
1148 | plane_formats, num_plane_formats, |
1130 | plane_formats, num_plane_formats, |
1149 | DRM_PLANE_TYPE_OVERLAY); |
1131 | DRM_PLANE_TYPE_OVERLAY, NULL); |
1150 | if (ret) { |
1132 | if (ret) { |
1151 | kfree(intel_plane); |
1133 | kfree(intel_plane); |
1152 | goto out; |
1134 | goto out; |
1153 | } |
1135 | } |