From patchwork Tue Oct 31 16:48:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 160254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp374565vqg; Tue, 31 Oct 2023 09:52:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGGKJ2159qDCqWCyW5SNLrw/4/hOXNKCGVjFmka9vQTE4+CX7gEZvge6hFDbo8qrEaWAmaw X-Received: by 2002:a17:90a:17c8:b0:279:2dac:80b3 with SMTP id q66-20020a17090a17c800b002792dac80b3mr11797368pja.44.1698771160789; Tue, 31 Oct 2023 09:52:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698771160; cv=none; d=google.com; s=arc-20160816; b=esHWKMCowsJuOc2nuPfum/yVWln6b4LAY6Sa4V2D5SEPrcG0VutS4zR2oNKYXEXFOJ tgBsdbZDq7Yx5bzgX/2PlbSB7j0t5JyCoLB8YDkMYdosZC+SvYIpMmcp86JA2qIwUB/i jeSh4e8pELNheh5uQf/vz1/5bPJXhA6eIr4b38zcAh/qsFZJZIuE1oiMZXvcBrnQsDNh rYaNmXUBlEc2K3k0HdVKOD1JfhUzLSgcK4Kcf9QLW0YzZI4Y7wNj9zONvYxiUciSo92g lTdH53eus7Eck24HGXl2/ZpzZdHNd0NxDiUeiz9n8ANDbiL9Dbe5FL1a4Cu+4ytLQY3w 3xQQ== 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=QFjR0j7y96CA8NJLSjBNgOdOtIOKin6lFDdRSr0mrP85GfO1Inycj1dJdlGfkl47ND xcDVTuy3lCgQfWoREosV93L8R3wKGsB3bRt44bQ8SVt8bst8YrNm2rodgJxUHQrO82XL Bs226wcTY3uhwr310EuMnY3Bp2oHidaMXB/q1vE+rqbdlYEv2s+ouxtcUhs9zFTmyLbB 8jnezBC4FW8xAmKMZfw531/VKk71VPIQfSTXV/wpuH012DY1G8EBiNHWxE1e+mkzYTs1 pho7OGuHZn2p9hA/sIzacNVit5j9IVmyud7tpRVNudyXTnolXAYlKeFe9JPf/NpdtIz0 NkJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QfhJPPnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k8-20020a17090a404800b00274d6373fe1si1159928pjg.120.2023.10.31.09.52.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 09:52:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QfhJPPnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 6C6F48033DE9; Tue, 31 Oct 2023 09:52:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346839AbjJaQwa (ORCPT + 33 others); Tue, 31 Oct 2023 12:52:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346971AbjJaQwJ (ORCPT ); Tue, 31 Oct 2023 12:52:09 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52CBF1B1; Tue, 31 Oct 2023 09:49:35 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A027AC433C9; Tue, 31 Oct 2023 16:49:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698770975; bh=cewGjSfrxsWvWPkrDxnbvQOKsF0K1kZ/Vi1wxjvWMJU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QfhJPPnGPgTleGDMOQiZfepuTeQ4+OEpi88wlJlEQt6IPJUq5Y+m7MG8OTsGV6LbI ClVUv0FuYENtx/AKM6XVLte1hSHBjY4Tz9GIUXPExrC6d6WvbRwjfI7DvSPAEk48Mi bB/2yYZpjqldHg4YPFYpT5FoacAeQmF9WBkH+Zhkql/jbSIq1KPFZomQBryftvmYVL +5r3Hg5Jr5Mvcz/sufHTgPo+kb+ruScxqXa9vsZ10qOZYdaMPfCzEFz1cjaYCSbwyG aiefuVne5lMxgGXD52XDIA4f7VnuYOl+YPNctU2K5h/raYMGXH4eYVXPjD4587nRIy 55qbUB7R3k+7Q== From: Maxime Ripard Date: Tue, 31 Oct 2023 17:48:34 +0100 Subject: [PATCH RFC v3 21/37] drm/rockchip: inno_hdmi: Remove useless input format MIME-Version: 1.0 Message-Id: <20231031-kms-hdmi-connector-state-v3-21-328b0fae43a7@kernel.org> References: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@kernel.org> In-Reply-To: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@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+D1vfrpE4FHG02pJDKmO+vdO2C0/v+bU2n1fre0+cO/iOnanRqn/aOi0HvnSt rW7U+dxdZSyMIhxMciKKbLECJsviTs163UnG988mDmsTCBDGLg4BWAizG2MDNdu2E6ISDApqGC3 mrNFfM4h5XK/35cWifDW37bwn5yVoszwv6rrrkPOHPYnTL0eh2tzD5xh3RDuJXO42UdDwq/S+IU AIwA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.7 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 agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 31 Oct 2023 09:52:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781290668541659950 X-GMAIL-MSGID: 1781290668541659950 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) ||