From patchwork Tue Dec 19 17:00:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181108 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2081116dyi; Tue, 19 Dec 2023 09:04:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGbLPGghyA2llk+rdMEWJHPM0LR9SssxYNkwSt7clykUdB//wqC/Q5mmGBtMaavwdEI1A6 X-Received: by 2002:a17:90a:880e:b0:286:9b25:1c66 with SMTP id s14-20020a17090a880e00b002869b251c66mr13608845pjn.24.1703005495248; Tue, 19 Dec 2023 09:04:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005495; cv=none; d=google.com; s=arc-20160816; b=XmIA4+ifnvBYjgX8mg0qoZ1C15IFqH8kQ3c760IJ+3UNI7JFd/I1kbJcOA0RG+YOAG 5jyeRz+Mr6TB6xvQrngGZclN5smPZfUr7deBwIc1zry5nkYnB/f4qxDCLqrIIg8TIOb1 j+d8yNX3PlQAxzgYz0JcHnnrEDUFpFKKpUnXK+PO/LwKLi3Gddsar/4w2WWOnXwb4aNx BD55mWHUZY6UVRaNrx5OwbgiaE0TuY2dhSe/gYenGtCMv0tyCeoaEtx6D3chHvQr3Bbw tymV1Y4C5Xv0ogpVFt2hKV0QNWT/Kfk5hftr7tqXnPUb/Nu/FqD2Ruf3BQIjMVJCochc cJ1w== 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=MNfwp/Viwn8FsMQ2wJBvb6bz9Up4T1wh4XJuG+p+31Pp5HyC6PGGhJqvgL+T7otUN2 IRRH2edUsmKudo+EyZnBWpaWxCvHHB8Ay7f3cdVDyWd4Ejg1Y8wHh1e56XvnlZKnPWTw 1d4wS7kLXHDMrzLAEP662AO/p5yoizXK1rZSZfiohaEU/MJsDbuiVrtvjC4HzHB/PUa+ QCuCq0Bksv3sQujLfuDkxUDaBHiXVH9koVnctTp6SNi1a/Gbn987/ICqPVAeUR+4KdTq +DIflz/gpV8/4UNfk66Yg65inRv34pJ/esZmczV70YjwS13pwhP0w7gsbw9QAFd8BV+U WtHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XHxo+8Lf; spf=pass (google.com: domain of linux-kernel+bounces-5628-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-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. [139.178.88.99]) by mx.google.com with ESMTPS id e9-20020aa78c49000000b006d6b2cfe4d5si4121035pfd.279.2023.12.19.09.04.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:04:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5628-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XHxo+8Lf; spf=pass (google.com: domain of linux-kernel+bounces-5628-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-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 DF09B2809A7 for ; Tue, 19 Dec 2023 17:04:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 318F939AF0; Tue, 19 Dec 2023 17:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XHxo+8Lf" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 3B0553786D; Tue, 19 Dec 2023 17:01:18 +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-wm1-f48.google.com with SMTP id 5b1f17b1804b1-40c517d0de5so51733575e9.0; Tue, 19 Dec 2023 09:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005276; x=1703610076; 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=XHxo+8LftE011jjBYKpPYPoBCfsLydq5UUstv9tpuHJr3kXNzz8Il7HsPZR25u6vQ+ t5dInGxo6gh7CWdEF1PmjWWTfOXRPBd9DXemqDxpZBIllkSfalOQQmCG0KcOQA6Jy0E4 tLDq9Y6ptRILFJu6iJQaCooZja56ImWAYsSc9DPY9lsjrDRf8HM7hfaXoS+lb5jf0Ijr beIDyPvCNnXkOzw00xzyhl0J4h4SEcPQrPtVUI6viB28LSIlR0cOkbXTQeZSYttGCqIA AJ0miV9L7ONMbDOK3qFpbDSfhT/hoeYc5884bup5zZf3g7mHgqGXG3BnU71B5xTNaJmv zK8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005276; x=1703610076; 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=iFJnc/mxwT7AOuXgJJftqh12jwZWWgTZW7pO4s+kLaU=; b=JQ5uthhCWrXTHbudElQI70dgaAwQ7+VVPdICyrn83Kl9rwI4tj44XUG2kWx+rTqYEl VTGCZypDGuBRNPa88Q2lUJSrl2pVodLAH6ebKVVAF9f0f/AZFiywYOB13E/uFHbgBOdy NGq8iszCIaKYl2hMEgOU1F7kI4X5biYGJ3xPewlNuL3CK87AQ0YJCMSsT/i1WLyq6/um 8aewBxZD5pg3907tDBMpjblgSgGckRFhR6WOwhEMW6RnvhOR+Q1sGEiTOkBUWStOoPxn BWKYpZlvrGBy1junyF2N5M/lzeZ+KrGGSi1V7gp/Rl2RjE9HBsy9huSisaZXEJQdVbaS pJ2w== X-Gm-Message-State: AOJu0YxIpFWPV3XTGO/fAnetbQsIR2Gyko0XWfagFEzjH01XJNpOMbPA UYtbHylXDt2NoUxhp+2DRw== X-Received: by 2002:a7b:cbd1:0:b0:40c:32b6:866c with SMTP id n17-20020a7bcbd1000000b0040c32b6866cmr10082301wmi.68.1703005276391; Tue, 19 Dec 2023 09:01:16 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:16 -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 v3 10/29] drm/rockchip: inno_hdmi: Remove useless input format Date: Tue, 19 Dec 2023 18:00:40 +0100 Message-ID: <20231219170100.188800-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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: 1785730689899134402 X-GMAIL-MSGID: 1785730689899134402 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 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 ||