Skip to content

Commit cd4a189

Browse files
jannaumarcan
authored andcommitted
drm: apple: afk: Adapt to macOS 13.3 firmware
Signed-off-by: Janne Grunau <j@jannau.net>
1 parent ab69434 commit cd4a189

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

drivers/gpu/drm/apple/afk.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ static void afk_recv_handle(struct apple_dcp_afkep *ep, u32 channel, u32 type,
493493
service = afk_epic_find_service(ep, channel);
494494

495495
if (!service) {
496-
if (type != EPIC_TYPE_NOTIFY) {
496+
if (type != EPIC_TYPE_NOTIFY && type != EPIC_TYPE_REPLY) {
497497
dev_err(ep->dcp->dev,
498498
"AFK[ep:%02x]: expected notify but got 0x%x on channel %d\n",
499499
ep->endpoint, type, channel);
@@ -805,12 +805,15 @@ int afk_send_epic(struct apple_dcp_afkep *ep, u32 channel, u16 tag,
805805
eshdr = ep->txbfr.buf + wptr;
806806
memset(eshdr, 0, sizeof(*eshdr));
807807
eshdr->length = cpu_to_le32(payload_len);
808-
eshdr->version = 3;
808+
eshdr->version = 4;
809809
eshdr->category = ecat;
810810
eshdr->type = cpu_to_le16(stype);
811811
eshdr->timestamp = cpu_to_le64(0);
812812
eshdr->tag = cpu_to_le16(tag);
813-
eshdr->inline_len = cpu_to_le16(0);
813+
if (ecat == EPIC_CAT_REPLY)
814+
eshdr->inline_len = cpu_to_le16(payload_len - 4);
815+
else
816+
eshdr->inline_len = cpu_to_le16(0);
814817
wptr += sizeof(*eshdr);
815818

816819
memcpy(ep->txbfr.buf + wptr, payload, payload_len);

drivers/gpu/drm/apple/afk.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ struct epic_cmd {
106106
__le64 txbuf;
107107
__le32 rxlen;
108108
__le32 txlen;
109+
u8 rxcookie;
110+
u8 txcookie;
109111
} __attribute__((packed));
110112

111113
struct epic_service_call {

0 commit comments

Comments
 (0)