Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2546247pxj; Mon, 10 May 2021 05:38:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxmj6H37Y0MS+5o69CAd7227BeEt+bLRIgD6IWas2nqU5JxiJNJqAJJEXt/svPe9axWBjQ X-Received: by 2002:a50:fa44:: with SMTP id c4mr22590200edq.56.1620650308192; Mon, 10 May 2021 05:38:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620650308; cv=none; d=google.com; s=arc-20160816; b=AI1Oy96C2bhnTzt3XXyffGW+YKjkC+4intXueqIxJNxeNudmeAa5opsmrcPn15LGvn A+DzbFYDu2j1aYgn9gqbA9kDMSf1TVCtg1R76FhqHLoOv+VH8XYQFbmVgMMj32NEoCvU a+eEj341JTpZ8h2CgzD1r1ReQSbrHnmHSYekTE+VBJG+4fd8mYOZSQXB7JibCie4uFqE LQS7kidAKf4zRRPBLIuo/z4Pg9QgfpkdnSlTtRO8CWXBnXvvswqeaqTCh584zPxjlxLW gGYD/IswKNFmSdfg32A68IIVTAFAbbiK67EMCUTrCgsuNIz6+yP9qQSKE+OZHBC3/WOu p5Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ASO+dR5CgsFlpmxO/316r5Sys8PGl9458icAmbJFW8U=; b=Bs7sTdYw2r4OAfZ8GK2gfTaC6oNr4SVVHA07/HvsUkN63ojmqMc7F4baNGGMgDyYN3 aoJyQ/QRh3g2qPKPOF8q8eDhJgspoIBA3Iyr0PtezJ0T3ozQVsHfWKFcrgny7a9lKdUa FSPrYt5KkelSBJGF19Zgq6vA+ijnC9ZDGYfZG1tirZFmZfcUY+NKfX342Wot1wtPVGG0 pJo45R8OfWUfB4S+8eCZUc1kVL2Yxb1hhZHo3z0lNDEdUMP23HUlaGVU5Ksw/z4xIpY7 oCKX1G9cyK0NDoSIMuIUnbVZALkoTnNui8qhhSM9FpLQvjgHxpqSnPa6KcfE+4jxVthd 6BAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NVIV2CU5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ha1si13138994ejb.743.2021.05.10.05.38.03; Mon, 10 May 2021 05:38:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NVIV2CU5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346117AbhEJM0c (ORCPT + 99 others); Mon, 10 May 2021 08:26:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:46208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237137AbhEJLL0 (ORCPT ); Mon, 10 May 2021 07:11:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7AE8861864; Mon, 10 May 2021 11:07:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644852; bh=Uue73P2CCD+HKmLk4FjmAwNtBdF6wSFYVPw16mUU0O0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NVIV2CU5BnP1V0rmnTLBE2GDP6lIRIYakyu4orxF3mJJGRYQjdQkZZW6QxYvmFQrh VFm3pPPkQ6UUtVujTCmdPbVAIq7mhiaav4X6TpM0F5SOlJlkm4RIhoUOIIJ5YTB9KW 0fEw1dU2TzmMaOja1m+tQt8g2GvRVSYP9vgQvCHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harry Wentland , Werner Sembach , Alex Deucher , Sasha Levin Subject: [PATCH 5.12 250/384] drm/amd/display: Try YCbCr420 color when YCbCr444 fails Date: Mon, 10 May 2021 12:20:39 +0200 Message-Id: <20210510102023.124676468@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Werner Sembach [ Upstream commit 68eb3ae3c63708f823aeeb63bb15197c727bd9bf ] When encoder validation of a display mode fails, retry with less bandwidth heavy YCbCr420 color mode, if available. This enables some HDMI 1.4 setups to support 4k60Hz output, which previously failed silently. On some setups, while the monitor and the gpu support display modes with pixel clocks of up to 600MHz, the link encoder might not. This prevents YCbCr444 and RGB encoding for 4k60Hz, but YCbCr420 encoding might still be possible. However, which color mode is used is decided before the link encoder capabilities are checked. This patch fixes the problem by retrying to find a display mode with YCbCr420 enforced and using it, if it is valid. Reviewed-by: Harry Wentland Signed-off-by: Werner Sembach Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 9c243f66867a..29ca1708458c 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5872,6 +5872,15 @@ create_validate_stream_for_sink(struct amdgpu_dm_connector *aconnector, } while (stream == NULL && requested_bpc >= 6); + if (dc_result == DC_FAIL_ENC_VALIDATE && !aconnector->force_yuv420_output) { + DRM_DEBUG_KMS("Retry forcing YCbCr420 encoding\n"); + + aconnector->force_yuv420_output = true; + stream = create_validate_stream_for_sink(aconnector, drm_mode, + dm_state, old_stream); + aconnector->force_yuv420_output = false; + } + return stream; } -- 2.30.2