diff --git a/drivers/gpu/drm/apple/iomfb_template.c b/drivers/gpu/drm/apple/iomfb_template.c index 845e7e1d9a5cbd..a41db2949f48f8 100644 --- a/drivers/gpu/drm/apple/iomfb_template.c +++ b/drivers/gpu/drm/apple/iomfb_template.c @@ -739,8 +739,6 @@ static void dcp_swap_cleared(struct apple_dcp *dcp, void *data, void *cookie) return; } - /* TODO: Figure out how to clear surfaces for 14.x */ -#if DCP_FW_VER < DCP_FW_VERSION(14, 7, 0) while (!list_empty(&dcp->swapped_out_fbs)) { struct dcp_fb_reference *entry; entry = list_first_entry(&dcp->swapped_out_fbs, @@ -752,7 +750,6 @@ static void dcp_swap_cleared(struct apple_dcp *dcp, void *data, void *cookie) list_del(&entry->head); kfree(entry); } -#endif } static void dcp_swap_clear_started(struct apple_dcp *dcp, void *data, @@ -1153,8 +1150,6 @@ static void dcp_swapped(struct apple_dcp *dcp, void *data, void *cookie) } dcp->swap_start = ktime_get(); - /* TODO: Figure out how to clear surfaces on 14.x */ -#if DCP_FW_VER < DCP_FW_VERSION(14, 7, 0) while (!list_empty(&dcp->swapped_out_fbs)) { struct dcp_fb_reference *entry; entry = list_first_entry(&dcp->swapped_out_fbs, @@ -1166,7 +1161,6 @@ static void dcp_swapped(struct apple_dcp *dcp, void *data, void *cookie) list_del(&entry->head); kfree(entry); } -#endif } static void dcp_swap_started(struct apple_dcp *dcp, void *data, void *cookie) diff --git a/drivers/gpu/drm/apple/iomfb_template.h b/drivers/gpu/drm/apple/iomfb_template.h index f3f93c17a050f9..b07e85191f490d 100644 --- a/drivers/gpu/drm/apple/iomfb_template.h +++ b/drivers/gpu/drm/apple/iomfb_template.h @@ -112,6 +112,15 @@ struct DCP_FW_NAME(dcp_swap_submit_req) { u32 clear; // or maybe switch to default fb? #if DCP_FW_VER >= DCP_FW_VERSION(13, 2, 0) u32 unkU32Ptr; +#endif +#if DCP_FW_VER >= DCP_FW_VERSION(14, 7, 0) + /* + * The v14.7 extension precedes the pointer-null flags. macOS + * 14.8.3 A407 captures place swap_null at offset 0x1b4a; keeping + * this padding after the flags shifts them to the obsolete v13.x + * location at 0x1916 and prevents surface clears from taking effect. + */ + u8 padding_14_7[0x234]; #endif u8 swap_null; u8 surf_null[SWAP_SURFACES]; @@ -124,12 +133,6 @@ struct DCP_FW_NAME(dcp_swap_submit_req) { u8 unkU32out_null; #endif u8 padding[1]; -#if DCP_FW_VER >= DCP_FW_VERSION(14, 7, 0) - u8 padding_14_7[0x1e9]; - u8 unk_14_7_zero[0x46]; - u32 unk_14_7_u32; - u8 unk_bool; -#endif } __packed; struct DCP_FW_NAME(dcp_swap_submit_resp) {