Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2757743imj; Mon, 11 Feb 2019 08:03:06 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibl+YE1RuD1XwVi6v0FPjTmyFwHi8btHMqLYnoC500UGoCkEAzubVZFaycIpIFlaKzhD+Sj X-Received: by 2002:a63:5ec6:: with SMTP id s189mr32905990pgb.357.1549900986752; Mon, 11 Feb 2019 08:03:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900986; cv=none; d=google.com; s=arc-20160816; b=IK9pHggZCJg1lIatf8kZSvD5UfZT9nZy8lNchfbYm1VgvO884aX6HUvDulbAYY5vy8 VowmR4JpMpIiYuGBOogQSQOdwg69SEmrQjb64sCixkZOM+bfh8banASadnQ1pKzD1l1e QSGeXczi8ddPFtv9QUXEJ5f/NXSvLh5HqhhbjvoEchKkRQVeVZrNHAxOMzraZzUBe23l VlIfVBtmu6pODDb5+046etwwsciwL7pniUZ9eyndJfqIilh89g8gmDCYlWJPGPL9vhqe M7ar+2gXwqgXIPGNHf14v/3dbQEBrBKpwTsyB1hd8AagEEFu3Z1WBdCK2J1pyT19Ew21 S79A== 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:dkim-signature; bh=GdOhg0MhrCZSmI0BqJdZ21W0ifkoizMksdFYJlCtOVc=; b=j7H6UEz2Lk09qLHfcyWST0zSXGwy8d7FUlDgDZVJSSQw1e0WneR8/YgIzUymWlOeED TB3fX/qfzyWDX7L/ZPxF4pxR/RD8tKBS6yaWxJB9h/Y36nR5tnZ5mXiHwJ/yf2MMZfBU Ouq+uLnYWez3eFao+jK4Hi1UEbwKxm+daXMmOkuo9LPLydJb0CW9HCqV0pMhQD5xmgHz QoKlAMGiSY/0s/QbOfoSOAIYFmOdW17QnHSAT+Y+2oHT1Fcoo4Mqqm0Y2Ku4/y9h2Jk0 SPa8QktmB2blDTuxcIQ9Hg5snIZUg0avLvVSv2nLcV6k4airP4AQ8dbqyKvQ21zNUAiB BKtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v1easLxn; 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 5si9777470pgc.290.2019.02.11.08.02.46; Mon, 11 Feb 2019 08:03:06 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=v1easLxn; 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 S1730207AbfBKOa5 (ORCPT + 99 others); Mon, 11 Feb 2019 09:30:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:37464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730187AbfBKOa4 (ORCPT ); Mon, 11 Feb 2019 09:30:56 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8CF5C20675; Mon, 11 Feb 2019 14:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895455; bh=1N667BoU1/HsfPDWcZ1IiGUGYXm6kohOxYFl0c+0n54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1easLxnW4Qua6bLEz5i5tnYBOk8ZRt2ReVqc9zpPQ8uPK3bkeDUVrjFi+MgpSiJD Gbgb/03mwtQnAEoT3gwqa6wfLXlNgp8iac2Tw1AeoiO3LcQt+ulvVYb8pRrQLPXrHV +3gRUA3NJW7TSfO5b0Dky9mrlmpEZVduZLLbABhg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Yang , Hugo Hu , Leo Li , Alex Deucher , Sasha Levin Subject: [PATCH 4.20 209/352] drm/amd/display: fix YCbCr420 blank color Date: Mon, 11 Feb 2019 15:17:16 +0100 Message-Id: <20190211141900.485555710@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 12750d1647f118496f1da727146f255f5e44d500 ] [Why] YCbCr420 packing format uses two chanels for luma, and 1 channel for both chroma component. Our previous implementation did not account for this and results in every other pixel having very high luma value, showing greyish color instead of black. YCbCr444 = ; ..... YCbCr420 = ; ..... [How] Program the second channel with the black color value for luma as well. Signed-off-by: Eric Yang Reviewed-by: Hugo Hu Acked-by: Leo Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 11 ++++++++++- .../gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c index a6bcb90e8419..4443a916a0fb 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c @@ -1268,10 +1268,19 @@ static void program_scaler(const struct dc *dc, pipe_ctx->plane_res.scl_data.lb_params.depth, &pipe_ctx->stream->bit_depth_params); - if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color) + if (pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color) { + /* + * The way 420 is packed, 2 channels carry Y component, 1 channel + * alternate between Cb and Cr, so both channels need the pixel + * value for Y + */ + if (pipe_ctx->stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420) + color.color_r_cr = color.color_g_y; + pipe_ctx->stream_res.tg->funcs->set_overscan_blank_color( pipe_ctx->stream_res.tg, &color); + } pipe_ctx->plane_res.xfm->funcs->transform_set_scaler(pipe_ctx->plane_res.xfm, &pipe_ctx->plane_res.scl_data); diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c index 32e4c653b1b4..220ba828748d 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c @@ -2165,6 +2165,15 @@ static void dcn10_blank_pixel_data( color_space = stream->output_color_space; color_space_to_black_color(dc, color_space, &black_color); + /* + * The way 420 is packed, 2 channels carry Y component, 1 channel + * alternate between Cb and Cr, so both channels need the pixel + * value for Y + */ + if (stream->timing.pixel_encoding == PIXEL_ENCODING_YCBCR420) + black_color.color_r_cr = black_color.color_g_y; + + if (stream_res->tg->funcs->set_blank_color) stream_res->tg->funcs->set_blank_color( stream_res->tg, -- 2.19.1