From nobody Tue Feb 10 04:13:19 2026 Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) (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 9870C2F9984 for ; Sun, 25 Jan 2026 18:39:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366379; cv=none; b=Zd19TMjfAU5MEFYXtoV7bQyofXg/fd3k1xT+4JcmmCo865HaT21v0ypg3cONmFB5gTT2paDV3U2IpOEKwpxMi1/iTUd98E7e/0WlBQckOa7Mvvu3IT4/tmsn4OfkgvZ7ujIL6epBCzigjkMeKhd8P/td/Z1s9UmVEam+Wrte3Dk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769366379; c=relaxed/simple; bh=vCeNIrpSQnHAiIFw3AElk8d1M4LVBQRi4IODP++43PM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=urc6layU6acq3L/xT2Fa2X/w2KIcJMY/xeglvxQMV5SUfJ2PfQD1Kyw+L9FuKfpjMzLSID8oTmSnHnK31WlUuwHDBBgylyxuAGLqUqyGozk5FI3fUFvDdW4elQ3cjYVdffP/Pq0S6B9thnuZcue8Oay7YH9NGBnpYEEs7ZB95Mk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YQk1AOAy; arc=none smtp.client-ip=209.85.218.53 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="YQk1AOAy" Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-b884d4fb7dbso20523366b.2 for ; Sun, 25 Jan 2026 10:39:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769366376; x=1769971176; 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=ZSHN2Af/L95S4Os5yYFaV1hvvj2RmaOdeVqj+0nIWBY=; b=YQk1AOAyNCuHqk0gtGXiDfl2e7sGcAfmWWeqPlusPBAQfB2dx69hreg1iltdvNojI2 NKxpD2Pf74oZCcAM1S41bOHNdwHk+W2QYEUnJcOBtkdNdeUSP7uxZyZjo600yRIuPVnF XqShy29kCDwb6Eq4wmfY/d6o/lzxjPo6G2syHFrUY91kVydxEEvdqZ4mX+WIQ07AFQPn E+q3dugijTmMKgosXfpVZvh5lsPJwlROJ6qxs6dDMSJQKGpP5NpkAZoIzATwXf62p/vW 1l3G56yTENFk7V3NGJ4Di2YSG729H8absW611MYq6uZ9aTRsk2DH5XQfCtAfKYnsKBrH NMxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769366376; x=1769971176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZSHN2Af/L95S4Os5yYFaV1hvvj2RmaOdeVqj+0nIWBY=; b=Vg4ZcQULdmXV/i3hM9YI93ZiFIwQGp0x/IUy4rRLeix+fhu11ICfhXCerMqPjyU2YY o+U5Vr+/0JKmfHHs5iDpLXY6NEeNNIXRNwKFYsIdm0H+7s/VeKjKTKRcjgGZpebPLhQY l8OU1RUqEe+81Xl/h29eOrJlqLnQ1DTxpF5Bij0rrOoqyBMODCjHU+n0m8eGB5reG4fj tXeuyvPLm0+VAARUt4YLablnEk40tuZbxCPG7ncg5ONexr5lzkSUW9EZz2brRAVkKTLS cmkVtSxLUBRne2atjdIz8f/oihnFbfBgBtiP2bi4CSz/Q2sK1k6DkeZO8e3s9NqPhrBj DVkA== X-Forwarded-Encrypted: i=1; AJvYcCW1skahp/m9kuj7RzHY9GConZ/wMb4GYh84pm3olhPHcF5yYdm7cBitWLJsUsrQPC/sOmCKKmAagdaWgBI=@vger.kernel.org X-Gm-Message-State: AOJu0YyLNGzt2EnSvX8E2aciC2mqhIJoJgQkwo71ko5wRJz8bYOfqm0U lAIHwZ9qxvdlbzNpfM1gswnZR7NQQ7CtW0da70h5IuSmURuQNnqj8xNL X-Gm-Gg: AZuq6aJRwLWk3vof9rWMU5Oe4mFHx2hBwXoWko3g+PZkwdnHrFZCeGXZsRoLHNSkV25 MMB5MEDsLdraUaKC0+Hlrs14Cwlo/JF64cyH3M5siAWaPSduzwANMZbr5oqPTWNggfWE2oXv3gU exgHXIuPX/odk8kdL303W+zEqX5XquW3xjdTIDUkKhnDYwL6mRhe7dupE4N4EjBk0HQuOKkPiy4 yUUGHqhQjaaKOjShaoEVqo2IOAC+eEsMPG4DqiINCErAnjKoh0zy7VCyEzYO8ScNnsihIq51Vby MJ2NVzH7wutD68BZ97StlQvs1fmM6e1h38APNxs5BoMKJfjnhaU7I0YkFEVfwLJ1kBeakwRBjtF F0OEROdM77PHE0imYWo4Vi8ZHMRhqCkkrqfNctqSQPrdjQ4/lJPXGEy7tx8kgtwajG1yJa/Ft53 iLPC7ZhgSk8U/wQekNDp9/vx7NWGwTLoHcDaLQbY7gjwObuY5pGSw4ks6NdgozkpFweEWtTfMYD dI= X-Received: by 2002:a17:906:7955:b0:b87:515e:654a with SMTP id a640c23a62f3a-b8d2e8fb72emr80881766b.2.1769366375441; Sun, 25 Jan 2026 10:39:35 -0800 (PST) Received: from laptok.lan (87-205-5-123.static.ip.netia.com.pl. [87.205.5.123]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b885b3dad3asm499133766b.12.2026.01.25.10.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jan 2026 10:39:35 -0800 (PST) From: =?UTF-8?q?Tomasz=20Paku=C5=82a?= To: alexander.deucher@amd.com, harry.wentland@amd.com, sunpeng.li@amd.com Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, siqueira@igalia.com, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, tomasz.pakula.oficjalny@gmail.com, bernhard.berger@gmail.com, michel.daenzer@mailbox.org, daniel@fooishbar.org Subject: [PATCH v2 14/19] drm/amd/display: Restore ALLM support in HDMI vsif Date: Sun, 25 Jan 2026 19:39:09 +0100 Message-ID: <20260125183914.459228-15-tomasz.pakula.oficjalny@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260125183914.459228-1-tomasz.pakula.oficjalny@gmail.com> References: <20260125183914.459228-1-tomasz.pakula.oficjalny@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable [Why] Support for triggering ALLM in modern TVs is missing. When HDMI vsif was added in 2019: commit 3c2381b92cba ("drm/amd/display: add support for VSIP info packet") it was improperly handeled as HDMI actually has two separate vsifs. The implementation was based on H14b-vsif and ALLM bit was messing it up because H14b-vsif doesn't support ALLM. It was later removed in: commit 75f77aafe281 ("drm/amd/display: Send H14b-VSIF specified in HDMI") ALLM is supported by hf-vsif (HDMI Forum) instead. [How] Add proper logic to construct either h14b-vsif or hf-vsif based on required capabilities. Currently, only ALLM from hf-vsif is supported. Turns out, hf-vsif is almost identical to h14b-vsif, BUT has additional two bytes of data after OUI. First byte is static and seems like a version supported by leftover define. Second byte consists of 3D and ALLM bits. Implement logic to offset 3D data if building hf-vsif. Signed-off-by: Tomasz Paku=C5=82a --- .../display/modules/info_packet/info_packet.c | 112 ++++++++++++------ 1 file changed, 73 insertions(+), 39 deletions(-) diff --git a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c = b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c index 294f56d20062..1a1ddcdb4362 100644 --- a/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c +++ b/drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c @@ -49,7 +49,10 @@ enum vsc_packet_revision { }; =20 #define HDMI_INFOFRAME_TYPE_VENDOR 0x81 -#define HF_VSIF_VERSION 1 +#define HDMI_INFOFRAME_LENGTH_MASK 0x1F +#define HF_VSIF_VERSION 1 +#define HF_VSIF_3D_BIT 0 +#define HF_VSIF_ALLM_BIT 1 =20 // VTEM Byte Offset #define VTEM_PB0 0 @@ -496,9 +499,28 @@ void mod_build_vsc_infopacket(const struct dc_stream_s= tate *stream, } } =20 +static bool is_hdmi_vic_mode(const struct dc_stream_state *stream) +{ + bool allm =3D stream->link->local_sink->edid_caps.allm; + bool stereo =3D stream->view_format !=3D VIEW_3D_FORMAT_NONE; + + if (stream->timing.hdmi_vic =3D=3D 0) + return false; + + if (stream->timing.h_total < 3840 || + stream->timing.v_total < 2160) + return false; + + if (stereo || allm) + return false; + + return true; +} + /** * mod_build_hf_vsif_infopacket - Prepare HDMI Vendor Specific info frame. * Follows HDMI Spec to build up Vendor Sp= ecific info frame + * Conforms to h14b-vsif or hf-vsif based = on the capabilities * * @stream: contains data we may need to construct VSIF (i.e. timing= _3d_format, etc.) * @info_packet: output structure where to store VSIF @@ -506,63 +528,75 @@ void mod_build_vsc_infopacket(const struct dc_stream_= state *stream, void mod_build_hf_vsif_infopacket(const struct dc_stream_state *stream, struct dc_info_packet *info_packet) { - unsigned int length =3D 5; bool hdmi_vic_mode =3D false; + bool allm =3D false; + bool stereo =3D false; uint8_t checksum =3D 0; - uint32_t i =3D 0; + uint8_t offset =3D 0; + uint8_t i =3D 0; + uint8_t length =3D 5; + uint32_t oui =3D HDMI_IEEE_OUI; enum dc_timing_3d_format format; =20 info_packet->valid =3D false; + format =3D stream->timing.timing_3d_format; if (stream->view_format =3D=3D VIEW_3D_FORMAT_NONE) format =3D TIMING_3D_FORMAT_NONE; + stereo =3D format !=3D TIMING_3D_FORMAT_NONE; + hdmi_vic_mode =3D is_hdmi_vic_mode(stream); =20 - if (stream->timing.hdmi_vic !=3D 0 - && stream->timing.h_total >=3D 3840 - && stream->timing.v_total >=3D 2160 - && format =3D=3D TIMING_3D_FORMAT_NONE) - hdmi_vic_mode =3D true; - - if ((format =3D=3D TIMING_3D_FORMAT_NONE) && !hdmi_vic_mode) + if (!stereo && !hdmi_vic_mode && !allm) return; =20 - info_packet->sb[1] =3D 0x03; - info_packet->sb[2] =3D 0x0C; - info_packet->sb[3] =3D 0x00; + if (allm) + oui =3D HDMI_FORUM_IEEE_OUI; =20 - if (format !=3D TIMING_3D_FORMAT_NONE) - info_packet->sb[4] =3D (2 << 5); + info_packet->sb[1] =3D oui & 0xff; + info_packet->sb[2] =3D (oui >> 8) & 0xff; + info_packet->sb[3] =3D (oui >> 16) & 0xff; =20 - else if (hdmi_vic_mode) - info_packet->sb[4] =3D (1 << 5); - - switch (format) { - case TIMING_3D_FORMAT_HW_FRAME_PACKING: - case TIMING_3D_FORMAT_SW_FRAME_PACKING: - info_packet->sb[5] =3D (0x0 << 4); - break; - - case TIMING_3D_FORMAT_SIDE_BY_SIDE: - case TIMING_3D_FORMAT_SBS_SW_PACKED: - info_packet->sb[5] =3D (0x8 << 4); - length =3D 6; - break; - - case TIMING_3D_FORMAT_TOP_AND_BOTTOM: - case TIMING_3D_FORMAT_TB_SW_PACKED: - info_packet->sb[5] =3D (0x6 << 4); - break; - - default: - break; + if (oui =3D=3D HDMI_FORUM_IEEE_OUI) { + offset =3D 2; + length +=3D 2; + info_packet->sb[4] =3D HF_VSIF_VERSION; + info_packet->sb[5] =3D stereo << HF_VSIF_3D_BIT; + info_packet->sb[5] =3D allm << HF_VSIF_ALLM_BIT; } =20 - if (hdmi_vic_mode) + if (stereo) { + info_packet->sb[4 + offset] =3D (2 << 5); + + switch (format) { + case TIMING_3D_FORMAT_HW_FRAME_PACKING: + case TIMING_3D_FORMAT_SW_FRAME_PACKING: + info_packet->sb[5 + offset] =3D (0x0 << 4); + break; + + case TIMING_3D_FORMAT_SIDE_BY_SIDE: + case TIMING_3D_FORMAT_SBS_SW_PACKED: + info_packet->sb[5 + offset] =3D (0x8 << 4); + ++length; + break; + + case TIMING_3D_FORMAT_TOP_AND_BOTTOM: + case TIMING_3D_FORMAT_TB_SW_PACKED: + info_packet->sb[5 + offset] =3D (0x6 << 4); + break; + + default: + break; + } + + /* Doesn't need the offset as it can't be used with hf-vsif */ + } else if (hdmi_vic_mode) { + info_packet->sb[4] =3D (1 << 5); info_packet->sb[5] =3D stream->timing.hdmi_vic; + } =20 info_packet->hb0 =3D HDMI_INFOFRAME_TYPE_VENDOR; info_packet->hb1 =3D 0x01; - info_packet->hb2 =3D (uint8_t) (length); + info_packet->hb2 =3D length & HDMI_INFOFRAME_LENGTH_MASK; =20 checksum +=3D info_packet->hb0; checksum +=3D info_packet->hb1; --=20 2.52.0