summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2021-03-29 16:37:16 +0300
committerJani Nikula <jani.nikula@intel.com>2021-03-31 15:41:35 +0300
commit4cc4f09eaa06178bfa8a5b2c753cefb56e1048c8 (patch)
tree63391ab1cfe560c8c14ca9ab8e64eb55485e8008 /drivers/gpu/drm/drm_edid.c
parent43d16d847eba1469b5579b6515413b4caa07885c (diff)
drm/displayid: add separate drm_displayid.c
We'll be adding more DisplayID specific functions going forward, so start off by splitting out a few functions to a separate file. We don't bother with exporting the functions; at least for now they should be needed solely within drm.ko. No functional changes. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/07942d5011891b8e8f77245c78b34f4af97a9315.1617024940.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c58
1 files changed, 2 insertions, 56 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d510b827a1f8..58e61f792bc7 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1585,8 +1585,6 @@ module_param_named(edid_fixup, edid_fixup, int, 0400);
MODULE_PARM_DESC(edid_fixup,
"Minimum number of valid EDID header bytes (0-8, default 6)");
-static int validate_displayid(const u8 *displayid, int length, int idx);
-
static int drm_edid_block_checksum(const u8 *raw_edid)
{
int i;
@@ -3241,8 +3239,8 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
/*
* Search EDID for CEA extension block.
*/
-static const u8 *drm_find_edid_extension(const struct edid *edid,
- int ext_id, int *ext_index)
+const u8 *drm_find_edid_extension(const struct edid *edid,
+ int ext_id, int *ext_index)
{
const u8 *edid_ext = NULL;
int i;
@@ -3266,32 +3264,6 @@ static const u8 *drm_find_edid_extension(const struct edid *edid,
return edid_ext;
}
-
-static const u8 *drm_find_displayid_extension(const struct edid *edid,
- int *length, int *idx,
- int *ext_index)
-{
- const u8 *displayid = drm_find_edid_extension(edid, DISPLAYID_EXT, ext_index);
- const struct displayid_hdr *base;
- int ret;
-
- if (!displayid)
- return NULL;
-
- /* EDID extensions block checksum isn't for us */
- *length = EDID_LENGTH - 1;
- *idx = 1;
-
- ret = validate_displayid(displayid, *length, *idx);
- if (ret)
- return NULL;
-
- base = (const struct displayid_hdr *)&displayid[*idx];
- *length = *idx + sizeof(*base) + base->bytes;
-
- return displayid;
-}
-
static const u8 *drm_find_cea_extension(const struct edid *edid)
{
int length, idx;
@@ -5287,32 +5259,6 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi
return quirks;
}
-static int validate_displayid(const u8 *displayid, int length, int idx)
-{
- int i, dispid_length;
- u8 csum = 0;
- const struct displayid_hdr *base;
-
- base = (const struct displayid_hdr *)&displayid[idx];
-
- DRM_DEBUG_KMS("base revision 0x%x, length %d, %d %d\n",
- base->rev, base->bytes, base->prod_id, base->ext_count);
-
- /* +1 for DispID checksum */
- dispid_length = sizeof(*base) + base->bytes + 1;
- if (dispid_length > length - idx)
- return -EINVAL;
-
- for (i = 0; i < dispid_length; i++)
- csum += displayid[idx + i];
- if (csum) {
- DRM_NOTE("DisplayID checksum invalid, remainder is %d\n", csum);
- return -EINVAL;
- }
-
- return 0;
-}
-
static struct drm_display_mode *drm_mode_displayid_detailed(struct drm_device *dev,
struct displayid_detailed_timings_1 *timings)
{