[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241122-google-config-fs-v2-15-4b7e6f183320@bootlin.com>
Date: Fri, 22 Nov 2024 18:38:41 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Rodrigo Siqueira <rodrigosiqueiramelo@...il.com>,
Melissa Wen <melissa.srw@...il.com>,
MaĆra Canal <mairacanal@...eup.net>,
Haneen Mohammed <hamohammed.sa@...il.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Simona Vetter <simona.vetter@...ll.ch>
Cc: jose.exposito89@...il.com, dri-devel@...ts.freedesktop.org,
arthurgrillo@...eup.net, linux-kernel@...r.kernel.org,
jeremie.dautheribes@...tlin.com, miquel.raynal@...tlin.com,
thomas.petazzoni@...tlin.com, seanpaul@...gle.com, nicolejadeyee@...gle.com,
Louis Chauvet <louis.chauvet@...tlin.com>
Subject: [PATCH RFC v2 15/16] drm/vkms: Introduce configfs for connector
EDID
Due to limitation of ConfigFS, the max len of EDID is PAGE_SIZE (4kB on
x86), it should be sufficient for many tests. One possible evolution is
using a ConfigFS blob to allow bigger EDID.
The EDID can be changed at any time. As for physical display, you need
to trigger an HPD event to refresh the modes.
Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
---
drivers/gpu/drm/vkms/vkms_configfs.c | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/drivers/gpu/drm/vkms/vkms_configfs.c b/drivers/gpu/drm/vkms/vkms_configfs.c
index 45738707f1f6c11b561e695fe0aef245d946b418..55bd0b9a31d35eca49c67a2fe2d58e3ea84367a4 100644
--- a/drivers/gpu/drm/vkms/vkms_configfs.c
+++ b/drivers/gpu/drm/vkms/vkms_configfs.c
@@ -1024,6 +1024,37 @@ static ssize_t connector_status_store(struct config_item *item,
return count;
}
+static ssize_t connector_edid_show(struct config_item *item, char *page)
+{
+ struct vkms_config_connector *connector;
+ struct vkms_configfs_device *vkms_configfs = connector_child_item_to_vkms_configfs_device(item);
+
+ scoped_guard(mutex, &vkms_configfs->lock)
+ {
+ connector = connector_item_to_vkms_configfs_connector(item)->vkms_config_connector;
+ memcpy(page, &connector->edid_blob, connector->edid_blob_len);
+ return connector->edid_blob_len;
+ }
+
+ return -EINVAL;
+}
+
+static ssize_t connector_edid_store(struct config_item *item,
+ const char *page, size_t count)
+{
+ struct vkms_configfs_device *vkms_configfs = connector_child_item_to_vkms_configfs_device(item);
+
+ scoped_guard(mutex, &vkms_configfs->lock)
+ {
+ struct vkms_config_connector *connector =
+ connector_item_to_vkms_configfs_connector(item)->vkms_config_connector;
+ memcpy(&connector->edid_blob, page, count);
+ connector->edid_blob_len = count;
+ }
+
+ return count;
+}
+
static ssize_t connector_id_show(struct config_item *item, char *page)
{
struct vkms_configfs_device *vkms_configfs =
@@ -1043,12 +1074,14 @@ static ssize_t connector_id_show(struct config_item *item, char *page)
CONFIGFS_ATTR(connector_, type);
CONFIGFS_ATTR(connector_, status);
+CONFIGFS_ATTR(connector_, edid);
CONFIGFS_ATTR_RO(connector_, id);
static struct configfs_attribute *connector_attrs[] = {
&connector_attr_type,
&connector_attr_status,
&connector_attr_id,
+ &connector_attr_edid,
NULL,
};
--
2.47.0
Powered by blists - more mailing lists