Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2484259pxj; Mon, 10 May 2021 04:12:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJ+FfNIZGFBTGPP2fsj1UpFrv4ENNnILQd7TM7tlLQ+biICct0C2FNRwVLK4ACs0290A0D X-Received: by 2002:a05:6402:849:: with SMTP id b9mr14319932edz.126.1620645152460; Mon, 10 May 2021 04:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645152; cv=none; d=google.com; s=arc-20160816; b=LyUPYwP6WLy/QJSNQQlIZOZ+jk0Ek+bfucKzXctvy8xMot18svBCwg7yefh6l1P4zI M/z9UcV8KQWEb4uXAxhP6pPtCrhMRj/p4agH2wBhHEKb8UBmlgJYbraeDsBuOHWZ8dKw hOAjt3qMk0qAuBS7ZSB4EZu6+78pGYTRkhBOPgDybVtgRh/CMMj9iEkYNS700VXQsFDK SU6LD3XjHVcinsjBFmRxYzyrrgec25HdTp32OjIh8H7Mfvaunx98zJfHPRSI5d8i/tMq HTo7KEpvktB4SKiicgLXH0vN5ZdtwMhII5SWn1aaB1ZQZ+lFYQGq/QExJLlze8U8eQ5/ ApMA== 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=P84lcv42dctm5YoLQv2/3XOmzxvBC3cfKYyDS+6o8mc=; b=bABSxfvBFtbkh+uZJIc2Rc0UVNbaEOJ7EGO+U/9q9g/LVk30XO1k1y3s2HLp4QjYVt nOrhWxwe5BOM38aCRMYWqBYxp6mNWUAXGA17SaPyCF9mVQaG/oWDJCagRUyJ9ys0SDF4 8tdfYG7iPvNx6cqwEdFsYQEgPYVh4qWDeeXUs2X5ZScOhIFvgrcfbN+9We0gLclKByTc j8hAgYMWtJLjW34x2axIEJJWZuj2WQp6rdqhjmieQ2sns2iOW7FQWJufHF8ieAp59GlV Vh95DPWQhzCMBpITRsNwWGl/CaV6LefkZwCmU2ArS0lBlNvt/SjHpE9HGFzaRbStOqTm 3D+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kWtXAK4h; 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 5si9306688ejw.423.2021.05.10.04.12.08; Mon, 10 May 2021 04:12:32 -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=kWtXAK4h; 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 S236914AbhEJLK6 (ORCPT + 99 others); Mon, 10 May 2021 07:10:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:42240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233504AbhEJKuK (ORCPT ); Mon, 10 May 2021 06:50:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D98B61946; Mon, 10 May 2021 10:39:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643143; bh=7d52yvzQRY/k+BwM4YxoCYqGDwd4rZevmOR1LPQG+X4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kWtXAK4h5sCOQ1akfcfbJugttGS0xtyBPr3h8zchIDbSk2lP7WmCIQWE45g/ZUbel VwUa/SqEcIAt7KoiJ4k0MOUPVw5tGAHuPioj8LLdnFz7EAILDtFaLNxIAPoVrYjb6N E+KpaGrpJ67CYxEendn9NY7OhufZhPDp/9T3caBw= 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.10 194/299] drm/amd/display: Try YCbCr420 color when YCbCr444 fails Date: Mon, 10 May 2021 12:19:51 +0200 Message-Id: <20210510102011.355656279@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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 12a4f0675fb0..d18341b7daac 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5328,6 +5328,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