drm/edid: make drm_edid_header_is_valid() accept void pointer

It will be useful to accept a struct edid *, but for compatibility with
existing usage accept void *.

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/33fbe1615a3bd82112eaf4077bbb521793cbb91a.1648752228.git.jani.nikula@intel.com
This commit is contained in:
Jani Nikula 2022-03-31 21:45:01 +03:00
parent 4ba0f53ce6
commit 6d987ddd68
2 changed files with 6 additions and 4 deletions

View file

@ -1580,13 +1580,15 @@ static const u8 edid_header[] = {
*
* Return: 8 if the header is perfect, down to 0 if it's totally wrong.
*/
int drm_edid_header_is_valid(const u8 *raw_edid)
int drm_edid_header_is_valid(const void *_edid)
{
const struct edid *edid = _edid;
int i, score = 0;
for (i = 0; i < sizeof(edid_header); i++)
if (raw_edid[i] == edid_header[i])
for (i = 0; i < sizeof(edid_header); i++) {
if (edid->header[i] == edid_header[i])
score++;
}
return score;
}

View file

@ -578,7 +578,7 @@ int drm_add_modes_noedid(struct drm_connector *connector,
void drm_set_preferred_mode(struct drm_connector *connector,
int hpref, int vpref);
int drm_edid_header_is_valid(const u8 *raw_edid);
int drm_edid_header_is_valid(const void *edid);
bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid,
bool *edid_corrupt);
bool drm_edid_is_valid(struct edid *edid);