OSDN Git Service

drm/edid: Remove idx==1 assumptions from all over the DispID parsing
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 13 Mar 2020 16:20:48 +0000 (18:20 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 18 Mar 2020 15:52:36 +0000 (17:52 +0200)
commit3688118404add838a4c0e136f9609413dd61f8af
tree220ab2781d8d09c3d3202545f8ee4991f43cecfc
parentbf5e4a863ae0785239ba61a8cbb4d81e35e4732f
drm/edid: Remove idx==1 assumptions from all over the DispID parsing

The fact that the DispID starts at byte offset 1 is due to
the DispID coming from and EDID extension block (the first byte
being the extesion block tag). Instead of hadrdocoding that idx==1
assumptions all over let's just have drm_find_displayid_extension()
return it since it actually knows what it's talking about.

If at some point someone comes across a DispID which is not embedded
inside an EDID the function that returns the new type of DispID
can return it's own byte offset without having to updated all the
code.

TODO: should probably just get rid of that idx thing altogether
      and just return the thing we want directly.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200313162054.16009-4-ville.syrjala@linux.intel.com
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/drm_edid.c