Skip to content

Commit 741b581

Browse files
jannaumarcan
authored andcommitted
drm: apple: pasrser: Reject high refresh / resolution modes
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 <[email protected]>
1 parent 7db5176 commit 741b581

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/gpu/drm/apple/parser.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,20 @@ static int parse_mode(struct dcp_parse_ctx *handle,
475475
(horiz.active == 3456 && vert.active == 2234)))
476476
return -EINVAL;
477477

478+
/*
479+
* HACK: reject refresh modes with a pixel clock above 926484,480 kHz
480+
* (bandwidth limit reported by dcp). This allows 4k 100Hz and
481+
* 5k 60Hz but not much beyond.
482+
* DSC setup seems to require additional steps
483+
*/
484+
if (calculate_clock(&horiz, &vert) > 926484) {
485+
pr_info("dcp: rejecting mode %lldx%lld@%lld.%03lld (pixel clk:%d)\n",
486+
horiz.active, vert.active, vert.precise_sync_rate >> 16,
487+
((1000 * vert.precise_sync_rate) >> 16) % 1000,
488+
calculate_clock(&horiz, &vert));
489+
return -EINVAL;
490+
}
491+
478492
vert.active -= notch_height;
479493
vert.sync_width += notch_height;
480494

0 commit comments

Comments
 (0)