Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp50208rdb; Tue, 19 Dec 2023 09:04:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IHk+Rw+xBcjAP6qgPELcczFxA8kLsuZBJIqS2STTQVdJU6/HpzkFAgLALni9GHaYXDcMtwI X-Received: by 2002:a05:6870:a99d:b0:203:535d:102e with SMTP id ep29-20020a056870a99d00b00203535d102emr4968251oab.21.1703005455465; Tue, 19 Dec 2023 09:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005455; cv=none; d=google.com; s=arc-20160816; b=CD4e4MQ47EJnrckjBMjxH/HsdvAwzYlatZncp5rdbB+/Y9M6PrAAQttfkTzrdtPrPP WeHuhdyefdOiOVac1WW2Y9J8o9FKj3Zs3F2JfttRKouDhsSvgv+3zKunVnUS8vGyr48u X2yzNEFyJCBIVy2OPgegTNLvFynF3Ne6JhtTyQWwGMrj+xznxjgaJka25TWhZqwOga/B kFaf7GlhQuWPVrbzjOHaXDcL/Ud0RvYeB2QrHMOX8v1pfiqkWCkF70nYHSbOdxaedggq 3/7U0XdrIR8nBsoQdC+dQ/3FzBCLr3vAYzUCnBhaMb1DRXkko48Q7TfBDYZIK6+TU3pB QeyA== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bm11-20020a0561220ecb00b004b2ce593aa5si5107666vkb.161.2023.12.19.09.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5628-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5628-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1BF5F1C24CAC for ; Tue, 19 Dec 2023 17:04:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 435E73984F; Tue, 19 Dec 2023 17:01:21 +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=20St=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 Content-Transfer-Encoding: 8bit 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 || -- 2.43.0