Skip to content

Commit

Permalink
drm: apple: pasrser: Reject high refresh / resolution modes
Browse files Browse the repository at this point in the history
DSC setup seems to require extra steps. dcp reports itself a bandwith
limit of 926484480:
`IOMFB removing mode: 3840 x 2160 @ 119, bw: 987033600 max: 926484480`

Signed-off-by: Janne Grunau <j@jannau.net>
  • Loading branch information
jannau authored and marcan committed Nov 27, 2023
1 parent 7db5176 commit 741b581
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions drivers/gpu/drm/apple/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,20 @@ static int parse_mode(struct dcp_parse_ctx *handle,
(horiz.active == 3456 && vert.active == 2234)))
return -EINVAL;

/*
* HACK: reject refresh modes with a pixel clock above 926484,480 kHz
* (bandwidth limit reported by dcp). This allows 4k 100Hz and
* 5k 60Hz but not much beyond.
* DSC setup seems to require additional steps
*/
if (calculate_clock(&horiz, &vert) > 926484) {
pr_info("dcp: rejecting mode %lldx%lld@%lld.%03lld (pixel clk:%d)\n",
horiz.active, vert.active, vert.precise_sync_rate >> 16,
((1000 * vert.precise_sync_rate) >> 16) % 1000,
calculate_clock(&horiz, &vert));
return -EINVAL;
}

vert.active -= notch_height;
vert.sync_width += notch_height;

Expand Down

0 comments on commit 741b581

Please sign in to comment.