From patchwork Sat Dec 16 16:26:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179883 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp316000dyi; Sat, 16 Dec 2023 08:34:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfB5k5UdidPIA5stxrnORuwCmVhkw6T2eJ9dmD7uF+qaLm+LmVklqykKmDF4amQ7DtjnqT X-Received: by 2002:a05:6a00:a01:b0:6ce:82bd:93ea with SMTP id p1-20020a056a000a0100b006ce82bd93eamr17865554pfh.26.1702744464025; Sat, 16 Dec 2023 08:34:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744464; cv=none; d=google.com; s=arc-20160816; b=ydXaEFsUw/OaNzT3tYtApuxuJNBDMDq80Kh9r5DfY+Lyn04Ncs8ulDQC9XChpAsD73 9Y/zV2s2DNpew183eCch5tRCqRNRnHEwH9GPduf1VYkXAf0+T43+lRsiT5ocdOkPUyTA j4KC1LY7uktPdcMq8ncI9D6k8ISDLHfElyKf0DT770XH55h4pXFi1BuqF/wG+qMW1uVr BSFvv+VCG59KboHKgjXh9zqQTb1h1p/op/+Bwh6FNTG0ccauEExAcd1TyvwYDdT7P6KT Aup/Gq6v9XQb9exV++cPpaihGD8B+DKS+kbLX0j702GDIbrNVF60fAoHwRZd9bqMPoyJ RglQ== 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=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=qlDGQou7BKqmZXATASLroLnhvzHSOc2vhRVcKnGdbZOIdw6PjyTPlPBovCOFrcQDCi CKNm3R7e779SFXQhjKE9FMhZu5Rb59hAAuVrlRmTv2lTx9qbC5yNpnvt8vAQ+8UGjCT5 LfCdArDhX2OYrYTcHl09VyDjnC4vHbClF0rDWPYZGyZu/zw51jpwfb+0CKtqCwOWKn+X G5DMCKrsQrG38lpHimtF1LJEKsUYI57mM5wm4n/H8RhtJ4lnqFbm6nXQX0HMUNpCAulJ NK3aYLKnpjD6EreGcDDE3jhOevnz3PRIojdxfKhYGDmgxF2TM4PS2ULCowJ8XrLDkBor Dsug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyg+l2bT; spf=pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id n28-20020a63591c000000b005cd60647c4dsi3354103pgb.766.2023.12.16.08.34.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:34:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=gyg+l2bT; spf=pass (google.com: domain of linux-kernel+bounces-2258-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9C8B5B24538 for ; Sat, 16 Dec 2023 16:31:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F3DA6358BD; Sat, 16 Dec 2023 16:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gyg+l2bT" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 9E01C32C67; Sat, 16 Dec 2023 16:27:14 +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-f54.google.com with SMTP id 5b1f17b1804b1-40c517d0de5so18402625e9.0; Sat, 16 Dec 2023 08:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744033; x=1703348833; 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=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=gyg+l2bTeIwDBEi+sgVX2igib/bUciUDVznKwWMrQL8WS69i5FCUcUynsKlPOUHfOI Aoi/f0dAZfRfjZBi8w8uz6QPrGHovyICXAwwuLvJNK1HTrILEuylHgHx1AyCDXTGQTv+ 5sbPL6rF3QSuLPQYsWN7bBjGSqaUEaUuVC5uUbatxb+gKB3KWGIoFj5T5bwhL/n95u4W zXoRzG2mDaI/tIyJfWdKUNh/7+Pa9YUr78fqD4xTatZ/hWD1agvTrwu2uXICcjte68ng 6GPa1VNiB/qBzhNYygJxWIreu2jr4o4K0971O255hFaCTJnIkSuiLAB4vEIsPVg4smhw Qd9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744033; x=1703348833; 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=KAoRz0wHCs8LYRbt4lNTAJ8vx4780AGy/20pu4Etj/0=; b=wMYDdbCtSbGTPOLmALcuBrC21HadwzSO0KhXoofu5iesZXCo6++iwZ/IWGFjswcha9 8G1S0PPrccO2XEZW5iywQSPBpy7b4H+PYM+VJdG5IctEv5dMdqPNmVk3ivo819cXSycv ZVdtKwJ+7hxb7BChhlfxYy5IBq++3+r7vV3sOAxob/k1n40GrGf4OUlJhQpzReJE6+Cl lPmMsMR73ilQ/hgqAEEbRsZHyiXdpg2BgDQnorWP1KGtlwfId5EJAEbD2DJbyHetY+oF 2z/A7agL3UYR7rb93sD/npn/5hSy9L0bsoskUj7Uh2zDLau9ZOGF4ua2HkGkCTFCmrhx RXSA== X-Gm-Message-State: AOJu0YzvDmt5jBFLgHCkANVnCD4+Hs6JYhDuOeEmWStA6lbvJXf41mzP /5FI+mwnZtH7/xu93VcOCQ== X-Received: by 2002:a05:600c:474e:b0:40c:4be1:be09 with SMTP id w14-20020a05600c474e00b0040c4be1be09mr4886690wmo.186.1702744032805; Sat, 16 Dec 2023 08:27:12 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:12 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH v2 10/27] drm/rockchip: inno_hdmi: Remove useless input format Date: Sat, 16 Dec 2023 17:26:21 +0100 Message-ID: <20231216162639.125215-11-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-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: 1785456979013451440 X-GMAIL-MSGID: 1785456979013451440 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 [made checkpatch happy] Signed-off-by: Alex Bee Tested-by: Alex Bee --- changes in v2: - imported patch 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 ||