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: 757546 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hbr/wFZP" 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-Google-Smtp-Source: AGHT+IHWWQ7yvErxF9OIA7H6637gH3kNjMNDPqZnBLODlsTBGOFq4IWWwm5YOObU5TbJYQmMyuwAkA== 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: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)