summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2022-03-31 20:45:03 +0200
committerJani Nikula <jani.nikula@intel.com>2022-04-01 16:44:40 +0200
commit0a612bbd91bc35391c4b0dac3b6d2200f70f7196 (patch)
tree766ba81937e24ae6c3b8fa73412c7d8725af4815 /drivers/gpu/drm/drm_edid.c
parentdrm/edid: clean up edid_is_zero() (diff)
downloadlinux-0a612bbd91bc35391c4b0dac3b6d2200f70f7196.tar.xz
linux-0a612bbd91bc35391c4b0dac3b6d2200f70f7196.zip
drm/edid: split out edid_header_fix()
Give a name to the EDID header fixup instead of having an inline memcpy. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> 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/c10c24b179e942548cd5d693d159bb0d12be4d26.1648752228.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index f49e5f3c2782..bfa3bbb017c7 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1572,6 +1572,11 @@ static const u8 edid_header[] = {
0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
};
+static void edid_header_fix(void *edid)
+{
+ memcpy(edid, edid_header, sizeof(edid_header));
+}
+
/**
* drm_edid_header_is_valid - sanity check the header of the base EDID block
* @raw_edid: pointer to raw base EDID block
@@ -1702,7 +1707,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
if (edid_corrupt)
*edid_corrupt = true;
DRM_DEBUG("Fixing EDID header, your hardware may be failing\n");
- memcpy(raw_edid, edid_header, sizeof(edid_header));
+ edid_header_fix(raw_edid);
} else {
if (edid_corrupt)
*edid_corrupt = true;