From patchwork Tue Dec 19 17:00:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2082804dyi; Tue, 19 Dec 2023 09:06:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IEs9fnVUOZfEjL5ULpyjz2TyYKo2yO20xAUSSyhX3VI4sWGfxJ/NOFiUcACiSy0hXMayBzo X-Received: by 2002:a50:a6de:0:b0:552:f57d:ac8c with SMTP id f30-20020a50a6de000000b00552f57dac8cmr1537063edc.12.1703005606569; Tue, 19 Dec 2023 09:06:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005606; cv=none; d=google.com; s=arc-20160816; b=rBahnadRWDVy6kngFmGwX15B/VG3sqN0zfB1os800M4P86W3OQKlIAmDWQyBmxSNeq XcKiTJCGzr9trQO5t9WANG9hyoleZBEIbDAt/VW9qTCjfsbatW6OOW/Xyhs2bgMlka1J 2MlMi5nkyMajzkj6l8f3k4wdLAP0bFEjMn4L5U9yclun6SMm64l+WrQGgOXc4kHZHVdZ vlNZvQ4acVP9z5Zcjtrg+tJP7D0j47V5Jxm24S31zWhXd8mpfVois/nmue4x6AITQw6E vox6bz0CNoufBaqVrQ5PIS55AYRfbYdqrhEE9NUc2mdKt5myNw8w3jArrVrj/LSlzhiW mowg== 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q11-20020a056402518b00b0054c5de6b545si10953148edd.346.2023.12.19.09.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:06:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5632-ouuuleilei=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=FLbv3sZm; spf=pass (google.com: domain of linux-kernel+bounces-5632-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5632-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5CFDD1F25455 for ; Tue, 19 Dec 2023 17:06:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5894A3D0D5; Tue, 19 Dec 2023 17:01:29 +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_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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785730806859322183 X-GMAIL-MSGID: 1785730806859322183 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)