Received: by 2002:a05:7412:8d23:b0:f7:29d7:fb05 with SMTP id bj35csp295090rdb; Sat, 16 Dec 2023 08:31:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IEy2/f8YikzvWbzBvIMRgtbjIvcGvAL2ghMPAgLRWGiE4lLrvs+meery6i8H3RWTeooPeOC X-Received: by 2002:a17:907:948f:b0:a04:4b57:8f27 with SMTP id dm15-20020a170907948f00b00a044b578f27mr7696935ejc.60.1702744287807; Sat, 16 Dec 2023 08:31:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744287; cv=none; d=google.com; s=arc-20160816; b=Lq+mW6E45hOqwKvHZ5lV/O1RyC+ha2bthCLhlkdMcGimahNZnDeUI8JY5qsD5eBZnH T2OGXdk2rUAZ6Uu5zPB+oE++4FZ13cWBu7MfOlE1gac+7WN6tQDctVMRG17JO1lrDvFj BxM5uLS5LTnLQT/+eu6TVNMdPrAf0UUFNnFbiwEINg7d0xqqcVVHZLIRhzLZFKusMWue wh7ajh+4jCx4c0Rqc5iSH4ZEwTQm/+7CaGFenIfCBvRfSTxj2PqsDHUgA69Bi1+0kE1N lU8cebL9USvYPqgahfnJM4P/56CWHU1nxrHqO00Jwqi8KyK093N8MX+kwZCIkAPg+DW/ s4Wg== 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=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; fh=nzMX5Jolb3GculGR3f1Z1ReHOqdNjcdazDY5R3X+7M0=; b=M0fuw73B6Sqt5mo2HtJEsq4NCtS7s/nxdVSnZH7fHfzikeloQIaSEsKU2JKo32Jx8S fkkPzic+UZK5sVShknYWkIHOkh9EDJNtr5rwO++7auEPb0BLkSSmqR7TmIFIGmJYOZ99 Nj8nb38Z3eIczl8415RW5HPiiHnHKEj+V7bOCF7T7V2GSvH74CKU2bM1Lwui4j2wVZ6I bpRUp1+fQtcsP6cSHVVsonMRvcW+MEeJTHNico1YHpQIleec7N45hrbybGa2ov7jHkcw I8QTltS1GGnWHzBo/joSAMefZuF5SS4/P+5gnc/5RWKCWl0cB0GxxlN+9Ipvqk3wzVG7 Mv9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X6rqeUoM; spf=pass (google.com: domain of linux-kernel+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f1-20020a170906390100b00a2313747064si2206844eje.56.2023.12.16.08.31.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:31:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=X6rqeUoM; spf=pass (google.com: domain of linux-kernel+bounces-2262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2262-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 900E41F211E2 for ; Sat, 16 Dec 2023 16:31:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B7D937D06; Sat, 16 Dec 2023 16:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X6rqeUoM" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 D6B3E3527F; Sat, 16 Dec 2023 16:27:17 +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-f47.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso20167155e9.0; Sat, 16 Dec 2023 08:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744036; x=1703348836; 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=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=X6rqeUoMewdEbdxKdatXx/6CxrZQVCowouNMZNs0U1LuHiQIBWeTu+nMx5RjvJG5Yd dtIgfJbyyAnAohClB/CVXWUk9lrXH7HjlX5ss+KND56MWvffk8QNNlK4uEiQhDm+ImMF cxf/g1b7bfnMeDIuaUR/TRzsWnClyplK/9GYW0ND0gKE5wmx120n2lqx/gAVRojdwfW3 2uPGtIMQsI9bVl3RyNq/sAfH1nVTvHyoark/V9vodgmuB6WVJ70K7wv25qvUX4i6SHsK 4jeE00mXi7yFX3nAMclo5vMtwgTbinbCYq1Gjn2cprJm1s+JphpQBJcr8deF6/cq6JYi 3EYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744036; x=1703348836; 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=mG1054x2y8+5VXwex9KrJL2EhA9y28dmW4DfXU50wTY=; b=VH/uP8gFV+/x1RnERivK4deyEpB2mnp68jiN1y8Oz790tPaIfLCRyCGPXCYOrhtVPn A6MhDAWv27yY0AIoP02wMymOIxZI2nhiObD8LDqxPeMgucqQhxyTth4iPS3uPJokjLe2 g7yl/7b0e7PFziZaoq/xTa4CJpIlDH90K9TyeqO9t5iG/UKCFWhn87r6fos+s4+iF7sE iOKwvAOyIOt3wQ0prX9qRdG+qsbV6vXA+aCzsJljCQ07aUcWosAux9MsmzvUCYMl7OGa kNvmeLHBYZEqIcsETWT53VebFwT7ThDPrdzeCaePtxWquwhshyvMyJFEnyE4hipV+Zxx Ljww== X-Gm-Message-State: AOJu0Yw5dEHac9g4m16xzfshND47HDV2SqV4YJijZms3pHX17r0UcDcq w7sM0kQrWtsfB9Z+iE0WjA== X-Received: by 2002:a05:600c:3596:b0:40c:ab87:9d9c with SMTP id p22-20020a05600c359600b0040cab879d9cmr547390wmq.53.1702744036134; Sat, 16 Dec 2023 08:27:16 -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.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:15 -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 14/27] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Sat, 16 Dec 2023 17:26:25 +0100 Message-ID: <20231216162639.125215-15-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 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 --- changes in v2: - imported patch 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 6354949bfd8e..b6b34f4b8cda 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -207,33 +207,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)); @@ -257,7 +258,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; } @@ -268,7 +269,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) -- 2.43.0