Skip to content

Commit bda3f27

Browse files
CertainLach1Naim
authored andcommitted
drm/edid: for consistency, use mask everywhere for block rev parsing
Other usages of block.rev bitfields were refactored to use FIELD_GET instead of bitwise ops. Signed-off-by: Yaroslav Bolyukin <iam@lach.pw> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent 68b5610 commit bda3f27

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/gpu/drm/drm_displayid_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ struct displayid_formula_timings_9 {
139139
u8 vrefresh;
140140
} __packed;
141141

142+
#define DISPLAYID_BLOCK_DESCRIPTOR_PAYLOAD_BYTES GENMASK(6, 4)
142143
struct displayid_formula_timing_block {
143144
struct displayid_block base;
144145
struct displayid_formula_timings_9 timings[];

drivers/gpu/drm/drm_edid.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6908,7 +6908,8 @@ static int add_displayid_formula_modes(struct drm_connector *connector,
69086908
struct drm_display_mode *newmode;
69096909
int num_modes = 0;
69106910
bool type_10 = block->tag == DATA_BLOCK_2_TYPE_10_FORMULA_TIMING;
6911-
int timing_size = 6 + ((formula_block->base.rev & 0x70) >> 4);
6911+
int timing_size = 6 +
6912+
FIELD_GET(DISPLAYID_BLOCK_DESCRIPTOR_PAYLOAD_BYTES, formula_block->base.rev);
69126913

69136914
/* extended blocks are not supported yet */
69146915
if (timing_size != 6)

0 commit comments

Comments
 (0)