linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Dariusz Marcinkiewicz <darekm@google.com>,
	linux-media@vger.kernel.org, hans.verkuil@cisco.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 1/3] media: cec: expose HDMI connector to CEC dev mapping
Date: Mon, 20 May 2019 12:50:40 +0200	[thread overview]
Message-ID: <3300cffd-62e7-7e2d-3c73-dc5fc7455c88@xs4all.nl> (raw)
In-Reply-To: <c0007b51-5e9f-4788-b860-d0623e21013b@xs4all.nl>

On 5/20/19 12:25 PM, Hans Verkuil wrote:
> Hi Dariusz,
> 
> On 5/17/19 5:42 PM, Dariusz Marcinkiewicz wrote:
>> This patch proposes to expose explicit mapping between HDMI connectors
>> and /dev/cecX adapters to userland.
>>
>> New structure with connector info (card number and connector id in case
>> of DRM connectors) is added to cec_adapter. That connector info is expected
>> to be provided when an adapter is created.
>>
>> CEC notifier is extended so that it can be used to communicate the
>> connector's info to CEC adapters' creators.
>>
>> New ioctl, exposing connector info to userland, is added to /dev/cec.
>>
>> Changes since v5:
>>  - make the patch apply against the latest changes in the affected code
>> Changes since v4:
>>  - small tweaks + added documentation
>> Changes since v3:
>>  - cec_get_connter_conn takes connector_info as argument
>> Changes since v2:
>>  - cec_s_connector_info removed, the connector info is now passed to
>>    cec_allocate_adapter
>>  - updated commit message
>> Changes since v1:
>>  - removed the unnecessary event,
>>  - extended cec_connctor_info to allow for various types of connectors.
>>
>> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
>> ---
>>  Documentation/media/kapi/cec-core.rst         |   7 +-
>>  Documentation/media/uapi/cec/cec-funcs.rst    |   1 +
>>  .../uapi/cec/cec-ioc-adap-g-conn-info.rst     | 109 ++++++++++++++++++
>>  .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   2 +-
>>  drivers/gpu/drm/bridge/adv7511/adv7511_cec.c  |   3 +-
>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c |   2 +-
>>  drivers/gpu/drm/drm_dp_cec.c                  |  22 ++--
>>  drivers/gpu/drm/i2c/tda9950.c                 |   3 +-
>>  drivers/gpu/drm/i915/intel_dp.c               |   4 +-
>>  drivers/gpu/drm/i915/intel_hdmi.c             |   6 +-
>>  drivers/gpu/drm/nouveau/nouveau_connector.c   |   3 +-
>>  drivers/gpu/drm/vc4/vc4_hdmi.c                |   8 +-
>>  drivers/media/cec/cec-adap.c                  |  13 +++
>>  drivers/media/cec/cec-api.c                   |  12 ++
>>  drivers/media/cec/cec-core.c                  |   8 +-
>>  drivers/media/cec/cec-notifier.c              |  20 +++-
>>  drivers/media/cec/cec-pin.c                   |   2 +-
>>  drivers/media/i2c/tc358743.c                  |   3 +-
>>  .../media/platform/cros-ec-cec/cros-ec-cec.c  |   7 +-
>>  drivers/media/platform/meson/ao-cec.c         |   6 +-
>>  drivers/media/platform/s5p-cec/s5p_cec.c      |   6 +-
>>  drivers/media/platform/seco-cec/seco-cec.c    |   8 +-
>>  drivers/media/platform/sti/cec/stih-cec.c     |   6 +-
>>  drivers/media/platform/stm32/stm32-cec.c      |   2 +-
>>  drivers/media/platform/tegra-cec/tegra_cec.c  |   5 +-
>>  drivers/media/platform/vivid/vivid-cec.c      |   2 +-
>>  drivers/media/usb/pulse8-cec/pulse8-cec.c     |   3 +-
>>  .../media/usb/rainshadow-cec/rainshadow-cec.c |   3 +-
>>  include/drm/drm_dp_helper.h                   |  14 +--
>>  include/media/cec-notifier.h                  |  34 ++++--
>>  include/media/cec.h                           |  16 ++-
>>  include/uapi/linux/cec.h                      |  24 ++++
>>  32 files changed, 310 insertions(+), 54 deletions(-)
>>  create mode 100644 Documentation/media/uapi/cec/cec-ioc-adap-g-conn-info.rst
>>
> 
> I've been doing some testing with my Khadas VIM2 board (amlogic SoC).
> 
> It's a bit unusual since it uses the Synopsys bridge, but not the Synopsys
> CEC driver (it has its own meson cec driver).
> 
> The first thing I noticed is that I did not get any connector info.
> I think that the root cause of that is that you forgot that there are
> several drm drivers that call cec_notifier_get() instead of cec_notifier_get_conn().
> 
> I think all those calls to cec_notifier_get() in drm drivers should be replaced
> by cec_notifier_get_conn() where the second argument is NULL, but the third argument
> should contain valid connector info.
> 
> A quick grep gives me the following drivers that need work:
> 
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> drivers/gpu/drm/exynos/exynos_hdmi.c
> drivers/gpu/drm/i2c/tda998x_drv.c
> drivers/gpu/drm/sti/sti_hdmi.c
> drivers/gpu/drm/tegra/output.c

You also missed updating drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c: the
cec_allocate_adapter call should be extended with the connector info.

You also missed these three v4l cec adapters:

drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c

Use NULL for the connector info for these three drivers.

Also note that in 5.2-rc1 a new meson cec driver was added, that should
be updated as well, similar to the existing meson cec driver.

Regards,

	Hans

> 
> The second thing I noticed is that patch 2 gave me a new kernel warning, but
> I'll do some more testing for that and reply to patch 2/3 once I know more.
> 
> Regards,
> 
> 	Hans
> 


  reply	other threads:[~2019-05-20 10:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 15:42 [PATCH v6 1/3] media: cec: expose HDMI connector to CEC dev mapping Dariusz Marcinkiewicz
2019-05-17 15:42 ` [PATCH v6 2/3] drm/bridge: dw-hdmi: pass connector info to the CEC adapter Dariusz Marcinkiewicz
2019-05-20 11:30   ` Hans Verkuil
2019-05-21 10:54     ` Dariusz Marcinkiewicz
2019-05-24  7:25       ` Hans Verkuil
2019-05-17 15:42 ` [PATCH v6 3/3] drm/i2c: tda9950: pass HDMI connector info to " Dariusz Marcinkiewicz
2019-05-20 10:25 ` [PATCH v6 1/3] media: cec: expose HDMI connector to CEC dev mapping Hans Verkuil
2019-05-20 10:50   ` Hans Verkuil [this message]
2019-05-21 11:02   ` Dariusz Marcinkiewicz

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=3300cffd-62e7-7e2d-3c73-dc5fc7455c88@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=darekm@google.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).