aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandra Konduru <chandra.konduru@intel.com>2015-05-18 19:18:44 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-05-22 02:53:44 -0400
commit225c228a028388b215e1f8a18546af2c2802bbb5 (patch)
treef6bdc9e06281e0f3c28211fee7f98d19cf0da628
parent6d50b0650fb46050d883d1b439a8681178cb2326 (diff)
drm/i915/skl: don't fail colorkey + scaler request
There is a mplayer video failure reported with xv. This is because there is a request to do both plane scaling and colorkey. Because skl hw doesn't support plane scaling and colorkey at the same time, request is failed which is expected behavior. To make xv operate, this patch allows colorkey continue to work without using scaler. Then behavior would be similar to platforms without plane scaler support. Signed-off-by: Chandra Konduru <chandra.konduru@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90449 [danvet: change can_scale to bool as requested by Ville.] Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c14
-rw-r--r--drivers/gpu/drm/i915/intel_sprite.c30
2 files changed, 30 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index db665922edc2..657a33366e92 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4502,9 +4502,10 @@ skl_update_scaler_users(
4502 } 4502 }
4503 4503
4504 /* check colorkey */ 4504 /* check colorkey */
4505 if (intel_plane && intel_plane->ckey.flags != I915_SET_COLORKEY_NONE) { 4505 if (WARN_ON(intel_plane &&
4506 DRM_DEBUG_KMS("PLANE:%d scaling with color key not allowed", 4506 intel_plane->ckey.flags != I915_SET_COLORKEY_NONE)) {
4507 intel_plane->base.base.id); 4507 DRM_DEBUG_KMS("PLANE:%d scaling %ux%u->%ux%u not allowed with colorkey",
4508 intel_plane->base.base.id, src_w, src_h, dst_w, dst_h);
4508 return -EINVAL; 4509 return -EINVAL;
4509 } 4510 }
4510 4511
@@ -13261,8 +13262,11 @@ intel_check_primary_plane(struct drm_plane *plane,
13261 intel_atomic_get_crtc_state(state->base.state, intel_crtc) : NULL; 13262 intel_atomic_get_crtc_state(state->base.state, intel_crtc) : NULL;
13262 13263
13263 if (INTEL_INFO(dev)->gen >= 9) { 13264 if (INTEL_INFO(dev)->gen >= 9) {
13264 min_scale = 1; 13265 /* use scaler when colorkey is not required */
13265 max_scale = skl_max_scale(intel_crtc, crtc_state); 13266 if (to_intel_plane(plane)->ckey.flags == I915_SET_COLORKEY_NONE) {
13267 min_scale = 1;
13268 max_scale = skl_max_scale(intel_crtc, crtc_state);
13269 }
13266 can_position = true; 13270 can_position = true;
13267 } 13271 }
13268 13272
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 3f70d59dc712..2a90308cc9c0 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -770,6 +770,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
770 const struct drm_rect *clip = &state->clip; 770 const struct drm_rect *clip = &state->clip;
771 int hscale, vscale; 771 int hscale, vscale;
772 int max_scale, min_scale; 772 int max_scale, min_scale;
773 bool can_scale;
773 int pixel_size; 774 int pixel_size;
774 int ret; 775 int ret;
775 776
@@ -794,18 +795,29 @@ intel_check_sprite_plane(struct drm_plane *plane,
794 return -EINVAL; 795 return -EINVAL;
795 } 796 }
796 797
798 /* setup can_scale, min_scale, max_scale */
799 if (INTEL_INFO(dev)->gen >= 9) {
800 /* use scaler when colorkey is not required */
801 if (intel_plane->ckey.flags == I915_SET_COLORKEY_NONE) {
802 can_scale = 1;
803 min_scale = 1;
804 max_scale = skl_max_scale(intel_crtc, crtc_state);
805 } else {
806 can_scale = 0;
807 min_scale = DRM_PLANE_HELPER_NO_SCALING;
808 max_scale = DRM_PLANE_HELPER_NO_SCALING;
809 }
810 } else {
811 can_scale = intel_plane->can_scale;
812 max_scale = intel_plane->max_downscale << 16;
813 min_scale = intel_plane->can_scale ? 1 : (1 << 16);
814 }
815
797 /* 816 /*
798 * FIXME the following code does a bunch of fuzzy adjustments to the 817 * FIXME the following code does a bunch of fuzzy adjustments to the
799 * coordinates and sizes. We probably need some way to decide whether 818 * coordinates and sizes. We probably need some way to decide whether
800 * more strict checking should be done instead. 819 * more strict checking should be done instead.
801 */ 820 */
802 max_scale = intel_plane->max_downscale << 16;
803 min_scale = intel_plane->can_scale ? 1 : (1 << 16);
804
805 if (INTEL_INFO(dev)->gen >= 9) {
806 min_scale = 1;
807 max_scale = skl_max_scale(intel_crtc, crtc_state);
808 }
809 821
810 drm_rect_rotate(src, fb->width << 16, fb->height << 16, 822 drm_rect_rotate(src, fb->width << 16, fb->height << 16,
811 state->base.rotation); 823 state->base.rotation);
@@ -876,7 +888,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
876 * Must keep src and dst the 888 * Must keep src and dst the
877 * same if we can't scale. 889 * same if we can't scale.
878 */ 890 */
879 if (!intel_plane->can_scale) 891 if (!can_scale)
880 crtc_w &= ~1; 892 crtc_w &= ~1;
881 893
882 if (crtc_w == 0) 894 if (crtc_w == 0)
@@ -888,7 +900,7 @@ intel_check_sprite_plane(struct drm_plane *plane,
888 if (state->visible && (src_w != crtc_w || src_h != crtc_h)) { 900 if (state->visible && (src_w != crtc_w || src_h != crtc_h)) {
889 unsigned int width_bytes; 901 unsigned int width_bytes;
890 902
891 WARN_ON(!intel_plane->can_scale); 903 WARN_ON(!can_scale);
892 904
893 /* FIXME interlacing min height is 6 */ 905 /* FIXME interlacing min height is 6 */
894 906