Skip to content

Commit b8c3d52

Browse files
jannaumarcan
authored andcommitted
drm/apple: Add support for the macOS 13.2 DCP firmware
This adds support for multiple incompatible DCP firmware versions. The approach taken here duplicates more than necessary. Unmodified calls do not need to be templated. For simplicity and in the expectation that more calls and callbacks are modified in the future everything is templated. Signed-off-by: Janne Grunau <[email protected]>
1 parent 924b666 commit b8c3d52

13 files changed

Lines changed: 2023 additions & 1496 deletions

drivers/gpu/drm/apple/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ CFLAGS_trace.o = -I$(src)
55
appledrm-y := apple_drv.o
66

77
apple_dcp-y := dcp.o dcp_backlight.o iomfb.o parser.o
8+
apple_dcp-y += iomfb_v12_3.o
9+
apple_dcp-y += iomfb_v13_2.o
810
apple_dcp-$(CONFIG_TRACING) += trace.o
911

1012
apple_piodma-y := dummy-piodma.o

drivers/gpu/drm/apple/dcp-internal.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <linux/scatterlist.h>
1212

1313
#include "iomfb.h"
14+
#include "iomfb_v12_3.h"
15+
#include "iomfb_v13_2.h"
1416

1517
#define DCP_MAX_PLANES 2
1618

@@ -19,6 +21,7 @@ struct apple_dcp;
1921
enum dcp_firmware_version {
2022
DCP_FIRMWARE_UNKNOWN,
2123
DCP_FIRMWARE_V_12_3,
24+
DCP_FIRMWARE_V_13_2,
2225
};
2326

2427
enum {
@@ -134,11 +137,17 @@ struct apple_dcp {
134137
struct dcp_channel ch_cmd, ch_oobcmd;
135138
struct dcp_channel ch_cb, ch_oobcb, ch_async;
136139

140+
/* iomfb EP callback handlers */
141+
const iomfb_cb_handler *cb_handlers;
142+
137143
/* Active chunked transfer. There can only be one at a time. */
138144
struct dcp_chunks chunks;
139145

140146
/* Queued swap. Owned by the DCP to avoid per-swap memory allocation */
141-
struct dcp_swap_submit_req swap;
147+
union {
148+
struct dcp_swap_submit_req_v12_3 v12_3;
149+
struct dcp_swap_submit_req_v13_2 v13_2;
150+
} swap;
142151

143152
/* Current display mode */
144153
bool valid_mode;

drivers/gpu/drm/apple/dcp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ static enum dcp_firmware_version dcp_check_firmware_version(struct device *dev)
404404

405405
if (strncmp(compat_str, "12.3.0", sizeof(compat_str)) == 0)
406406
return DCP_FIRMWARE_V_12_3;
407+
if (strncmp(compat_str, "13.2.0", sizeof(compat_str)) == 0)
408+
return DCP_FIRMWARE_V_13_2;
407409

408410
dev_err(dev, "DCP firmware-compat %s (FW: %s) is not supported\n",
409411
compat_str, fw_str);

0 commit comments

Comments
 (0)