mbox series

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

Message ID 20240403093114.22163-1-tzimmermann@suse.de (mailing list archive)
Headers show
Series drm/mgag200: Detect connector status | expand

Message

Thomas Zimmermann April 3, 2024, 9:24 a.m. UTC
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

Comments

Jocelyn Falempe April 8, 2024, 10:36 a.m. UTC | #1
Hi Thomas,

I've tested this series on my Dell T310, and it works well, when I 
plug/unplug the VGA screen, it's reflected in /sys/class/drm/.../status

I've also tested it remotely on a Dell R640, which doesn't have a VGA 
monitor connected.

After the patch, on the iDrac console, I only get a green screen saying:

"Out of Range
Reason: Video Capture Failure
Detected Resolution: 0x768
Detected Color Depth-1bpp"

and the file:
/sys/class/drm/card0-VGA-1/modes
is empty

Before the patch, the driver reports VGA as connected, and modes 
contains 1024x768 and others.

I think we may need to add a virtual connector for BMC, like I've done 
for AST ?
So that when no VGA monitor is available, you can still choose an 
appropriate resolution.

Best regards,
Thomas Zimmermann April 8, 2024, 11:06 a.m. UTC | #2
Hi

Am 08.04.24 um 12:36 schrieb Jocelyn Falempe:
> Hi Thomas,
>
> I've tested this series on my Dell T310, and it works well, when I 
> plug/unplug the VGA screen, it's reflected in /sys/class/drm/.../status
>
> I've also tested it remotely on a Dell R640, which doesn't have a VGA 
> monitor connected.
>
> After the patch, on the iDrac console, I only get a green screen saying:
>
> "Out of Range
> Reason: Video Capture Failure
> Detected Resolution: 0x768
> Detected Color Depth-1bpp"
>
> and the file:
> /sys/class/drm/card0-VGA-1/modes
> is empty
>
> Before the patch, the driver reports VGA as connected, and modes 
> contains 1024x768 and others.
>
> I think we may need to add a virtual connector for BMC, like I've done 
> for AST ?
> So that when no VGA monitor is available, you can still choose an 
> appropriate resolution.

Argh, I feared that would be the case. I'll submit another update that 
will contain the BMC support.

Best regards
Thomas


>
> Best regards,
>