Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp277465lqt; Thu, 6 Jun 2024 03:22:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVRTVGEsW8hy9AHe+zjHeTnJ0oSQJUj/i5/drf809kLML53upzp/5CcMnLdeYonTZZSzhei1xDpRegy0TLLsCGY2LqAN1h0PXfraU1B0Q== X-Google-Smtp-Source: AGHT+IE17tXw0TlHwVZfvmVOxMqruhlGLnnankgp/stPZbkJiXMQUytbAdJX0x8CpSex7OhPD/Tq X-Received: by 2002:a17:903:2304:b0:1e4:c8b3:dbaf with SMTP id d9443c01a7336-1f6a5a12deemr67383315ad.33.1717669376291; Thu, 06 Jun 2024 03:22:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717669376; cv=pass; d=google.com; s=arc-20160816; b=0WiI14SmrKRKjp/ZLeRxK2EVBJ5Hf8DaraqzcM68JHgWdaDK5l0F8nL/iUXKC+ZuZ5 zhe54IxheyNUU7GcfmzBiZI2mza5V3Be742adcJ545T1Gn2fbKh2st+JgWGy9q4L1T8i nelcmJik3aOhG6jilIVkvzLIyeOEIk5Dr3xS/HHfmxqO2OjHaVY6TXfmToUeNNJkNsXL sam3MtcBMs0UgJxNdXbbH9diyzkX7n/VJzwN+CKuTCFCRqptbrGnsu6vzYD4WmhQs0eO eml987bKiZJic/4pE82zAZSyEo4UkNeOV4gF28/hhPm6LqSpUzAhVjOPFgu4ynbG3W21 +xMg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=XnVw4MbvJI6I7KJ4ZlK0XuPou0oRTJdVpBboW1knie0=; fh=7WyFlRhBHHdoSyaDOhFriU/TMMwwHESV6UojjUHXCxQ=; b=c/tdIY2MPgELF7Muvbn1KgPHNCMGnJjZ16BdZ+X31EnnE+zh/8P3CYb0BzoZvX52Se 7Wrahga/nMAKCPh877/NOIpKaeGIFvZFaG9Oc5jxlRpw7BdV2zRB7/T0v+LgWMuWH6nm vurD7LiDDvIkUsb9oM8FupwbmbMrjtfVnChexo0iYbD2K/6D6bZLeARLJ6K6ISNxyHvD LVW3hlNn14mCi1Q2E10ckbVBXlzPI/DHJHnlGlv39y4WbxOXUouWSxTzWnTC1l9vIk34 bLLVyV4smQIZEqgjD4o4rfJKCYWeQ9wnzmpEo1gGbbqLxzQqf2Kmh3b7j8zAkTIaQ80F 8anw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Qncj7IYy; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-204062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f6bd76cd1csi9153705ad.152.2024.06.06.03.22.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:22:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Qncj7IYy; arc=pass (i=1 spf=pass spfdomain=collabora.com dkim=pass dkdomain=collabora.com dmarc=pass fromdomain=collabora.com); spf=pass (google.com: domain of linux-kernel+bounces-204062-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204062-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E757EB2EF76 for ; Thu, 6 Jun 2024 09:53:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F16B317E90F; Thu, 6 Jun 2024 09:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b="Qncj7IYy" Received: from madrid.collaboradmins.com (madrid.collaboradmins.com [46.235.227.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BFB317E8FB; Thu, 6 Jun 2024 09:53:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.227.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667609; cv=none; b=cmn7EDvkNWYckkbNJIYh0Cig3jPgldw9BNnoCi95i7emEEF6hQhXht8WYL+CAiyP1qibfO6TJU3hhauhs8eo2offx16BW6QK57reGBIAEAJTWM4iQHBh52ZKVE/+jGp8DtYaLYaMmmO58uMrp6X+L+fAUcJyXtyIAQgWGbq9RyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717667609; c=relaxed/simple; bh=CKTgow/rXEHMO5WjfhlWa4EqAX2k6le6hA30B/0Rkug=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=X4mQnLfHvdpfVt7z1PyugGFoOjBECEHhm9GLWKx6+/vCTdBXzGJFJAK1lQ/OHtio3rU4/LjTS6wE/UHOu4scPYA5ox95hz2kawo7AVl6tJZvc5YvBWiFSwVuetQvnMiZFqB2eXBrkJf2hfGNv0snuIMgDpSYNHp1GIc2MspMRDE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass (2048-bit key) header.d=collabora.com header.i=@collabora.com header.b=Qncj7IYy; arc=none smtp.client-ip=46.235.227.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1717667605; bh=CKTgow/rXEHMO5WjfhlWa4EqAX2k6le6hA30B/0Rkug=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Qncj7IYyv4cPm7O8mmmeYAsqXX2wIMRYjy47ZisSwnTzuBapQHru2SfHHT5snuLzU NyJ/WPRp/6MGqP+ZMMhBM4jFWOLG5/qddVlFH5dKcZP1qRN2m4xOQPv74qFQfH8/rp HRvkqkGUS91XBUdJFpJZXiT3vRq4FPOvfZVb8E1/oIsOHdhO7Z1761xudvFgPbsq0r l7XGNa3vch39wRWsYD7c/tVCqEAyk/84VVKlCpUI6/mlItPi497RrIQuHRENY/R79h 8efYUvpHPwgqh8nQpKJOxnRvThALy2bP83BmgTfnm2bmRiHLGOhyWq7dtWHacQdkar HgukqBYuuih7w== Received: from [100.115.223.179] (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madrid.collaboradmins.com (Postfix) with ESMTPSA id CC0683781182; Thu, 6 Jun 2024 09:53:23 +0000 (UTC) Message-ID: <25ba8753-b7e9-4f6f-a9ad-c5266540939a@collabora.com> Date: Thu, 6 Jun 2024 12:53:23 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 13/14] drm/bridge: synopsys: Add DW HDMI QP TX controller driver To: =?UTF-8?Q?Heiko_St=C3=BCbner?= , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Sandy Huang , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Yao Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, kernel@collabora.com, Alexandre ARNOUD , Luis de Arquer , Algea Cao References: <20240601-b4-rk3588-bridge-upstream-v1-0-f6203753232b@collabora.com> <20240601-b4-rk3588-bridge-upstream-v1-13-f6203753232b@collabora.com> <2554679.TLnPLrj5Ze@diego> Content-Language: en-US From: Cristian Ciocaltea In-Reply-To: <2554679.TLnPLrj5Ze@diego> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 6/5/24 5:48 PM, Heiko Stübner wrote: > Am Samstag, 1. Juni 2024, 15:12:35 CEST schrieb Cristian Ciocaltea: >> The Synopsys DesignWare HDMI 2.1 Quad-Pixel (QP) TX controller supports >> the following features, among others: >> >> * Fixed Rate Link (FRL) >> * 4K@120Hz and 8K@60Hz video modes >> * Variable Refresh Rate (VRR) including Quick Media Switching (QMS), aka >> Cinema VRR >> * Fast Vactive (FVA), aka Quick Frame Transport (QFT) >> * SCDC I2C DDC access >> * TMDS Scrambler enabling 2160p@60Hz with RGB/YCbCr4:4:4 >> * YCbCr4:2:0 enabling 2160p@60Hz at lower HDMI link speeds >> * Multi-stream audio >> * Enhanced Audio Return Channel (EARC) >> >> Add driver to enable basic support, i.e. RGB output up to 4K@60Hz, >> without audio, CEC or any HDMI 2.1 specific features. >> >> Co-developed-by: Algea Cao >> Signed-off-by: Algea Cao >> Signed-off-by: Cristian Ciocaltea >> --- >> drivers/gpu/drm/bridge/synopsys/Makefile | 2 +- >> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 787 +++++++++++++++++++++++++ >> drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.h | 831 +++++++++++++++++++++++++++ >> include/drm/bridge/dw_hdmi.h | 8 + >> 4 files changed, 1627 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/bridge/synopsys/Makefile b/drivers/gpu/drm/bridge/synopsys/Makefile >> index ce715562e9e5..8354e4879f70 100644 >> --- a/drivers/gpu/drm/bridge/synopsys/Makefile >> +++ b/drivers/gpu/drm/bridge/synopsys/Makefile > >> +static int dw_hdmi_qp_i2c_read(struct dw_hdmi *hdmi, >> + unsigned char *buf, unsigned int length) >> +{ >> + struct dw_hdmi_i2c *i2c = hdmi->i2c; >> + int stat; >> + >> + if (!i2c->is_regaddr) { >> + dev_dbg(hdmi->dev, "set read register address to 0\n"); >> + i2c->slave_reg = 0x00; >> + i2c->is_regaddr = true; >> + } >> + >> + while (length--) { >> + reinit_completion(&i2c->cmp); >> + >> + dw_hdmi_qp_mod(hdmi, i2c->slave_reg++ << 12, I2CM_ADDR, >> + I2CM_INTERFACE_CONTROL0); >> + >> + dw_hdmi_qp_mod(hdmi, I2CM_FM_READ, I2CM_WR_MASK, >> + I2CM_INTERFACE_CONTROL0); > > Somehow the segment handling is present in the rest of the i2c code here, but > not the actual handling for reads. > > The vendor-kernel does: > > - dw_hdmi_qp_mod(hdmi, I2CM_FM_READ, I2CM_WR_MASK, > - I2CM_INTERFACE_CONTROL0); > + if (i2c->is_segment) > + dw_hdmi_qp_mod(hdmi, I2CM_EXT_READ, I2CM_WR_MASK, > + I2CM_INTERFACE_CONTROL0); > + else > + dw_hdmi_qp_mod(hdmi, I2CM_FM_READ, I2CM_WR_MASK, > + I2CM_INTERFACE_CONTROL0); Hmm, for some reason this is not present in the stable-5.10-rock5 branch I've been using as an implementation reference: https://github.com/radxa/kernel/blob/stable-5.10-rock5/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c#L760 Is there an updated fork? > Without this change, connecting to a DVI display does not work, and > reading the EDID ends in the "i2c read error" below. > > Adding the segment handling as above makes the DVI connection > work (as it does in the vendor-kernel). > > So it would be nice if you could maybe incorporate this in the next version? Sure, thanks for pointing this out! Cristian