Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp294291rdb; Sat, 16 Dec 2023 08:30:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IHj04wdiXP1cjlldRsDBLkNtUNepnIP8sWffjwTzgiiXTRqafxTWkwTWjiYjy/mBZRwkdBh X-Received: by 2002:a05:620a:12c3:b0:775:a91c:80c2 with SMTP id e3-20020a05620a12c300b00775a91c80c2mr13274358qkl.73.1702744210890; Sat, 16 Dec 2023 08:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744210; cv=none; d=google.com; s=arc-20160816; b=kTLs0nibY64vLByg0T8Jhu7KSmSjDVO9s9D5C7KujDZwnspq+oAhUc50w6gHaKuOAP 1yZEFE6ETYaZoDgUgPnaYojeaH5ahaCNkMIRsOfo24WeODZNhESieRhdl6go8eJgzaSA nhvnJD3klnNqloKZXNngRH6hSSgxcBd2rvGpwazpGw1QlzganEA7YRO9z5mxrcVzY/6U PhXsfsB5Su1lqF69cabpNX4TELIqth6sizIY33EOxOxU11Y3dKxu7FvkRaSWkkDCJA5z HWG4kwnm+Nr8e58JHN6By3BXhKA+GXfTDpHjLRTbV+H89dtLnBWhmZjZIUfuSi6hp19G DwOQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-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. [147.75.199.223]) by mx.google.com with ESMTPS id w14-20020a05620a424e00b0077d9167efa1si20339360qko.86.2023.12.16.08.30.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:30:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2258-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2258-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 95C101C20A18 for ; Sat, 16 Dec 2023 16:30:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F26AA34CE4; Sat, 16 Dec 2023 16:27:16 +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=20St=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 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 [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 || -- 2.43.0