From patchwork Fri Apr 8 10:32:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandor Yu X-Patchwork-Id: 12806401 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6938C433EF for ; Fri, 8 Apr 2022 10:33:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06A7B10E1A9; Fri, 8 Apr 2022 10:33:19 +0000 (UTC) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80080.outbound.protection.outlook.com [40.107.8.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0CFA10F14F for ; Fri, 8 Apr 2022 10:33:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J5fSkip+//FqmNiZaEZHQ6RMZyfSi2diTCk6MrS6Ao83TSuKQ1n/NqilSJxCqis10MEuQv/SmD2p8hXDqnJItlMDTy6uTgyibhqMRHRwvgdgU2YwMfftAyI7sS4k121/ycK7IeWBi7YSGJMNKO1hV6wNPXeVqLYC6x4TakdrkKSNPC0XjKt0hMp1R0Pg4Scbb4wkeiynpcwOBMriuZO86LdHEBITfiIbFDJKmAWoyZFulh0w9zXrR9QAm7H5QrJfpRIfUb35tJP7FqRTk7ujDkMapc+kpF8DAvyJUaCa54Co8ztzB/Furf1B3FeMDeiDvwYubqoTnQwgNqjTEQlXKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=THrNQKpsWNdMxuYojeIsC5d7vKf1mcZHEIGlOy6s2W8=; b=H1NugxnIbArzuUQaKAdMMdgfk9HASuQh3EmKpeJxk1+5j6ruLoDlq2xP8vcwQUZXhvqbCXFoZNGDAUYrY00cZ7gsSnStnWE7GbACse4cL/s74e37IhFu9n0QvC+i8jPgciJJ16s+Rra1DfVN5PDFkdsjAYt/WM7FWhVP4QUkJhtMjKWNfbbrP9y7vGeCWKUuaMBkM1H+rcSgWPVMK3jeYC+QD4duKpsrd9MuWD5DmaWQ90UeomYuXJNx3SyT1kiorvXkoCG8vBYjqyl6YjLVFclg8t9rVxzOAgKgNFzJ/v2zeQamX1LogMvRBL0WL0W5QsOxYS8JwUxHvatjIbYMRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=THrNQKpsWNdMxuYojeIsC5d7vKf1mcZHEIGlOy6s2W8=; b=mgoqElixFE10nA9dQUVTS5FULmuyuRHZ/I4/qThEQhdLGtO62UGkpH3KNOV+IPL+a1zEn0vbj2I68RlOSkBXLNmqddLW19+PeEMWUC2ka5gorZStrW1DufpMKil5ygMjTD54VKJcoLKSAXJvF5zXMKFfRgytfgyV1w4OTMxd0gU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB7PR04MB5450.eurprd04.prod.outlook.com (2603:10a6:10:86::11) by VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.22; Fri, 8 Apr 2022 10:33:14 +0000 Received: from DB7PR04MB5450.eurprd04.prod.outlook.com ([fe80::7997:2892:d230:2430]) by DB7PR04MB5450.eurprd04.prod.outlook.com ([fe80::7997:2892:d230:2430%7]) with mapi id 15.20.5144.025; Fri, 8 Apr 2022 10:33:14 +0000 From: Sandor Yu To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, andrzej.hajda@intel.com, narmstrong@baylibre.com, robert.foss@linaro.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, hverkuil-cisco@xs4all.nl Subject: [PATCH v2 3/5] drm: bridge: dw_hdmi: Enable GCP only for Deep Color Date: Fri, 8 Apr 2022 18:32:26 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: X-ClientProxiedBy: SGXP274CA0017.SGPP274.PROD.OUTLOOK.COM (2603:1096:4:b8::29) To DB7PR04MB5450.eurprd04.prod.outlook.com (2603:10a6:10:86::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ebeea71f-0afe-4f5b-92c4-08da194b2fe3 X-MS-TrafficTypeDiagnostic: VI1PR0402MB3405:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pwBaMCRpcWeGPPgyipSPtBONNAjDCEzGAQojEpUF1ZPdvNziU2cS798XSNu5GlYYK+PMaES1CZga0vy1ncDPGa18iAaH6SKocSfqlPgA3Wv3v5A+AgVdgq3nRe2t81+auRo1cgaJxyuAzp6m4Ifdj4Z3zna0jkrw9S1GZ2Qso6PKIJkshH7U6RI2DOApbHSrHq7sRwMa5sCCPWUtpElyFR/JlArKkOO6qwLp10JWVOjvKVCphFLQiElLOf8AN0TAp7/Js9tX6J1QYvV++7Sx1xIqX6gdzCJjOvUYA8eGoM5eeMq4nnQJWMI9laWytAtUXz9NLeBacQbCUDw8DnQcYV6PVoAfk1uxaiKMlKHu4lJLjrmjKyaeApb1uscz2W3mliUH0glwEdw70VmN1kyXiGFpf9LPO87GTjQ+WRSzN2A0QKJczaPEL0BLhZP0Q01VcIAdrBXerqh1D6e2pSXAITFVDqS4PkZk3zPdO0BBbBF0OVYUvCL/0KBT0+9lPbksJEHCtXJLzUDZdbdFBDub6oZ7iz3rgGQretlaMGK02a8WxFen5lZr5fRALuN+fl/7L4+tkEbC7xrqrfthelcMlQtaz1oZ+xbfo3Vv29oROf/BUK3OVYJEvwr4L8nBicdSIePYbOdI6Fxkm27487T0zwueduRHvIlOCrg5SkIFZF6CVuPUx4Bapcb7fig7FCnaea7oid37ZGyPzIAMSZ0XYw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB7PR04MB5450.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(8936002)(2616005)(52116002)(66476007)(6666004)(8676002)(86362001)(508600001)(66556008)(66946007)(38350700002)(4326008)(7416002)(2906002)(186003)(316002)(5660300002)(6506007)(26005)(36756003)(6512007)(38100700002)(6486002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ezpyk5Eu2k3iU6sBJSf/pXyKhQQ2QsmeOwKuKFiOYkEhKS/PePhQ/D1iEjBS2ko4R2ZONrDplB4yQXu0y6RTtQHc15KvKLu765LtEmciLvyCZjQOw2QeR+hbG9ZbygHdW4fyl/dHKwkfK15f8TR8ALbzPm31WEK6S5dVD9SxP/7jeFBpI4FnjcVUCE+YJirKPikd2EpvCLh/uR/3f+vMY+fnG7fizEQGUe1c49wg2VoUW8RH03y03FK5uf8FlJt40nBkzdtAVK8s+mTyu2aGycAex0aXaiwAqQT1B/6bhCpi9IfxYkb62oBlpiHyjEfcNQl8m0MbOoFkINxheN/j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iU2Igjk/HUtpak1zMJv9DpQ1ewSTbTeV6rvMjpuivUwNSJ2Of+lHobMyZ3FIXTJu5Bg7AyHfPmuMZhubhlwkiLFovTgsvOOBlMCQ/2jeBCGhhlSryMHS7w0HPFAMFBRb3bLBTI66p+tq8HX4IZWscgKmuGcIXiPVB09A/k4hBmg7GqplSJhgRlv+S9sr8SgXZcZzUzLI46M9cffsi8c2CTSNToP0038bSH4ZsvVLODZWyjGXy0+v/h3C08JWQxHvxcucxf9VcSGJHIuzx3TrOzHqd/EpG4nJCYzP/2a13G7F3mle8Ha8b/fcv3QexoMvXhjZw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebeea71f-0afe-4f5b-92c4-08da194b2fe3 X-MS-Exchange-CrossTenant-AuthSource: DB7PR04MB5450.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2022 10:33:14.4906 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zdjA4GR6/jD/CBe90U5YdbnM1jjA8Z0FNlo8yMdsW2E+coCWwHZP4QSwioHCmjNJHNW5qT1RlmQCdGeTkAUcOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0402MB3405 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sandor.yu@nxp.com, shengjiu.wang@nxp.com, cai.huoqing@linux.dev, maxime@cerno.tech Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" HDMI1.4b specification section 6.5.3: Source shall only send GCPs with non-zero CD to sinks that indicate support for Deep Color. DW HDMI GCP default enabled, clear gpc_auto bit for 24-bit color depth. Signed-off-by: Sandor Yu --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 02d8f7e08814..5a7ec066e37a 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -1108,6 +1108,8 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) unsigned int output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_PP; struct hdmi_data_info *hdmi_data = &hdmi->hdmi_data; u8 val, vp_conf; + u8 clear_gcp_auto = 0; + if (hdmi_bus_fmt_is_rgb(hdmi->hdmi_data.enc_out_bus_format) || hdmi_bus_fmt_is_yuv444(hdmi->hdmi_data.enc_out_bus_format) || @@ -1117,6 +1119,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) case 8: color_depth = 4; output_select = HDMI_VP_CONF_OUTPUT_SELECTOR_BYPASS; + clear_gcp_auto = 1; break; case 10: color_depth = 5; @@ -1136,6 +1139,7 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) case 0: case 8: remap_size = HDMI_VP_REMAP_YCC422_16bit; + clear_gcp_auto = 1; break; case 10: remap_size = HDMI_VP_REMAP_YCC422_20bit; @@ -1160,6 +1164,14 @@ static void hdmi_video_packetize(struct dw_hdmi *hdmi) HDMI_VP_PR_CD_DESIRED_PR_FACTOR_MASK); hdmi_writeb(hdmi, val, HDMI_VP_PR_CD); + val = hdmi_readb(hdmi, HDMI_FC_DATAUTO3); + if (clear_gcp_auto == 1) + /* disable Auto GCP when 24-bit color */ + val &= ~0x4; + else + val |= 0x4; + hdmi_writeb(hdmi, val, HDMI_FC_DATAUTO3); + hdmi_modb(hdmi, HDMI_VP_STUFF_PR_STUFFING_STUFFING_MODE, HDMI_VP_STUFF_PR_STUFFING_MASK, HDMI_VP_STUFF);