Use the firmware interface to load binary EDID data from
a file and use them to assign monitor data to a video
connector. EDID data is located in the edid/ directory within
the existing firmware directories.
[apw@canonical.com: follow the changes to the sysfs interfaces]
[apw@canonical.com: fix the memory allocation so we use the real buffer]
[apw@canonical.com: add a firware prefix edid/ to limit what may be loaded]
Signed-off-by: Carsten Emde <C.Emde@osadl.org>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
---
drivers/gpu/drm/drm_crtc_helper.c | 7 ++++
drivers/gpu/drm/drm_edid.c | 5 +++
drivers/gpu/drm/drm_sysfs.c | 66 ++++++++++++++++++++++++++++++++++++-
include/drm/drm_crtc.h | 1 +
4 files changed, 78 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index d2619d7..8dd1680 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -94,6 +94,13 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]
", connector->base.id,
drm_get_connector_name(connector));
+
+ if (connector->edid_pinned) {
+ list_for_each_entry(mode, &connector->modes, head)
+ count++;
+ return count;
+ }
+
/* set all modes to the unverified state */
list_for_each_entry_safe(mode, t, &connector->modes, head)
mode->status = MODE_UNVERIFIED;
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index fb6c26c..1944fd5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -385,6 +385,11 @@ struct edid *drm_get_edid(struct drm_connector *connector,
{
struct edid *edid = NULL;