From patchwork Thu Dec 7 15:49:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 13483470 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 17536C10DC3 for ; Thu, 7 Dec 2023 15:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PC6yGSC1RDmoQRuHKS65lVtEynsw+qU3gs0fZOa581M=; b=bABkmHcg6uwglw NmFhFxkIJycjYzknMPimWy+Qh6pb8qUNEWHKDCUj0rN6XgXh9XGd8Yyh1ik/8ye8X69XtoC5Hi3jJ bKo/qdmnYjh2xstbmS+ig/231B/qyDQol/F9qUjg8gt64jGea0RG0N+pWWhX6Ayt7M3+hKz+3vWrZ sAstsjeOsJZvqGputoQ7IJ/SYG0mb4lxtmMflOtq6xDA0hEV23dQmfDN4sEnMIL2rK9rOQy0pkgUx sbJUqA0fEeIveUv8FaQxCkAHwN1aNNMp0cKFAzH2dp2lmOf+Rss4P6NTwP4HoG/HvmSIp4sc4bhQF rMzI48RGUlOGES2sCzQg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rBGfZ-00DIjK-1n; Thu, 07 Dec 2023 15:52:09 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rBGeM-00DHMd-0L; Thu, 07 Dec 2023 15:51:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 7DD0DB81C1D; Thu, 7 Dec 2023 15:50:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83D0AC433CC; Thu, 7 Dec 2023 15:50:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964251; bh=LHrvwLkKgd5mOAx4m+biZr4E5ZkYjgrvoA6vecePIcU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=m79fJJ5kH9Wxu+x4hsV354crGWuRCDtOPlgOKUEg1V6vcGKTWl1G9ZHJ/yHNTH48i /zTvOH6WYTLr+DkpmkzYOGTAAbJdctAGUAnxcfpmDPB+qg9dHYC2yItQJ32+V29wfk e7Q1Ohejbja2Cy07QAeyiX+PeHrRBzNlafbgTyV2Qc355KU9FwGf8JBxUldnxqValp D4gAVqPx312NwCmu+kmSvn2W4b2vbIIeeq4J21gCClOP7b4zQ/JtC7P5WyW6PGHv4D g46He2cqFECf4chJl6nk7/b4K7Y9miFhcSq0E8Pgn5n7f5R4zBB5XU9eKPLxLOlQ0M MNJBAa9d6qzZw== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:51 +0100 Subject: [PATCH v5 28/44] drm/rockchip: inno_hdmi: Remove useless input format MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-28-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@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=LHrvwLkKgd5mOAx4m+biZr4E5ZkYjgrvoA6vecePIcU=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9sEZDMn/l6innE7bYnHpnm/bf49ySl6KHCy9fjfI rtIzyr1jlIWBjEuBlkxRZYYYfMlcadmve5k45sHM4eVCWQIAxenAEzkASfDP9PfU1mvV74+uUPq +N9wr79quff47Zr39lQo2FYl117WW87wh/fCU7MtCg8y+VcfMXiVNeuNUo5+cc/ymj+PtTz3/Jz QywkA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231207_075054_425923_CB867EDF X-CRM114-Status: GOOD ( 12.69 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org 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) ||