From patchwork Tue Nov 28 10:24:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 170705 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3814747vqx; Tue, 28 Nov 2023 02:28:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFRwswhEJxijqm0R953G5VlZMtLe/iuI0t6L5+uT/ZCrf717NqEQE79sxMFqghpDvEyexgz X-Received: by 2002:a05:6808:1455:b0:3b8:33dd:fae9 with SMTP id x21-20020a056808145500b003b833ddfae9mr22077312oiv.12.1701167318694; Tue, 28 Nov 2023 02:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701167318; cv=none; d=google.com; s=arc-20160816; b=kGh/Hk2i1r9DWQklq/+LvYIZFwd1ceXMmkC0ZYj5IKuXd+gGdoSeBOCmw808gTc6bR XsxKKvT1NNI8ySVymVcuA0+Vvb82vX5/EDmUdYAP2a8rdlaafcSUCTR/LNJ1TwwlBWgf Pbrih+ZNJLqV9pZUNU/1w5eHOso7+QbGyPGD11EfCZWRA6Kk/wJ4QsfNIpn66BJoENC7 kxJDI88DbSK0eR9Ffno2dZ1TR9zaESfJN5/evHdyw5Asg9Bu7WvELE83rSqm46tEkjHU wgZYMgf4LZaWdO4RJsfcmksIyy/K5oXzfb+W+1w211pmc8U72E1RyyJUgriQZJ7dPZLH Tk9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=JP4DRHU9ERB2qctOSZHruKHzJR7+C7P7KnAAoPZ91yk=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=fwfvk0TtHfQwYb31gSuObsG7AXnRuMYqH2gjdAKz4V7UVJ94uNJU8zRHgpNQkTh1VC IkIvbowZW6+Uh1ITMIEOH+NU924PA4vCQ04WiAo48WsYhxI9UVqaZ7zh4W9+0OCt+aQN vtJQr7SgNB9zNXltMypS1cRwQF0idahBpuFgc4J+TgLczNOEt/beA9YyELSfP2uwUBX3 ijsQBcsl9udM0yvNYPhcfFP7PKtlOGW+hPBg5mlg37ujeB0PF6Nnp1Nkdivnfnx5W7vG CNfhrXnLj4zCZ7tM3iAg9/zAC082MwKUv2K+W9NbH5FrSbkY2Y7muF0CaSL43O2cDh8a /U9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AoC8BAXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e25-20020a656899000000b005be10ed80d9si12011749pgt.177.2023.11.28.02.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AoC8BAXV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 65F7F81B17FD; Tue, 28 Nov 2023 02:28:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344399AbjK1K2W (ORCPT + 99 others); Tue, 28 Nov 2023 05:28:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344409AbjK1K1l (ORCPT ); Tue, 28 Nov 2023 05:27:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C93F2D40 for ; Tue, 28 Nov 2023 02:25:46 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71ECAC43397; Tue, 28 Nov 2023 10:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701167146; bh=cewGjSfrxsWvWPkrDxnbvQOKsF0K1kZ/Vi1wxjvWMJU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=AoC8BAXVAN8YKhH6+iXmJP08aAXvlPWtk/wgDwxz/h04z3leGGBtOB+tGmtkzKX9i gFTHUlMEeS2j9T8s4LgRD4MOIG0kpcgfROLFP1CrBHibfC/fFRlyvp/N4zotaMLlpx 981iEQ/K+REyMXaIsmjldWy1wRqtAo2ZUuf+MCLEc5CdNKL111sxYNvmvimuX7TdiI IXd56pJDl2/ah5dkaf7ME6CUBAeWyWEdH1XDaiW1coZBp+7JuLzqP2zD7HVu6kXyg2 /lWS6oxgycsohXaqSilSZBTTMK7DSFw3qQIgkQaK4Zv5Rb0XiBzlMF85mim5dorwJ5 YemY+7FwivhEw== From: Maxime Ripard Date: Tue, 28 Nov 2023 11:24:40 +0100 Subject: [PATCH v4 29/45] drm/rockchip: inno_hdmi: Remove useless input format MIME-Version: 1.0 Message-Id: <20231128-kms-hdmi-connector-state-v4-29-c7602158306e@kernel.org> References: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@kernel.org> In-Reply-To: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3445; i=mripard@kernel.org; h=from:subject:message-id; bh=cewGjSfrxsWvWPkrDxnbvQOKsF0K1kZ/Vi1wxjvWMJU=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmp+y91VQXbbmKdepgjZP+8dQ+sooMNHyQcqTq9ufKV6 d8kFr2tHaUsDGJcDLJiiiwxwuZL4k7Net3JxjcPZg4rE8gQBi5OAZhI9l6G3yzb2HoSX6RpOZgZ TD4y1dzUacbaXeWMW+/v47Nt8mF/VMTwVyr5kcaVnmym1I1i/jmfIy8zXpt4KnzZzJvu1hfFZsj eZgEA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:28:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783803222656664913 X-GMAIL-MSGID: 1783803222656664913 The driver has a lot of logic to deal with multiple input formats, but hardcodes it to RGB. This means that most of that code has been dead code, so let's get rid of it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 39 +++++++++--------------------------- 1 file changed, 10 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 3908dc09d85f..e0696ab16da3 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -28,7 +28,6 @@ #include "inno_hdmi.h" struct hdmi_data_info { - unsigned int enc_in_format; unsigned int enc_out_format; unsigned int colorimetry; }; @@ -328,47 +327,30 @@ static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi) v_VIDEO_INPUT_CSP(0); hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL2, value); - if (data->enc_in_format == data->enc_out_format) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) || - (data->enc_in_format >= HDMI_COLORSPACE_YUV444)) { - value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); - hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); + if (HDMI_COLORSPACE_RGB == data->enc_out_format) { + value = v_SOF_DISABLE | v_COLOR_DEPTH_NOT_INDICATED(1); + hdmi_writeb(hdmi, HDMI_VIDEO_CONTRL3, value); - hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, - m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, - v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | - v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); - return 0; - } + hdmi_modb(hdmi, HDMI_VIDEO_CONTRL, + m_VIDEO_AUTO_CSC | m_VIDEO_C0_C2_SWAP, + v_VIDEO_AUTO_CSC(AUTO_CSC_DISABLE) | + v_VIDEO_C0_C2_SWAP(C0_C2_CHANGE_DISABLE)); + return 0; } if (data->colorimetry == HDMI_COLORIMETRY_ITU_601) { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU601_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU601_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } else { - if ((data->enc_in_format == HDMI_COLORSPACE_RGB) && - (data->enc_out_format == HDMI_COLORSPACE_YUV444)) { + if (data->enc_out_format == HDMI_COLORSPACE_YUV444) { csc_mode = CSC_RGB_0_255_TO_ITU709_16_235_8BIT; auto_csc = AUTO_CSC_DISABLE; c0_c2_change = C0_C2_CHANGE_DISABLE; csc_enable = v_CSC_ENABLE; - } else if ((data->enc_in_format == HDMI_COLORSPACE_YUV444) && - (data->enc_out_format == HDMI_COLORSPACE_RGB)) { - csc_mode = CSC_ITU709_16_235_TO_RGB_0_255_8BIT; - auto_csc = AUTO_CSC_ENABLE; - c0_c2_change = C0_C2_CHANGE_DISABLE; - csc_enable = v_CSC_DISABLE; } } @@ -443,7 +425,6 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_info *display = &hdmi->connector.display_info; u8 vic = drm_match_cea_mode(mode); - hdmi->hdmi_data.enc_in_format = HDMI_COLORSPACE_RGB; hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; if ((vic == 6) || (vic == 7) ||