From patchwork Fri Dec 22 17:42:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1223823dyi; Fri, 22 Dec 2023 09:45:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfzXeEbSfAPKT5aUce6iSb6iPFucoZNJW72NBN2lofMDOA/FnpZX1+9BECtmD0SEuZLKNB X-Received: by 2002:a17:902:650d:b0:1d3:ec6f:14d7 with SMTP id b13-20020a170902650d00b001d3ec6f14d7mr1418055plk.19.1703267141456; Fri, 22 Dec 2023 09:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267141; cv=none; d=google.com; s=arc-20160816; b=xndAYkyfXLqvfpJGFzk8OfIFYR66ACEAtxJ5ZkEDJ24VkTJGSMuKjk/ScCaLglavhb mUikTtIOVTVCc+voVReTocjMYC7ypFGduNk56X6TDzznoTivEjXeeE6bRDiiytaLo4mT i1fLuGFtM9kmrt6cRlHssTPk0f43ogiibQK6KAGm0JziX8AZulmaySglrkywAn+/VtmK fh88DRwvq6djLb6jcZtFnhIQ9PIDboYM+vp7IikE/JbTOFXQmgv89v5f3bfyqmEoZjrA qYzAyZL4TiCw8ykbJfSSVCVNAXtWzjQI+Padl/yblWyNZ1uUBy+U7nZhhLKv3zEzGdrS boLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=TQoo8Yt/45hinsTrieF/s1boAUWnKYGvvoQ198qxKz7xxHkiqoQ+zeiGtj+d6d8Fi/ Kfbo/HfN5t8GHGT4JM+kl8YNfKJ5bcjnhw6nmTa+fLaUkIsMavO7pVRTetq/u+8zFpc3 OTuD508qj9T6k3LsqoX3Te5NWbBEWBFFAEsGtIA/+9wWrG10957wAGuPoq3asZa8VuOu QdB7dYij9Lbl+t0vrGTXK2NGINgtJ97bcaxIPGkxff9U23cbE4peVYu5tr3rAMOtqrrs 8edMIx2QFFOQkknRu4UmWV+Q2XPDi/HLW8I52m5E6Yqm4m+9VJhyM+Eqqi02o4Wf0jc/ wi6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UqBH+jvu; spf=pass (google.com: domain of linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d18-20020a170902ced200b001d0c442d76dsi3543045plg.246.2023.12.22.09.45.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=UqBH+jvu; spf=pass (google.com: domain of linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9959-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E2FD1280EBE for ; Fri, 22 Dec 2023 17:45:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 825FE33CE4; Fri, 22 Dec 2023 17:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UqBH+jvu" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5990E2FC32; Fri, 22 Dec 2023 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3366e78d872so1831080f8f.3; Fri, 22 Dec 2023 09:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266949; x=1703871749; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; b=UqBH+jvueCrYvBL4exg1GGPny87AagLrwzZ032y/kJr44KBytmCpjYS33xda4ZUddt 6Y/v15XjEBZPOVhAx62U93n6ZxHPC3MYKhyiWLcwJnK0DK1MFcA8+gfvddUsWQR0RZIS fg+s0T7RbgTzlbWmBTDFCE3RtTibup+30/RlLnucnkCvdllecdyo3CLa3H8xs5VNOdLt DnyjJT5R67b0KtETXPenfnW6F9XiLhl+Hej1fGJmaV5kPWSOFB6eNF0+Q1GwPbxgi+2u q4GSy98X3DM+d9AwDyEZVy+SaZ1G68AcwUnT/20tLADJJG50eypZ/OmFTURBR4nzPdAQ c0fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266949; x=1703871749; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=18puqwXb3goOQbFDudDa/Se4Vi5XO1rypLRUSz/S/Ls=; b=GIqnyIFA21aL8G+q+fvXuy7Um0h8cy9HPqq20WPyjfRp4A3iNje/sztPghKeYGHkzD SzY8PIAk4rz8uVQv0E1W5e5llwbUf1Aiti6p40RQO7c65nWifUxdbmRcZvX6KkP/PnLU O7yidZ7B7UndOyXb86A4+ws4i61GBNhbTbUP85wMN83BMFA1yu8M4Tf/8c/keludNa2q flJD1KiSRoYl+kCmsVcMoZD7fW+Hw2ryusT6pqZGeVPwI+oJ2V2Q5nCmdpvJNpv4GUfE 0jgXFTMNrbSFuBaNYwv82gW1Y8fy0KUy/u71fmPniS5gias5I3sIB0T+y1TttOmf+VDf HCNA== X-Gm-Message-State: AOJu0YxvlRlarJTwqK5biRo87yekUC9L0bsMxd9oRe4zTlviOvHqt0Qd MslYRsrW2zaBq2ygrUSsPQ== X-Received: by 2002:adf:f7cb:0:b0:333:3bc9:e246 with SMTP id a11-20020adff7cb000000b003333bc9e246mr513195wrq.33.1703266949433; Fri, 22 Dec 2023 09:42:29 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:29 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v4 10/29] drm/rockchip: inno_hdmi: Remove useless input format Date: Fri, 22 Dec 2023 18:42:01 +0100 Message-ID: <20231222174220.55249-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786005045833597677 X-GMAIL-MSGID: 1786005045833597677 From: Maxime Ripard 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 Tested-by: Alex Bee [made checkpatch happy] Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - none changes in v4: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 41 ++++++++-------------------- 1 file changed, 11 insertions(+), 30 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 58aff7a9c09a..7c75feedacad 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); - - 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->enc_out_format == HDMI_COLORSPACE_RGB) { + 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; } 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 ||