Commit graph

21 commits

Author SHA1 Message Date
Janne Grunau
32431d8ba1 WIP: dcp/dptx: Add support for dcp endpoint dptx
Supposedly required for HDMI out initilization on M2 (Pro)? Mac minis.
2023-03-31 17:46:30 +02:00
Janne Grunau
c8c0bd5dc5 display: Check if FB IOVA is available on dart-disp0
Fixes a copy and paste error in 1b5dee2496 checking dart-dcp twice.

Fixes: 1b5dee2496 ("display: Map the framebuffer if it is not mapped")
Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
4e7398e3a8 display: Start scanning for fb IOVA at vm-base
Required for M2 devices as the M2 Mac mini.

Signed-off-by: Janne Grunau <j@jannau.net>
2023-02-02 09:50:33 +09:00
Janne Grunau
f1664ccef4 dart: Add DART_PTR_ERR to indicate failures for IOVA returning functions
0 is a valid and used device virtual address. Daart functions returning
device address can not use 0 to indicate errors.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-10-23 17:21:26 +09:00
Hector Martin
b1f9d72554 hv: Don't touch DCP on laptops
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-28 01:47:02 +09:00
Hector Martin
17abe8f94b display: Report time spent modesetting
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-01 02:03:32 +09:00
Hector Martin
714420a694 display: Put DCP to sleep if display is external
This stops DCP from killing our modeset if the connection cycles.

Also force a (potential) configure cycle if the display is external;
this makes sure updated stage2s will have a chance at fixing issues of
old stage1s. Modesetting is fast when it's the same mode as before.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-01 01:54:11 +09:00
Hector Martin
09013da441 display: Don't crash if shutdown is called twice
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-01 00:57:17 +09:00
Janne Grunau
8147c2d374 display: Add 'retina' flag to display_parse_mode
Signed-off-by: Janne Grunau <j@jannau.net>
2022-05-30 23:01:01 +09:00
Janne Grunau
7f4347ebe8 display: Reallocate framebuffer if required for wanted display mode
If an explicitly specified display mode exceeds the allocated
framebuffer allocate a new one from the top of RAM.

Note: macOS panics immediately with a realloced framebuffer.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-05-30 23:01:01 +09:00
Janne Grunau
079659dfea display: Move dcp iboot swap into its own function
Signed-off-by: Janne Grunau <j@jannau.net>
2022-05-30 23:01:01 +09:00
Janne Grunau
c577e94d75 display: limit timing modes by framebuffer size
The reserved framebuffer on the Mac Studio is 0x854000 bytes. This is
too small for 1920x1200 with 4 byte per pixel. Setting 1920x1200 as
mode crashes dcp but not the actual display controller. The display
remains working and even comes back after display hotplug/power cycle.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-05-30 23:01:01 +09:00
Janne Grunau
1b5dee2496 display: Map the framebuffer if it is not mapped
iboot on Mac Studio (M1 Ultra) does not map the framebuffer("/vram")
for dcp and disp0.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-04-19 21:29:30 +09:00
Hector Martin
1d19e74ca8 display: Implement mode selection
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-27 17:57:37 +09:00
Hector Martin
ebf1cf3aa3 display: Reinit FB if resolution changed 2022-03-27 17:02:00 +09:00
Hector Martin
3248c91aef display: Allow forcing re-config via payload (WIP)
Doesn't actually let you specify a mode yet.

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-27 16:46:53 +09:00
Hector Martin
8af401ade1 display: Also prefer <4K modes in the vertical dimension
Apparently 2:1 scaled modes like 1920x2160 are a thing?

Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-27 16:08:39 +09:00
Hector Martin
5531b9ae32 display: statify local functions
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-22 00:54:17 +09:00
Hector Martin
d1dcf16c66 display: Update boot args in place for HV guests
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-02-21 16:03:23 +09:00
Janne Grunau
b2cb605832 display: Retry dcp_ib_get_hpd() for up to 2 seconds
After boot DCP will need some time to detect connected displays.

Signed-off-by: Janne Grunau <j@jannau.net>
2022-01-17 23:12:49 +09:00
Hector Martin
1c2a2db1dd display: Add logic to initialize the Mac Mini HDMI display
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-17 04:42:00 +09:00