diff options
author | Jani Nikula <jani.nikula@intel.com> | 2013-09-27 14:08:27 +0200 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-10-01 02:31:01 +0200 |
commit | 51f8da5916f85c18b696f74f97970e5a7330147e (patch) | |
tree | dbda932b06e62425c2cdfc33a06040fac3de118d /drivers/gpu/drm/drm_edid.c | |
parent | drm/i915/dp: downstream port capabilities are not present in DPCD 1.0 (diff) | |
download | linux-51f8da5916f85c18b696f74f97970e5a7330147e.tar.xz linux-51f8da5916f85c18b696f74f97970e5a7330147e.zip |
drm/edid: add drm_edid_duplicate
We have some code duplication related to EDID duplication. Add a helper.
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r-- | drivers/gpu/drm/drm_edid.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 1688ff500513..3140a30aa818 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1264,6 +1264,18 @@ struct edid *drm_get_edid(struct drm_connector *connector, } EXPORT_SYMBOL(drm_get_edid); +/** + * drm_edid_duplicate - duplicate an EDID and the extensions + * @edid: EDID to duplicate + * + * Return duplicate edid or NULL on allocation failure. + */ +struct edid *drm_edid_duplicate(const struct edid *edid) +{ + return kmemdup(edid, (edid->extensions + 1) * EDID_LENGTH, GFP_KERNEL); +} +EXPORT_SYMBOL(drm_edid_duplicate); + /*** EDID parsing ***/ /** |