From patchwork Fri Dec 22 17:42:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 182743 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp1224404dyi; Fri, 22 Dec 2023 09:46:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGubvdayvywE2zcxocT05X3flS0hHj25qvAuGT0SSDmJTQyiMiN8bq4MticOT0A3C3MkuzG X-Received: by 2002:a05:620a:1185:b0:77f:89e:986d with SMTP id b5-20020a05620a118500b0077f089e986dmr3608918qkk.78.1703267204150; Fri, 22 Dec 2023 09:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703267204; cv=none; d=google.com; s=arc-20160816; b=m4Dt288BG3jLjgDfYTlFVQ8tDx+YvelkNK5A7zzQBUwnXojFo0L5CsXtJBMQGqZlRC 6mN5pI5nRWRwPpRhSFaU0c/Weh7zhszzInzM5K2OUxowaHoEfsCRa/Dg6Q7p7zKaTYuf KitkaVcYRs1m8VcZEPZiwA2mEJtoVqm2hFHdX+Oe6pLlHoF0Mdy/Y2l042OxhxE2TPeY A6J1OTeM/vCo3Ritoh1R/UXdHPkx7kOkNQ8til/r3ObputpkGwt5VVX0soRXT2zjQNEg AYNIgTp75Do37i/xM5d3D/6ugLcnRUFtLyBcxyWxu13pRCwSJT1DYWAX0YzucB3wKrG9 9s7Q== 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=e7WilUSfBxowgzB9qW5gjYD87YLsYI0v2TCM0rlyQBPzAAdaZgitUh+Z0l5p4l+I03 Ksr65iQhGrTyf9veEiaMiLXYAjtGXK5srYFzE0d2dTeF+Ud2/zVUcsMf8cXrbEDC+IEW UUutkrkbss8Zcu2EGqDkkaj2QfrIZSPPrIMVE2SdUFxmIhPjXA8vGDt7TwIJUdA6wmTb FYwEJKiIdd5j0s17XOMP9MjM9S8a8fPoznfZxWyyf4wKLWzIkygFJ3Lc4nuNUiyY3d7C AyypDUWFmC9oUrLpTlDsdtzilbvNhST772TxS0WQPOS63wQLN37BMwJlNFVz80oRZFHv /cTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Hbr/wFZP"; spf=pass (google.com: domain of linux-kernel+bounces-9964-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9964-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a18-20020a0ca992000000b0067f518ca817si724187qvb.353.2023.12.22.09.46.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:46:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9964-ouuuleilei=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="Hbr/wFZP"; spf=pass (google.com: domain of linux-kernel+bounces-9964-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9964-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EA24D1C2248A for ; Fri, 22 Dec 2023 17:46:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 912F839FED; Fri, 22 Dec 2023 17:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hbr/wFZP" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (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 75ACF33077; Fri, 22 Dec 2023 17:42:34 +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-wr1-f46.google.com with SMTP id ffacd0b85a97d-33687627ad0so1708173f8f.2; Fri, 22 Dec 2023 09:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703266953; x=1703871753; 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; b=Hbr/wFZP8bW2McHeAiywbFLntm3k/cMV9c7Diwtaaq+DkPSQ22HvAmRh1VumQTCMXK iYbR7QHUaYLvm6xZxzE0XNBDsYr3QTUuArKXazo5yV+n2pWc91B2W6i2ZjXwOvOa2PCQ 8h/7ebwJlnDR/iARF0PrPNWTHCH9mrTqUzdV8B1DGcBHR92oOV5g+bCk1eBZ/+3R0iOY 7KgcL9xpmbl5npgNHFUCInLuwb7xawEJUPcijXWFRemQhOaUdWtNtXVB24QrgD8Fx5HA P3AQi2PcQ6qC2FW2vGmlUPv2FbxZntKmmAEUAzYrT9ufcPn4rOqMhW2GtbPOvef2DKFX OacA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703266953; x=1703871753; 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=Sgl1aYbfeN4t6iirxrjmyWdX/BacrfEEhrH3G2xuU9s=; b=PgNVoNzZ5In8WACBj5j039xbzXX3jIq24N/ZkSRumm1zjtqguy7MOtTwQdhfHDDGyo x0OhtKsvgZZ/9K8tyJX3LMMaLqV3BzZedFBrbh+8cTU/XnSdBycUXAewbnZe9lAmRUzf M6xhZpvmK67rnCtkosEPEIiQ6MCqimMFuovUfhk7HzXb+9liCOg1AqzErkK6wzRP8ZYB sGmK9AQ2uAbHd3F8CLfek4qJ8asWfOyxn7JtSczO/yRBvIBYUeJ/xT/3qQN4wa4yqiDc hm59heCDhin65gvL64qtVy95OWcMc0bhCFG5qgnUjsv5rOP6XZtcvQrDFjNOcbXD41On R7xQ== X-Gm-Message-State: AOJu0Yz6S/ToKLogVzOQqkpCtSmEFEfDiqutre768iRGdHDFVJfrQ2EF vw2OcEnWSSmAp2l33/ZFKGvovDADRA== X-Received: by 2002:a05:6000:230:b0:336:774c:d0f5 with SMTP id l16-20020a056000023000b00336774cd0f5mr1070493wrz.10.1703266952968; Fri, 22 Dec 2023 09:42:32 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:f3ae:2788:7e03:f44]) by smtp.gmail.com with ESMTPSA id w10-20020adfec4a000000b00336670abdcasm4777116wrn.40.2023.12.22.09.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:42:32 -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 v4 15/29] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Fri, 22 Dec 2023 18:42:06 +0100 Message-ID: <20231222174220.55249-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222174220.55249-1-knaerzche@gmail.com> References: <20231222174220.55249-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: 1786005112083552397 X-GMAIL-MSGID: 1786005112083552397 From: Maxime Ripard The inno_hdmi driver relies on its own internal infoframe type matching the hardware. This works fine, but in order to make further reworks easier, let's switch to the HDMI spec definition of those types. Signed-off-by: Maxime Ripard Tested-by: Alex Bee Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB changes in v4: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 10466c2aa520..49367ca24125 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -205,33 +205,34 @@ static void inno_hdmi_reset(struct inno_hdmi *hdmi) inno_hdmi_set_pwr_mode(hdmi, NORMAL); } -static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, u32 frame_index) +static void inno_hdmi_disable_frame(struct inno_hdmi *hdmi, + enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return; } - hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, frame_index); + hdmi_writeb(hdmi, HDMI_CONTROL_PACKET_BUF_INDEX, INFOFRAME_AVI); } static int inno_hdmi_upload_frame(struct inno_hdmi *hdmi, - union hdmi_infoframe *frame, u32 frame_index) + union hdmi_infoframe *frame, enum hdmi_infoframe_type type) { struct drm_connector *connector = &hdmi->connector; u8 packed_frame[HDMI_MAXIMUM_INFO_FRAME_SIZE]; ssize_t rc, i; - if (frame_index != INFOFRAME_AVI) { + if (type != HDMI_INFOFRAME_TYPE_AVI) { drm_err(connector->dev, - "Unsupported infoframe type: %u\n", frame_index); + "Unsupported infoframe type: %u\n", type); return 0; } - inno_hdmi_disable_frame(hdmi, frame_index); + inno_hdmi_disable_frame(hdmi, type); rc = hdmi_infoframe_pack(frame, packed_frame, sizeof(packed_frame)); @@ -255,7 +256,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, &hdmi->connector, mode); if (rc) { - inno_hdmi_disable_frame(hdmi, INFOFRAME_AVI); + inno_hdmi_disable_frame(hdmi, HDMI_INFOFRAME_TYPE_AVI); return rc; } @@ -266,7 +267,7 @@ static int inno_hdmi_config_video_avi(struct inno_hdmi *hdmi, else frame.avi.colorspace = HDMI_COLORSPACE_RGB; - return inno_hdmi_upload_frame(hdmi, &frame, INFOFRAME_AVI); + return inno_hdmi_upload_frame(hdmi, &frame, HDMI_INFOFRAME_TYPE_AVI); } static int inno_hdmi_config_video_csc(struct inno_hdmi *hdmi)