[03/11] drm/i915: Stage scaler request for NV12 as src format
diff mbox

Message ID 1430451795-9657-4-git-send-email-chandra.konduru@intel.com
State New
Headers show

Commit Message

Chandra Konduru May 1, 2015, 3:43 a.m. UTC
This patch stages a scaler request when input format
is NV12. The same scaler does both chroma-upsampling
and resolution scaling as needed.

Signed-off-by: Chandra Konduru <chandra.konduru@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 22799fb..9d413a6 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4444,9 +4444,11 @@  skl_update_scaler_users(
 		rotation = DRM_ROTATE_0;
 	}
 
-	need_scaling = intel_rotation_90_or_270(rotation) ?
-		(src_h != dst_w || src_w != dst_h):
-		(src_w != dst_w || src_h != dst_h);
+	/* scaling is required when src dst sizes doesn't match or format is NV12 */
+	need_scaling = (src_w != dst_w || src_h != dst_h ||
+		(intel_rotation_90_or_270(rotation) &&
+			(src_h != dst_w || src_w != dst_h)) ||
+		(fb && fb->pixel_format == DRM_FORMAT_NV12));
 
 	/*
 	 * if plane is being disabled or scaler is no more required or force detach
@@ -4512,6 +4514,7 @@  skl_update_scaler_users(
 		case DRM_FORMAT_YVYU:
 		case DRM_FORMAT_UYVY:
 		case DRM_FORMAT_VYUY:
+		case DRM_FORMAT_NV12:
 			break;
 		default:
 			DRM_DEBUG_KMS("PLANE:%d FB:%d unsupported scaling format 0x%x\n",