Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions drivers/gpu/drm/apple/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ static int parse_mode(struct dcp_parse_ctx *handle,
s64 id = -1;
s64 best_color_mode = -1;
bool is_virtual = false;
bool is_preferred = false;
struct drm_display_mode *mode = &out->mode;

dcp_parse_foreach_in_dict(handle, it) {
Expand All @@ -475,6 +476,8 @@ static int parse_mode(struct dcp_parse_ctx *handle,
ret = parse_int(it.handle, &id);
else if (!strcmp(key, "IsVirtual"))
ret = parse_bool(it.handle, &is_virtual);
else if (!strcmp(key, "IsPreferred"))
ret = parse_bool(it.handle, &is_preferred);
else if (!strcmp(key, "Score"))
ret = parse_int(it.handle, score);
else
Expand All @@ -488,6 +491,11 @@ static int parse_mode(struct dcp_parse_ctx *handle,
return ret;
}
}

if (is_preferred) {
*score |= (1L << 32);
}

if (out->sdr_rgb.score >= 0)
best_color_mode = out->sdr_rgb.id;
else if (out->sdr_444.score >= 0)
Expand Down