File tree Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Expand file tree Collapse file tree 1 file changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -3266,35 +3266,28 @@ const u8 *drm_find_edid_extension(const struct edid *edid,
3266
3266
3267
3267
static const u8 * drm_find_cea_extension (const struct edid * edid )
3268
3268
{
3269
- int length , idx ;
3270
3269
const struct displayid_block * block ;
3270
+ struct displayid_iter iter ;
3271
3271
const u8 * cea ;
3272
- const u8 * displayid ;
3273
- int ext_index ;
3272
+ int ext_index = 0 ;
3274
3273
3275
3274
/* Look for a top level CEA extension block */
3276
3275
/* FIXME: make callers iterate through multiple CEA ext blocks? */
3277
- ext_index = 0 ;
3278
3276
cea = drm_find_edid_extension (edid , CEA_EXT , & ext_index );
3279
3277
if (cea )
3280
3278
return cea ;
3281
3279
3282
3280
/* CEA blocks can also be found embedded in a DisplayID block */
3283
- ext_index = 0 ;
3284
- for (;;) {
3285
- displayid = drm_find_displayid_extension (edid , & length , & idx ,
3286
- & ext_index );
3287
- if (!displayid )
3288
- return NULL ;
3289
-
3290
- idx += sizeof (struct displayid_hdr );
3291
- for_each_displayid_db (displayid , block , idx , length ) {
3292
- if (block -> tag == DATA_BLOCK_CTA )
3293
- return (const u8 * )block ;
3281
+ displayid_iter_edid_begin (edid , & iter );
3282
+ displayid_iter_for_each (block , & iter ) {
3283
+ if (block -> tag == DATA_BLOCK_CTA ) {
3284
+ cea = (const u8 * )block ;
3285
+ break ;
3294
3286
}
3295
3287
}
3288
+ displayid_iter_end (& iter );
3296
3289
3297
- return NULL ;
3290
+ return cea ;
3298
3291
}
3299
3292
3300
3293
static __always_inline const struct drm_display_mode * cea_mode_for_vic (u8 vic )
You can’t perform that action at this time.
0 commit comments