All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Hans Verkuil" <hverkuil+cisco@kernel.org>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCHv3 10/13] media: uapi: cec.h: add CEC_EVENT_FL_STATE_HPD_PRESENT flag
Date: Thu, 05 Nov 2026 07:35:42 +0000	[thread overview]
Message-ID: <sashiko-outbox-198683@kernel.org> (raw)
In-Reply-To: <81a832c5568748e37f081d217998f80880ab8dc4.1793863347.git.hverkuil+cisco@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] media: cec: unimplemented and undocumented CEC_EVENT_FL_STATE_HPD_PRESENT flag
--

commit 6f18f1544823dafcf8a17b474c711348256f2340
Author: Hans Verkuil <hverkuil+cisco@kernel.org>

media: uapi: cec.h: add CEC_EVENT_FL_STATE_HPD_PRESENT flag

This commit adds the CEC_EVENT_FL_STATE_HPD_PRESENT flag to
include/uapi/linux/cec.h to report whether HPD is present.

> diff --git a/include/uapi/linux/cec.h b/include/uapi/linux/cec.h
> index fdfc97a6e4ec0..d9300a6010806 100644
> --- a/include/uapi/linux/cec.h
> +++ b/include/uapi/linux/cec.h
> @@ -453,6 +453,7 @@ struct cec_connector_info {
>  
>  #define CEC_EVENT_FL_INITIAL_STATE	(1 << 0)
>  #define CEC_EVENT_FL_DROPPED_EVENTS	(1 << 1)
> +#define CEC_EVENT_FL_STATE_HPD_PRESENT	(1 << 2)

[Severity: Medium]
The commit message states that CEC_EVENT_FL_STATE_HPD_PRESENT will report
whether HPD is present or not, but nothing in the kernel ever sets or
references this flag.

When userspace dequeues CEC_EVENT_STATE_CHANGE events via CEC_DQEVENT, the
events are populated in cec_post_state_event() in
drivers/media/cec/core/cec-adap.c:

	struct cec_event ev = {
		.event = CEC_EVENT_STATE_CHANGE,
	};

and on device open in cec_open() in drivers/media/cec/core/cec-api.c:

	struct cec_event ev = {
		.event = CEC_EVENT_STATE_CHANGE,
		.flags = CEC_EVENT_FL_INITIAL_STATE,
	};

Neither path sets CEC_EVENT_FL_STATE_HPD_PRESENT in ev.flags, so any
application checking ev.flags & CEC_EVENT_FL_STATE_HPD_PRESENT will always
observe 0.

In addition, Documentation/userspace-api/media/cec/cec-ioc-dqevent.rst
(under the CEC Event Flags table) and include/uapi/linux/cec.h do not
document CEC_EVENT_FL_STATE_HPD_PRESENT or specify which CEC_EVENT_* types
carry it.

Finally, without a corresponding capability flag or tri-state indicator
(unlike struct cec_event_state_change.have_conn_info, which is gated by
CEC_CAP_CONNECTOR_INFO), how can userspace distinguish between HPD being
low, a CEC driver that does not report HPD state, and an older kernel that
predates CEC_EVENT_FL_STATE_HPD_PRESENT? Should this UAPI definition be
held back until an in-kernel user, documentation, and capability signaling
are included?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/81a832c5568748e37f081d217998f80880ab8dc4.1793863347.git.hverkuil+cisco@kernel.org?part=1

  reply	other threads:[~2026-11-05  7:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  7:22 [PATCHv3 00/13] media/drm: cec: add HPD_PRESENT Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 01/13] gpu: drm: sti: call cec_notifier_phys_addr_invalidate if no HPD Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 02/13] gpu: drm: exynos: " Hans Verkuil
2026-11-05  7:28   ` Krzysztof Kozlowski
2026-11-05  7:22 ` [PATCHv3 03/13] gpu: drm: omapdrm: call cec_s_phys_addr only if HPD is present Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 04/13] media: i2c: adv7511-v4l2: call cec_s_phys_addr only if HPD is high Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 05/13] media: cec: extron-da-hd-4k-plus: " Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 06/13] media: cec: core: improve cec_notifier_phys_addr_invalidate Hans Verkuil
2026-11-05  7:43   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 07/13] media: uapi: cec.h: add CEC_CAP_HAS_HPD_PRESENT/CEC_LOG_ADDRS_FL_HPD_PRESENT Hans Verkuil
2026-11-05  7:34   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 08/13] Documentation: media: document HPD_PRESENT cap and flag Hans Verkuil
2026-11-05  7:34   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 09/13] media: cec: core: add support for HPD_PRESENT Hans Verkuil
2026-11-05  7:39   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 10/13] media: uapi: cec.h: add CEC_EVENT_FL_STATE_HPD_PRESENT flag Hans Verkuil
2026-11-05  7:35   ` sashiko-bot [this message]
2026-11-05  7:22 ` [PATCHv3 11/13] Documentation: media: cec-ioc-dqevent.rst: document STATE_HPD_PRESENT flag Hans Verkuil
2026-11-05  7:22 ` [PATCHv3 12/13] media: cec: core: implement CEC_EVENT_FL_STATE_HPD_PRESENT Hans Verkuil
2026-11-05  7:39   ` sashiko-bot
2026-11-05  7:22 ` [PATCHv3 13/13] Documentation: media: document cec_phys_addr_invalidate Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-198683@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hverkuil+cisco@kernel.org \
    --cc=media-ci@linuxtv.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.