drm/ast: Acquire I/O-register lock in DDC code
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 25 Mar 2024 20:06:55 +0000 (21:06 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 2 Apr 2024 08:40:50 +0000 (10:40 +0200)
commitdfff99cb56904087e35dbecec3d482aa8a95436a
treeafa318acbee868bcd2bd51c2a8080e2e53de8953
parent660ed6ba8f62faab67c0d5c615de82e1a65a4d3f
drm/ast: Acquire I/O-register lock in DDC code

The modeset lock protects the DDC code from concurrent modeset
operations, which use the same registers. Move that code from the
connector helpers into the DDC helpers .pre_xfer() and .post_xfer().

Both, .pre_xfer() and .post_xfer(), enclose the transfer of data blocks
over the I2C channel in the internal I2C function bit_xfer(). Both
calls are executed unconditionally if present. Invoking DDC transfers
from any where within the driver now takes the lock.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Tested-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Link: https://patchwork.freedesktop.org/patch/msgid/20240325200855.21150-11-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_ddc.c
drivers/gpu/drm/ast/ast_mode.c