[PATCH 00/11] drm/mgag200: Detect connector status

Thomas Zimmermann tzimmermann at suse.de
Wed Apr 3 09:24:37 UTC 2024


Detect the connector status by polling the DDC. Update the status at
runtime. Clean up a the driver's DDC code in the process.

Patches 1 and 2 fix long-standing problems in the DDC code.

Patches 3 to 9 refactor the DDC code. The code then keeps its data
structures internal, acquires locks automatically and it much more
readable overall.

With patches 10 and 11, mgag200 makes use of existing helpers for
reading and probing the DDC. It then correctly updates the status
and EDID at runtime.

Tested on various Matrox hardware.

Thomas Zimmermann (11):
  drm/mgag200: Set DDC timeout in milliseconds
  drm/mgag200: Bind I2C lifetime to DRM device
  drm/mgag200: Store pointer to struct mga_device in struct mga_i2c_chan
  drm/mgag200: Allocate instance of struct mga_i2c_chan dynamically
  drm/mgag200: Inline mgag200_i2c_init()
  drm/mgag200: Replace struct mga_i2c_chan with struct mgag200_ddc
  drm/mgag200: Rename mgag200_i2c.c to mgag200_ddc.c
  drm/mgag200: Rename struct i2c_algo_bit_data callbacks
  drm/mgag200: Acquire I/O-register lock in DDC code
  drm/mgag200: Use drm_connector_helper_get_modes()
  drm/mgag200: Set .detect_ctx() and enable connector polling

 drivers/gpu/drm/mgag200/Makefile          |   2 +-
 drivers/gpu/drm/mgag200/mgag200_ddc.c     | 179 ++++++++++++++++++++++
 drivers/gpu/drm/mgag200/mgag200_ddc.h     |  11 ++
 drivers/gpu/drm/mgag200/mgag200_drv.h     |  19 +--
 drivers/gpu/drm/mgag200/mgag200_g200.c    |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200eh.c  |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200eh3.c |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200er.c  |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200ev.c  |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200ew3.c |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200se.c  |  15 +-
 drivers/gpu/drm/mgag200/mgag200_g200wb.c  |  15 +-
 drivers/gpu/drm/mgag200/mgag200_i2c.c     | 129 ----------------
 drivers/gpu/drm/mgag200/mgag200_mode.c    |  27 +---
 14 files changed, 274 insertions(+), 213 deletions(-)
 create mode 100644 drivers/gpu/drm/mgag200/mgag200_ddc.c
 create mode 100644 drivers/gpu/drm/mgag200/mgag200_ddc.h
 delete mode 100644 drivers/gpu/drm/mgag200/mgag200_i2c.c

-- 
2.44.0



More information about the dri-devel mailing list