summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_debugfs.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-06-29 12:27:49 +0300
committerJani Nikula <jani.nikula@intel.com>2022-06-30 10:50:59 +0300
commit6aa145bc943d34bf05f2bc24ea3aa36d70470f1d (patch)
treeec9eaa127c9151879a744876038efc471464e102 /drivers/gpu/drm/drm_debugfs.c
parentf999b37eefd7f1d59bece1d94fa0dbee2f2d62d6 (diff)
downloadlwn-6aa145bc943d34bf05f2bc24ea3aa36d70470f1d.tar.gz
lwn-6aa145bc943d34bf05f2bc24ea3aa36d70470f1d.zip
drm/edid: abstract debugfs override EDID set/reset
Add functions drm_edid_override_set() and drm_edid_override_reset() to support "edid_override" connector debugfs, and to hide the details about it in drm_edid.c. No functional changes at this time. Also note in the connector.override_edid flag kernel-doc that this is only supposed to be modified by the code doing debugfs EDID override handling. Currently, it is still being modified by amdgpu in create_eml_sink() and handle_edid_mgmt() for reasons unknown. This was added in commit 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") and later moved to amdgpu_dm.c in commit e7b07ceef2a6 ("drm/amd/display: Merge amdgpu_dm_types and amdgpu_dm"). Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/8f6b4001630cafac5f44aa5913429ac9979743d2.1656494768.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_debugfs.c')
-rw-r--r--drivers/gpu/drm/drm_debugfs.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index fb04b7a984de..493922069c90 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -350,31 +350,20 @@ static ssize_t edid_write(struct file *file, const char __user *ubuf,
struct seq_file *m = file->private_data;
struct drm_connector *connector = m->private;
char *buf;
- struct edid *edid;
int ret;
buf = memdup_user(ubuf, len);
if (IS_ERR(buf))
return PTR_ERR(buf);
- edid = (struct edid *) buf;
-
- if (len == 5 && !strncmp(buf, "reset", 5)) {
- connector->override_edid = false;
- ret = drm_connector_update_edid_property(connector, NULL);
- } else if (len < EDID_LENGTH ||
- EDID_LENGTH * (1 + edid->extensions) > len)
- ret = -EINVAL;
- else {
- connector->override_edid = false;
- ret = drm_connector_update_edid_property(connector, edid);
- if (!ret)
- connector->override_edid = true;
- }
+ if (len == 5 && !strncmp(buf, "reset", 5))
+ ret = drm_edid_override_reset(connector);
+ else
+ ret = drm_edid_override_set(connector, buf, len);
kfree(buf);
- return (ret) ? ret : len;
+ return ret ? ret : len;
}
/*