Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2672305imj; Mon, 11 Feb 2019 06:49:25 -0800 (PST) X-Google-Smtp-Source: AHgI3IaRuNYICUR+cxFM81mibigNJ4xfZT9HM8VDxplh0adgf/itsOAVcof+gCZSQDrEZt/r/P4K X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr11079287plb.147.1549896565492; Mon, 11 Feb 2019 06:49:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549896565; cv=none; d=google.com; s=arc-20160816; b=kRkCHyRNbufvTEIdnJNqKlF3vUZEPY9KygY7swHmdt24QgTsCSGrpx/SbLX33K9Pkj jNfU39o2SVb8LMo6+AK06qcq1p95daAunLcsHfW5VexUNnSUorx1GJ9J0dcw3zJh39EU H8dwVavIEQU07wiihJP9RaSSuVabm5VnHhEOWscFvnygd2PiBv078M/g4zWN9KUcqVcV kSUWfVgAYiK2z3vgGXpdpEcFjB7qggJz5v+BKboCBxEFsBrYgGCcMnXWh61tlSw0u5P2 VKvTRDjGcn4Xeo+zUj+hef0bdmYQtDXUs+gDAUci+PqtMRsfjsZ+zVVbDKsvzjeUOw1F mhPw== 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=0ZuyataWa4IzXfktLfLwVvho3nmdf1myH83EZwoGyjE=; b=EHqPEdyCUOdBAC3EF65lc+GiWFe8tuL6OFsxooAF+ni8PjGGmXSJAKbp9ZIvs4CsLU FK49LSLyc1O/fg2i0KfNsA8xxLsKlRv/1087Bvm34jT2jxPKxiYvc8C75qTwbY08/95J 6UdgerEwVmLcaod7TyqIHvi1+P1E8uchirCqXn0Z5caHfC4nYegcbpRLziyJQNE3Tmr/ t/lchd1i8lX7C3/B1PsPHyPjEtFKWygxBYbilpuL2nnfJ7IiuaWRFotFDtzRJx/K+C2V da/mUsBSfOe06EzzVtP27sBJxKRfjxNc2LWM4kuJx3HtJcF9sJv0N1XwteDdBmUdohhu z4/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I2xM5Ly+; 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 y10si9568082pgl.152.2019.02.11.06.49.09; Mon, 11 Feb 2019 06:49:25 -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=I2xM5Ly+; 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 S2387432AbfBKOq4 (ORCPT + 99 others); Mon, 11 Feb 2019 09:46:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:60138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732327AbfBKOqz (ORCPT ); Mon, 11 Feb 2019 09:46:55 -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 96F0820700; Mon, 11 Feb 2019 14:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896415; bh=vSKdeS93I5i7AWT6HJNxD3BNW6YpAc4rU1KasHIoVp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I2xM5Ly+JomYdaaACBDo6ZwoCCZ7HNMW9Bf+/lGvEZ02pmxuLUo+04o9ru0QgsYMz Qzv2SiWLrZg1MGXnwaEDxmrtgiJIPBzoui3+AEXX7VCOU/N2Bhi85q206nqx8dXxiH DkKHCgPaXUCrmGFKxGyHfWhrGx1Adragizai8YS4= 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.19 176/313] drm/amd/display: fix YCbCr420 blank color Date: Mon, 11 Feb 2019 15:17:36 +0100 Message-Id: <20190211141905.116002491@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141852.749630980@linuxfoundation.org> References: <20190211141852.749630980@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.19-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 0941f3c689bc..580e7e82034f 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 33a9d0c58966..4058b59d9bea 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 @@ -2121,6 +2121,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