Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp51184rdb; Tue, 19 Dec 2023 09:05:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHjGjiqSy60ZeY6bWSPidBNQsiHtopLEO6ss4rfeLFs6Qy7wYTVTMAChJSbcPz78W+uG9ur X-Received: by 2002:a67:e711:0:b0:466:9f15:3339 with SMTP id hw17-20020a67e711000000b004669f153339mr2717674vsb.27.1703005520026; Tue, 19 Dec 2023 09:05:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005520; cv=none; d=google.com; s=arc-20160816; b=GICkcfYfB+AxYHFy1e33ADYvU2h+YVIUbNfh6BaTvR1Sn4NTtKqGkM4NKvvZp2GVr2 ZLKVh7hiATsxdurOgJrG1XJxjULKix4Wo913ohP7wiUMWpZgR/Cep32k8IGajObRHShP T3TBfcBLbZn7cjy+xQ3eqhVPrKugIGdJm9xCZB+xpRZzBaLAR9hLg/PZawK75UNZTMWe 6QbH4LBWyOOT4SRP/P8H/qarTVt399Cl3az+CzXMG4F7GvjiX6DVRdGuYC19RcFuQpbW Cu1lVpi+Ci+0zz3lh9jPZwkkpZToUlfyXar0hhP9KNWtdCL7oc0olSK3VwqIhqoT9wGJ KUQQ== 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; fh=k7ZhfSDxugAUNAX9PFQjqQnTRGZ+rgCl5CN8/TdzbyU=; b=RaTwhe7CPj6nQEL58H0N+jpduHKDhbwXsryU+etQYlDWkZohZA9kff0hmklrP+YR7Q ewtvfT+t66WR1LDjJB58CmQxGSGlvKNVtG1G7HIk1tpzoXPrLoFxL16rYdusqRaGujWr 0n4Cc6L/+K3z42rv4XHSw+FM1txRT9Hmkog3OzzyiCRDmIX7mfWrL7jDxnK9oZAiH1++ f6SQzK9gwqy8trnP5ph+iM3wS4jPn84vsAEtOSM9ZvtAREtlG/5esQBkMo2qR2qWq6zF PKJQoT7EZZm9xJiO7/CZtm6Kx7XvTwsQgE80272z2CwVgtCgT6q8UQ8xGjAFy/AiqVJR EE2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FLbv3sZm; spf=pass (google.com: domain of linux-kernel+bounces-5632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-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. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id s18-20020a67e352000000b004668740ea57si962497vsm.690.2023.12.19.09.05.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:05:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5632-linux.lists.archive=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=FLbv3sZm; spf=pass (google.com: domain of linux-kernel+bounces-5632-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-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 BDED11C24697 for ; Tue, 19 Dec 2023 17:05:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B91483A8EE; Tue, 19 Dec 2023 17:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FLbv3sZm" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 8715C39877; Tue, 19 Dec 2023 17:01:22 +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-f52.google.com with SMTP id ffacd0b85a97d-3364c9ff8e1so2641744f8f.0; Tue, 19 Dec 2023 09:01:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005281; x=1703610081; 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=FLbv3sZmaHeMsOJGz89aw+ajYYJIQLnOqmbvvjp2YFgEMPSZVF+YZBxV1lTZHZ0jMz b+PCfITFr9L0bRKBu+SUtf9ASjBPwlyhd82QEQO7aM3Flj1nhmUgI1A+ouj5qPigQRKc F9HrM+qCi2oAVLYWu7rTV3jBjW1Zuo+rJ+PCQLhHLhIDwwbrDJYXoo+IMWOOAPC1P5tf twZWwPnHr+4nMPS7U+soZmEJlBhYds8+ssRwm8B/iGgeKDyjUr0rJCmS/eH4bnIMNiM0 LUX8EJsXP3+wtkmvl8cuiSwPpFSfsd5jHkl/45Xe6zXGU0N0lnR+YIrfKfLZf3MYDMv1 j1Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005281; x=1703610081; 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=61BEi2enFRPw/8EyUZ5EsB7jHaGAUQBqgpyqmRd+nco=; b=nsBknzUrwB3ZuQJu7kplAD+i6LS5H8XZxEy+rke2zWtAsPxrgmutEV5T34M3C04rTf u83pxascYUyaM/GfEsXbbE2dPfjdKlalqnw+SrYiRGTTaZN1deBKoo+3cvqHmCT1cn7O UvyGcTOVicgEexp+FVAb89hPqnSmf3FzsMXK6S1ESwHKGwWS0qXJQEXl4uAryPQwGIhH L+97KnIWMRd+pO6Y4XxQP0kYoQYhkkbVMbZv9M3KWWGUAZ5wBFqPeyIuJRHlap0zVNUY WLQkGN/QNs++hHb+yAWOh1rJvy9UCeLi3mnRCIfKO6ldcxo+tGnNiZeHmBdeDLSbQbGE TnCg== X-Gm-Message-State: AOJu0YwpNehEVwipItIyNvnvUlwa9RCMYVx2RkhsyMaXybuR3t8dwrX8 zzVULPcVn5YAPPvtPRY9Hg== X-Received: by 2002:a05:600c:3115:b0:40d:177b:c3b3 with SMTP id g21-20020a05600c311500b0040d177bc3b3mr847099wmo.18.1703005280608; Tue, 19 Dec 2023 09:01:20 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:20 -0800 (PST) From: Alex Bee To: Sandy Huang , =?UTF-8?q?Heiko=20St=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 v3 15/29] drm/rockchip: inno_hdmi: Switch to infoframe type Date: Tue, 19 Dec 2023 18:00:45 +0100 Message-ID: <20231219170100.188800-16-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-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 Signed-off-by: Alex Bee --- changes in v2: - imported patch changes in v3: - added my SoB 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) -- 2.43.0