From patchwork Wed Sep 19 13:56:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 10605885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4891A112B for ; Wed, 19 Sep 2018 13:57:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38EA92C224 for ; Wed, 19 Sep 2018 13:57:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D6922C269; Wed, 19 Sep 2018 13:57:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E6C012C224 for ; Wed, 19 Sep 2018 13:56:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FFE76E4FB; Wed, 19 Sep 2018 13:56:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mblankhorst.nl (mblankhorst.nl [141.105.120.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id C42046E502 for ; Wed, 19 Sep 2018 13:56:53 +0000 (UTC) From: Maarten Lankhorst To: intel-gfx@lists.freedesktop.org Date: Wed, 19 Sep 2018 15:56:35 +0200 Message-Id: <20180919135644.14182-7-maarten.lankhorst@linux.intel.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180919135644.14182-1-maarten.lankhorst@linux.intel.com> References: <20180919135644.14182-1-maarten.lankhorst@linux.intel.com> Subject: [Intel-gfx] [PATCH 06/15] drm/i915: Force NV12 coordinates to be a multiple of 2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP We can't make NV12 work any other way. The scaler doesn't handle odd coordinates well, and we will get visual corruption on the screen. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/i915/intel_display.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 5a77d7615fa0..122f3f4cfc53 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -3072,6 +3072,15 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state) static int skl_check_nv12_surface(struct intel_plane_state *plane_state) { + if ((plane_state->base.src.x1 >> 16) % 2 || + (plane_state->base.src.y1 >> 16) % 2 || + (drm_rect_width(&plane_state->base.src) >> 16) % 2 || + (drm_rect_height(&plane_state->base.src) >> 16) % 2) { + DRM_DEBUG_KMS("src coordinates and width/height must be a multiple of 2\n"); + + return -EINVAL; + } + /* Display WA #1106 */ if (plane_state->base.rotation != (DRM_MODE_REFLECT_X | DRM_MODE_ROTATE_90) &&