From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 D7AAE224F3 for ; Mon, 13 Jul 2026 18:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783967941; cv=none; b=SnttmFVDt7ntHtnCZ1JNxg6Vo9Clcy9mvI9GPy4k2wpanReRhPxU2aj1RsKL/4TUq/UyBi6tuaUIG3UlYueT2z/9hBE7VjtVu8FKJj8TsTWFx/6g0lNxPcNsgusBq/X5U95yrWXVxyxishzJkwbixg/wM5DKVwLijgUq+ae6VYw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783967941; c=relaxed/simple; bh=QtTlO0i8tXhmHPo9enxUQMJ3Wyc8Uplm6x4dKkOKIXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XHbyVleTJQNCiJKGsGt8DwaqSvVY3SzTmSt4fvcETP4BQJYxIrg3kEhv8Vr0IMvbXW2m4Dz5kgcnkRQ9BVKBdqHNWEqBGfO3bt+7oBV3qh48fkcIwDTjcmLK20M9d1u6c3c8Wchw6ESG47CG/N/Xsp1/XJ7pG2xLDIAnKOuCFEc= 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=EAfvX34M; arc=none smtp.client-ip=209.85.221.45 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="EAfvX34M" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4629051c9d1so104968f8f.2 for ; Mon, 13 Jul 2026 11:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783967938; x=1784572738; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=BZeraapBlFPUrYW3IPPqI51an2y6HYhJis8cCxDtDlM=; b=EAfvX34MtGH31iT/UsRwf5A6sVW3VmYWoe3ESCIk39WHa7vSSSsaaND2GtNP/OqkNj UYTxm7txYPDUrj8vGIO3LwOwpr6hYyoAk0m21fT+9/QPbX94NKmY3Nv12o1nM73/asiu Q10b/1vNIuVU8TWB3sqLyEQlw1AGytHRblyXjx49R1njez69LxhAjdyvWs4Hg5cRBS0l zFOQwn0NiYGMIWT3dNMPowR87eNsCd9m1LCDZltumoGqYHOTsbslUTt9LGB0c1vdDUsc PH/Ay6jdnIxxkXVQ6LsZy2YKdNNrkd2wgcyohHoOaNQUdJaZz/QgXOPjvTFGsWS+0Lq4 8QYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783967938; x=1784572738; h=content-transfer-encoding:content-type: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 :content-type; bh=BZeraapBlFPUrYW3IPPqI51an2y6HYhJis8cCxDtDlM=; b=EWW7gz+S1oRGeo7PvtgUgcEhYb6lWuxkrpqFmBgwbcJRidkJqMK6MqQdfIA0Pn4SSX sJmPlq9x1ciKJZJLXgFZlLV/IpifHXkBjm1xNFRWfsjTZvXqJ5vAxvqK5+CNvksmEKRH vS2Om6c8RMv0BmlanQZSoAWQzufENXMYrZYv3MSwR7TezucIHJTOGJ0FcyTF9C4NkWuw 8JaqUijFmaMUbKTAEEpiEIBK9UfDMOLWC+vWSuTlNXvXPdbBr3hJTjq6NeBi8edk/zV4 CBs5qOB+LUz41y/qD1HpWN+oJ8c4aPbYskY7O02ZJxQxCFMwODmNy6qp2m3JvJQNmc7j 3L2g== X-Forwarded-Encrypted: i=1; AHgh+Rp+5MBAf8hDaWwr+8rjis6sYpulverBrXHnnWqbKOZ3M9iM1hX169JXfk1Ps30UYbWDDVKFU1K8da1cyJY=@vger.kernel.org X-Gm-Message-State: AOJu0Yxi0gaLegYlxNqaWMPmziV31byf8j6T57ng5XJuzyPNwMl59uAT 60+AAD6XCKXv0Fn+qFoPQHhGYvyYVh75fPT3ICuyvkFGNYYZpHyYmK2r X-Gm-Gg: AfdE7ckJYoKt70VFxfaeKO6fNuCgCfLIUTask2QmC5gOqbCOXVFIu0yH+yRgoYOo56m xdo87HQOt5Wpq+go9QSUHP6FijVjmlwcu8KunhZFWsv9Dk6nMdpWcOx87/F6EfunnH9ywlggpc1 cy1SEaYnptnESvNwU1L0+Z9lgkk2rS0RuV37lmCjbZt323x+hvcEV7ZzUgbQ4ZMqjmKLylo2IKg 8yreGfdsyfuMehwskFcshWWftC4n1Lk9kkRIOlAyeeLSrT41r4vdRpKIOlOiNVC42Ne+hfpqXXJ yJ9aOAAhPenBMOzDxFNBZWxuzft71srR7mUBc61KUx+dTYkwYMH9XbW95QeE8qVJR9hCnNZLDzW QTAyomjA21KVxp4518cvouqK4BOuUJN5L3ebxBMk/2g4RBCsFQsiPMxLWMq9tlZyV5gtD6J7DWN oHVTH5YKriFWzvuhuPGeLLzsxdWeHC X-Received: by 2002:a05:600c:310f:b0:493:ee3a:f05b with SMTP id 5b1f17b1804b1-493f87d7fcdmr103793315e9.7.1783967937889; Mon, 13 Jul 2026 11:38:57 -0700 (PDT) Received: from timo-z13.fritz.box ([193.30.163.202]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49508727f7dsm14702455e9.4.2026.07.13.11.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 11:38:57 -0700 (PDT) From: =?UTF-8?q?Timo=20Pr=C3=B6mer?= To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Simona Vetter Cc: Rodrigo Siqueira , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Timo=20Pr=C3=B6mer?= Subject: [PATCH 1/2] drm/edid: Export drm_edid_block_count() Date: Mon, 13 Jul 2026 20:38:40 +0200 Message-ID: <20260713183841.5921-2-timo.proemer04@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260713183841.5921-1-timo.proemer04@gmail.com> References: <20260713183841.5921-1-timo.proemer04@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: 8bit Drivers currently calculating EDID size by reading the `extensions` field of the raw EDID structure (e.g., `edid->extensions + 1`) will calculate the wrong size if the EDID contains an HF-EEODB (HDMI Forum EDID Extension Override Data Block). The base extension flag does not account for these override blocks, leading to truncated EDIDs. Remove the static declaration and export drm_edid_block_count() so drivers can safely query the true block count. This allows drivers to leverage the core DRM's proper handling of HF-EEODB and other edge cases without having to parse the raw EDID fields themselves. Signed-off-by: Timo Prömer --- drivers/gpu/drm/drm_edid.c | 3 ++- include/drm/drm_edid.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index df3c25bac..34560b33a 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1698,12 +1698,13 @@ static int __drm_edid_block_count(const struct drm_edid *drm_edid) } /* EDID block count, limited by allocated size */ -static int drm_edid_block_count(const struct drm_edid *drm_edid) +int drm_edid_block_count(const struct drm_edid *drm_edid) { /* Limit by allocated size */ return min(__drm_edid_block_count(drm_edid), (int)drm_edid->size / EDID_LENGTH); } +EXPORT_SYMBOL(drm_edid_block_count); /* EDID extension block count, limited by allocated size */ static int drm_edid_extension_block_count(const struct drm_edid *drm_edid) diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 04f7a7f1f..4a990bf87 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -481,6 +481,7 @@ const struct drm_edid *drm_edid_read_switcheroo(struct drm_connector *connector, int drm_edid_connector_update(struct drm_connector *connector, const struct drm_edid *edid); int drm_edid_connector_add_modes(struct drm_connector *connector); +int drm_edid_block_count(const struct drm_edid *drm_edid); bool drm_edid_is_digital(const struct drm_edid *drm_edid); void drm_edid_get_product_id(const struct drm_edid *drm_edid, struct drm_edid_product_id *id); -- 2.55.0