From patchwork Thu Dec 7 15:49:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 175233 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4875597vqy; Thu, 7 Dec 2023 07:52:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+Zsl8oz8zfuWoHueoyjzAWc0IH+zeZs27kT7LPaj0wFCuCPcBUzVhB9gRtQY+2+AvhQ/g X-Received: by 2002:a05:6e02:1c89:b0:35d:a54e:7d71 with SMTP id w9-20020a056e021c8900b0035da54e7d71mr903887ill.75.1701964335208; Thu, 07 Dec 2023 07:52:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964335; cv=none; d=google.com; s=arc-20160816; b=LIWM8nLA0ZlWZQpvNeaFKPUNgyvTIDlkkTkUu0XNZ9OX6FhIzGRClFjjEsTpviyXfa CaS/u4TMlFpagsjcJrL1H8E02+DYkVY5S3ovm1+NBSJMYINIyFCxa2qkl+mQNnfkesyG vJFIzSSJS8xxqk5KShHLPgc1J7n58A36EAFTUFEJ1Zryy8k2vXhABueKaH/4XhKhm9rm HVgiwI0hd1Rxyyv7vF0vcylIXu4zGPtRPC51oBm/6yOsDYTRmTmw7YsJGdPJAqgK+eW1 qqI34nnSlzeTJ7zCiLNroMrcXMI1yJIMUlZzjmQ70UqOTLFsHecFDNaxBKR2lVt1LRNt Dlsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=fnlyBXbRd2NUhzLcDbjLJCrNjXxiDIfRKgOMHphweBc=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=WJcAIIPN8/vXJc5ZHNcQaw4hmg+40mK7RqqcBjX24QqULS5HA0xTOrb2+bTKteSX/Q xWYKfP/qVOHYXUvNYNjC3vNv/+2cxqkXb6RihMLuST4lHZ47hSPxQGeZOUIrMGkzmeNW M82Xu3SWe6/ycmXPT37IStUPlogaDtCWkJZzn7QoM7X3MpGObfw4E0NM6ccNyPHJgwAW Vey1qr5G2dvJpoZu+NyY2E1evcPVhYo0hxZBlrA6uYDKOyOU/yygq8md4ZZA6tS2owh9 m/2kBKYWmykpVIbps+B9x4wMbjtuJ6rXkv+u8Ty7HRqXv+HPC732wHrj1bpQmgPwM/g0 0a6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GMZEC6Z+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j14-20020a63e74e000000b005bd27295abcsi1377502pgk.682.2023.12.07.07.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:52:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GMZEC6Z+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D7D3D80964DD; Thu, 7 Dec 2023 07:52:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443712AbjLGPvr (ORCPT + 99 others); Thu, 7 Dec 2023 10:51:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443733AbjLGPvR (ORCPT ); Thu, 7 Dec 2023 10:51:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED7992691 for ; Thu, 7 Dec 2023 07:50:46 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB5A8C433AB; Thu, 7 Dec 2023 15:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964246; bh=1bLue8N/fvBWkSCqcYBq0WADSzUFdODNuK87DFi9fQs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GMZEC6Z+6kPQXSMvInDEeVjjxR1IHuEOJUtUJSIeOCjxAbVjEqZ11xajBz/ml24um YAftZgYyqcup2XHIR8x0Uxuvyrk2vUOEQzH5J1/wZUDTxwnuhJlFhoGFWDbjrm293B ve0bm1QP3u3C939rhN0/QzVLmfDNHAYV5lNQfn3tg72jze4hI/WELOSnJAHUuMyddn 0+O5T0c0W8GAACvaYYdLLZ/SeNmPfPRPcfPsSBCKEcRRqMooGSJf76IFFCXXGZlL3R EdeZZPxk4fOmJOlI3DZge547eFTHAtDtY8PTEgKEOC2uG2JLbT8LkEn+Ba5r3EQf7j RXsd2YI9LoZpA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:49 +0100 Subject: [PATCH v5 26/44] drm/rockchip: inno_hdmi: no need to store vic MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-26-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1633; i=mripard@kernel.org; h=from:subject:message-id; bh=1bLue8N/fvBWkSCqcYBq0WADSzUFdODNuK87DFi9fQs=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL9ty495u2KG42v6L9nLvf0kBedssm+5FsTuzLlbub jl7Pi6ko5SFQYyLQVZMkSVG2HxJ3KlZrzvZ+ObBzGFlAhnCwMUpABNp2MzwP3PmweNGVRdeMza2 +2mz38pMavVZslAv7kKi6d/NLs+3yTMy9H+wEEl1P8aSo2dseeTSvcept7qlTm6MePt3QbVugiQ LNwA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:52:08 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784638955153933330 X-GMAIL-MSGID: 1784638955153933330 The mode's VIC is only ever used in the inno_hdmi_setup() function so there's no need to store it in the main structure. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/rockchip/inno_hdmi.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 4db18195246e..294f0d442c0c 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 { - int vic; bool sink_has_audio; unsigned int enc_in_format; unsigned int enc_out_format; @@ -443,16 +442,15 @@ static int inno_hdmi_setup(struct inno_hdmi *hdmi, struct drm_display_mode *mode) { struct drm_display_info *display = &hdmi->connector.display_info; - - hdmi->hdmi_data.vic = drm_match_cea_mode(mode); + 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 ((hdmi->hdmi_data.vic == 6) || (hdmi->hdmi_data.vic == 7) || - (hdmi->hdmi_data.vic == 21) || (hdmi->hdmi_data.vic == 22) || - (hdmi->hdmi_data.vic == 2) || (hdmi->hdmi_data.vic == 3) || - (hdmi->hdmi_data.vic == 17) || (hdmi->hdmi_data.vic == 18)) + if ((vic == 6) || (vic == 7) || + (vic == 21) || (vic == 22) || + (vic == 2) || (vic == 3) || + (vic == 17) || (vic == 18)) hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; else hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709;