linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv9 00/13] cec: improve notifier support, add connector info
@ 2019-06-25 14:44 Hans Verkuil
  2019-06-25 14:44 ` [PATCHv9 01/13] cec-notifier: rename variables, check kstrdup and n->conn_name Hans Verkuil
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Hans Verkuil @ 2019-06-25 14:44 UTC (permalink / raw)
  To: linux-media; +Cc: Dariusz Marcinkiewicz, dri-devel, Cheng-yi Chiang

This is a rework of Dariusz' v7 series:

https://www.spinics.net/lists/linux-media/msg151117.html

Rather than changing the existing CEC kAPI to allocate and
register CEC adapters I left it as-is. Instead new notifiers
functions are added to (un)register HDMI connector and CEC adapter
notifiers. These replace the current cec_notifier_get_conn and _put
functions.

For drivers that don't use notifiers the cec_s_conn_info function
was created so the connector info can be set directly as well.

This split in separate connector and CEC adapter functions is needed
since the notifier information is different between the two and this
makes it future proof since we will need to eventually support more
than one CEC adapter per HDMI connector.

By carefully designing these functions it is possible to convert
drivers to these new functions one-by-one, rather than as a painful
big-bang patch.

The plan is to merge the first three patches for kernel 5.3: these
patches provide the infrastructure needed by drm and cec drivers
to do the conversion during the 5.4 cycle, without requiring
patches that touch on multiple subsystems.

Once the conversion is done the new connector API can be exposed.

Various drivers have been converted as well as an example. These
are based on Dariusz' original series, but using the new notifier
functions.

Regards,

	Hans

Changes since v8:

- Complete the documentation patch (now documents the new capability
  and the new field in the state changed event)
- Take a lock in cec_adap_g_connector_info
- cec-notifier: dropped 'called_cec_notifier_register', use 'callback'
  instead.
- cec_notifier_cec_adap_unregister: don't memset adap->conn_info, it's
  not necessary.
- seco-cec: include cec-notifier instead of relying on cec.h to include
  it, since that's no longer the case.
- Move cec_notifier_register, cec_notifier_unregister and
  cec_register_cec_notifier to cec.h. This avoids sparse/smatch warnings.
- Improve cec_(drm_)connector_info docbook comments.
- CEC_CAP_CONNECTOR_INFO is now defined as (1 << 8) instead of 0, but is
  removed from the cap set in cec_adapter_allocate while this API remains
  internal.

Dariusz Marcinkiewicz (9):
  cec: add struct cec_connector_info support
  cec: expose the new connector info API
  drm_dp_cec: add connector info support.
  drm/i915/intel_hdmi: use cec_notifier_conn_(un)register
  dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
  dw-hdmi: use cec_notifier_conn_(un)register
  tda9950: use cec_notifier_cec_adap_(un)register
  tda998x: use cec_notifier_conn_(un)register
  drm/vc4/vc4_hdmi: fill in connector info

Hans Verkuil (4):
  cec-notifier: rename variables, check kstrdup and n->conn_name
  cec-notifier: add new notifier functions
  cec: document CEC_ADAP_G_CONNECTOR_INFO and capability
  meson/ao-cec: use cec_notifier_cec_adap_(un)register

 Documentation/media/uapi/cec/cec-funcs.rst    |   1 +
 .../media/uapi/cec/cec-ioc-adap-g-caps.rst    |   6 +-
 .../uapi/cec/cec-ioc-adap-g-conn-info.rst     | 102 ++++++++++++++++
 .../media/uapi/cec/cec-ioc-dqevent.rst        |   8 ++
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   2 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c |   9 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     | 104 +++++++++-------
 drivers/gpu/drm/drm_dp_cec.c                  |  25 ++--
 drivers/gpu/drm/i2c/tda9950.c                 |  11 +-
 drivers/gpu/drm/i2c/tda998x_drv.c             |  56 ++++-----
 drivers/gpu/drm/i915/intel_dp.c               |   4 +-
 drivers/gpu/drm/i915/intel_hdmi.c             |  13 +-
 drivers/gpu/drm/nouveau/nouveau_connector.c   |   3 +-
 drivers/gpu/drm/vc4/vc4_hdmi.c                |  13 +-
 drivers/media/cec/cec-adap.c                  |  31 +++++
 drivers/media/cec/cec-api.c                   |  20 ++++
 drivers/media/cec/cec-notifier.c              | 112 ++++++++++++++++--
 drivers/media/platform/meson/ao-cec.c         |  37 +++---
 drivers/media/platform/seco-cec/seco-cec.c    |   2 +-
 include/drm/drm_dp_helper.h                   |  14 +--
 include/media/cec-notifier.h                  | 105 ++++++++++------
 include/media/cec.h                           |  67 ++++++++++-
 include/uapi/linux/cec.h                      |  40 +++++++
 23 files changed, 606 insertions(+), 179 deletions(-)
 create mode 100644 Documentation/media/uapi/cec/cec-ioc-adap-g-conn-info.rst

-- 
2.20.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-06-25 15:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-25 14:44 [PATCHv9 00/13] cec: improve notifier support, add connector info Hans Verkuil
2019-06-25 14:44 ` [PATCHv9 01/13] cec-notifier: rename variables, check kstrdup and n->conn_name Hans Verkuil
2019-06-25 14:44 ` [PATCHv9 02/13] cec: add struct cec_connector_info support Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 03/13] cec-notifier: add new notifier functions Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 04/13] cec: expose the new connector info API Hans Verkuil
2019-06-25 14:58   ` Dariusz Marcinkiewicz
2019-06-25 15:27     ` Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 05/13] cec: document CEC_ADAP_G_CONNECTOR_INFO and capability Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 06/13] drm_dp_cec: add connector info support Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 07/13] drm/i915/intel_hdmi: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 08/13] dw-hdmi-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 09/13] dw-hdmi: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 10/13] meson/ao-cec: use cec_notifier_cec_adap_(un)register Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 11/13] tda9950: " Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 12/13] tda998x: use cec_notifier_conn_(un)register Hans Verkuil
2019-06-25 14:45 ` [PATCHv9 13/13] drm/vc4/vc4_hdmi: fill in connector info Hans Verkuil

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).