Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/vkms: Allow to update the connector status

Implement the drm_connector_funcs.detect() callback to update the
connector status by returning the status stored in the configuration.

Tested-by: Mark Yacoub <markyacoub@google.com>
Reviewed-by: Louis Chauvet <louis.chauvet@bootlin.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: José Expósito <jose.exposito89@gmail.com>
Link: https://lore.kernel.org/r/20251016175618.10051-16-jose.exposito89@gmail.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

authored by

José Expósito and committed by
Luca Ceresoli
466f4388 6f00987f

+31
+28
drivers/gpu/drm/vkms/vkms_connector.c
··· 5 5 #include <drm/drm_managed.h> 6 6 #include <drm/drm_probe_helper.h> 7 7 8 + #include "vkms_config.h" 8 9 #include "vkms_connector.h" 9 10 11 + static enum drm_connector_status vkms_connector_detect(struct drm_connector *connector, 12 + bool force) 13 + { 14 + struct drm_device *dev = connector->dev; 15 + struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); 16 + struct vkms_connector *vkms_connector; 17 + enum drm_connector_status status; 18 + struct vkms_config_connector *connector_cfg; 19 + 20 + vkms_connector = drm_connector_to_vkms_connector(connector); 21 + 22 + /* 23 + * The connector configuration might not exist if its configfs directory 24 + * was deleted. Therefore, use the configuration if present or keep the 25 + * current status if we can not access it anymore. 26 + */ 27 + status = connector->status; 28 + 29 + vkms_config_for_each_connector(vkmsdev->config, connector_cfg) { 30 + if (connector_cfg->connector == vkms_connector) 31 + status = vkms_config_connector_get_status(connector_cfg); 32 + } 33 + 34 + return status; 35 + } 36 + 10 37 static const struct drm_connector_funcs vkms_connector_funcs = { 38 + .detect = vkms_connector_detect, 11 39 .fill_modes = drm_helper_probe_single_connector_modes, 12 40 .reset = drm_atomic_helper_connector_reset, 13 41 .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+3
drivers/gpu/drm/vkms/vkms_connector.h
··· 5 5 6 6 #include "vkms_drv.h" 7 7 8 + #define drm_connector_to_vkms_connector(target) \ 9 + container_of(target, struct vkms_connector, base) 10 + 8 11 /** 9 12 * struct vkms_connector - VKMS custom type wrapping around the DRM connector 10 13 *