Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1782268imm; Thu, 27 Sep 2018 02:23:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV62T2wIlo6y8uknz+IfnSS+m9JM7kKh/rTJSL9HK3nk9DwSZEBWVzwc553NM7vppyV0/d3Hw X-Received: by 2002:a63:66c3:: with SMTP id a186-v6mr57605pgc.330.1538040145219; Thu, 27 Sep 2018 02:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538040145; cv=none; d=google.com; s=arc-20160816; b=V0vYAY9WAs9H+U3vbKM6Pdemi7X8lPzBvtrN0nZl2bDZmTgk8AqVg0V6svZwKQM9i4 LyLrm15LfIKItBgITYGFj7qBYxobpxJfH4s9iqm2Rj1uAH1JkjusW8Dl2JtFZ4XrIGja 6K5IRdUTf+3aMst0mbtgPtzXBauRDIB28/DSJCCazxCviX7FOATCwMCOMKKIcGp4kIWc Pj1h7138MP5RxLYdkXD+dHR6ut4xqvUMq8hihN739QfjLHRNlH5adOOznfZq70iklpUt dMztmKL+nA9aEfqNIJ0/+58POrVa59dJZrAQaQ+1OOL0yWuMDCGga7pRIax0if+QkCiS LOGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=n6YJd+u4wCuvfU3qYx203Ldhw5bUUdq8ld/diJOKpbc=; b=0jDFuCyeKAiAY6RKDj6QXhd4BS174j61z5UM0e9AabkGwkx2Stw0IqG4S50nxjsmdF QQF+WHK0sufJcVw7QXmPyViqCm20i61OLhIVHe1FsXgUlY+4w5/wGNGlr6ANIMpdB281 tADgBWl0GdppZ9AkAU7qjfpoTrdBALfwbv/h50vjPemmVXrkUK1xzr20ZfMuleUR3Je+ GSU3uZBxLFzCKDb8MMGB7bofMDtwPFWi0+95lhgqNb9C1/dpPDCdqIOTBzLMKDEij6cg K6RAJA3ZmMz/8Dy9e33nifVsGYtZH8twuYNEMO+RULh/onN4P3xM/iUlNjhx2sHiJMOh qp+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si1528421pgk.392.2018.09.27.02.22.10; Thu, 27 Sep 2018 02:22:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbeI0PjY (ORCPT + 99 others); Thu, 27 Sep 2018 11:39:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:56346 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbeI0PjY (ORCPT ); Thu, 27 Sep 2018 11:39:24 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 711941120; Thu, 27 Sep 2018 09:22:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Brezillon , Eric Anholt , Sean Paul Subject: [PATCH 4.14 46/64] drm/vc4: Fix the "no scaling" case on multi-planar YUV formats Date: Thu, 27 Sep 2018 11:04:03 +0200 Message-Id: <20180927090256.461155281@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090249.801943776@linuxfoundation.org> References: <20180927090249.801943776@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Brezillon commit 658d8cbd07dae22ccecf49399e18c609c4e85c53 upstream. When there's no scaling requested ->is_unity should be true no matter the format. Also, when no scaling is requested and we have a multi-planar YUV format, we should leave ->y_scaling[0] to VC4_SCALING_NONE and only set ->x_scaling[0] to VC4_SCALING_PPF. Doing this fixes an hardly visible artifact (seen when using modetest and a rather big overlay plane in YUV420). Fixes: fc04023fafec ("drm/vc4: Add support for YUV planes.") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Link: https://patchwork.freedesktop.org/patch/msgid/20180725122907.13702-1-boris.brezillon@bootlin.com Signed-off-by: Sean Paul Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_plane.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -329,6 +329,9 @@ static int vc4_plane_setup_clipping_and_ vc4_state->y_scaling[0] = vc4_get_scaling_mode(vc4_state->src_h[0], vc4_state->crtc_h); + vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE && + vc4_state->y_scaling[0] == VC4_SCALING_NONE); + if (num_planes > 1) { vc4_state->is_yuv = true; @@ -344,24 +347,17 @@ static int vc4_plane_setup_clipping_and_ vc4_get_scaling_mode(vc4_state->src_h[1], vc4_state->crtc_h); - /* YUV conversion requires that scaling be enabled, - * even on a plane that's otherwise 1:1. Choose TPZ - * for simplicity. + /* YUV conversion requires that horizontal scaling be enabled, + * even on a plane that's otherwise 1:1. Looks like only PPF + * works in that case, so let's pick that one. */ - if (vc4_state->x_scaling[0] == VC4_SCALING_NONE) - vc4_state->x_scaling[0] = VC4_SCALING_TPZ; - if (vc4_state->y_scaling[0] == VC4_SCALING_NONE) - vc4_state->y_scaling[0] = VC4_SCALING_TPZ; + if (vc4_state->is_unity) + vc4_state->x_scaling[0] = VC4_SCALING_PPF; } else { vc4_state->x_scaling[1] = VC4_SCALING_NONE; vc4_state->y_scaling[1] = VC4_SCALING_NONE; } - vc4_state->is_unity = (vc4_state->x_scaling[0] == VC4_SCALING_NONE && - vc4_state->y_scaling[0] == VC4_SCALING_NONE && - vc4_state->x_scaling[1] == VC4_SCALING_NONE && - vc4_state->y_scaling[1] == VC4_SCALING_NONE); - /* No configuring scaling on the cursor plane, since it gets non-vblank-synced updates, and scaling requires requires LBM changes which have to be vblank-synced. @@ -639,7 +635,10 @@ static int vc4_plane_mode_set(struct drm vc4_dlist_write(vc4_state, SCALER_CSC2_ITR_R_601_5); } - if (!vc4_state->is_unity) { + if (vc4_state->x_scaling[0] != VC4_SCALING_NONE || + vc4_state->x_scaling[1] != VC4_SCALING_NONE || + vc4_state->y_scaling[0] != VC4_SCALING_NONE || + vc4_state->y_scaling[1] != VC4_SCALING_NONE) { /* LBM Base Address. */ if (vc4_state->y_scaling[0] != VC4_SCALING_NONE || vc4_state->y_scaling[1] != VC4_SCALING_NONE) {