From 82d2fa611e5b6642cfc243c396ccb5668b07b792 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 28 Aug 2025 11:56:06 +0200 Subject: [PATCH 1/4] spmi: apple: Add "apple,t8103-spmi" compatible After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,spmi" anymore [1]. Use "apple,t8103-spmi" as base compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/ Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/spmi/spmi-apple-controller.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spmi/spmi-apple-controller.c b/drivers/spmi/spmi-apple-controller.c index 697b3e8bb02356..87e3ee9d4f2aa5 100644 --- a/drivers/spmi/spmi-apple-controller.c +++ b/drivers/spmi/spmi-apple-controller.c @@ -149,6 +149,7 @@ static int apple_spmi_probe(struct platform_device *pdev) } static const struct of_device_id apple_spmi_match_table[] = { + { .compatible = "apple,t8103-spmi", }, { .compatible = "apple,spmi", }, {} }; From 6bd91698704fa25249c2861c460045e81f8db35f Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 28 Aug 2025 12:19:02 +0200 Subject: [PATCH 2/4] watchdog: apple: Add "apple,t8103-wdt" compatible After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,wdt" anymore [1]. Use "apple,t8103-wdt" as base compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/ Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/watchdog/apple_wdt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/apple_wdt.c b/drivers/watchdog/apple_wdt.c index 66a158f67a712b..6b9b0f9b05cedf 100644 --- a/drivers/watchdog/apple_wdt.c +++ b/drivers/watchdog/apple_wdt.c @@ -218,6 +218,7 @@ static int apple_wdt_suspend(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(apple_wdt_pm_ops, apple_wdt_suspend, apple_wdt_resume); static const struct of_device_id apple_wdt_of_match[] = { + { .compatible = "apple,t8103-wdt" }, { .compatible = "apple,wdt" }, {}, }; From 19313d50a324d8ca25105a543d04d56637a63772 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Thu, 28 Aug 2025 12:29:15 +0200 Subject: [PATCH 3/4] clk: clk-apple-nco: Add "apple,t8103-nco" compatible After discussion with the devicetree maintainers we agreed to not extend lists with the generic compatible "apple,nco" anymore [1]. Use "apple,t8103-nco" as base compatible as it is the SoC the driver and bindings were written for. [1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/ Reviewed-by: Neal Gompa Signed-off-by: Janne Grunau --- drivers/clk/clk-apple-nco.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/clk-apple-nco.c b/drivers/clk/clk-apple-nco.c index d3ced4a0f029ec..434c067968bbc1 100644 --- a/drivers/clk/clk-apple-nco.c +++ b/drivers/clk/clk-apple-nco.c @@ -320,6 +320,7 @@ static int applnco_probe(struct platform_device *pdev) } static const struct of_device_id applnco_ids[] = { + { .compatible = "apple,t8103-nco" }, { .compatible = "apple,nco" }, { } }; From d14c2b6809237f8fae9d2bde4fa43d9a3556f342 Mon Sep 17 00:00:00 2001 From: Oliver Bestmann Date: Sun, 1 Feb 2026 16:26:35 +0100 Subject: [PATCH 4/4] drm/apple: support interchange compression Signed-off-by: Oliver Bestmann --- drivers/gpu/drm/apple/iomfb_plane.h | 23 +++++++++++++++++-- drivers/gpu/drm/apple/plane.c | 34 +++++++++++++++++++++++++++++ include/uapi/drm/drm_fourcc.h | 1 + 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/apple/iomfb_plane.h b/drivers/gpu/drm/apple/iomfb_plane.h index 0701978200311a..4f8837df84c4c4 100644 --- a/drivers/gpu/drm/apple/iomfb_plane.h +++ b/drivers/gpu/drm/apple/iomfb_plane.h @@ -67,7 +67,26 @@ struct dcp_plane_info { u16 tile_size; u8 tile_w; u8 tile_h; - u32 unk[13]; + u8 unk1[0xd]; + u8 address_format; + u8 unk2[0x26]; +} __packed; + +struct dcp_compression_info { + u32 tile_w; + u32 tile_h; + u32 meta_offset; + u32 data_offset; + u32 tile_meta_bytes; + u32 tiles_w; + u32 tiles_h; + u32 unk1; + u32 compresson_type; + u32 unk3; + u8 _pad1[3]; + u32 tile_bytes; + u32 row_stride; + u8 pad2; } __packed; struct dcp_component_types { @@ -100,7 +119,7 @@ struct dcp_surface { u64 has_comp; struct dcp_plane_info planes[DCP_SURF_MAX_PLANES]; u64 has_planes; - u32 compression_info[DCP_SURF_MAX_PLANES][13]; + struct dcp_compression_info compression_info[DCP_SURF_MAX_PLANES]; u64 has_compr_info; u32 unk_num; u32 unk_denom; diff --git a/drivers/gpu/drm/apple/plane.c b/drivers/gpu/drm/apple/plane.c index 2f0b76ad84ad65..c66e13457f1d12 100644 --- a/drivers/gpu/drm/apple/plane.c +++ b/drivers/gpu/drm/apple/plane.c @@ -7,6 +7,8 @@ #include "iomfb_internal.h" +#include "iomfb_plane.h" +#include "linux/align.h" #include #include #include @@ -257,8 +259,12 @@ static void apple_plane_atomic_update(struct drm_plane *plane, .pel_h = 1, .has_comp = 1, .has_planes = 1, + .has_compr_info = 1, }; + BUILD_BUG_ON(sizeof(struct dcp_plane_info) != 0x50); + BUILD_BUG_ON(sizeof(struct dcp_compression_info) != 0x34); + /* Populate plane information for planar formats */ struct dcp_surface *surf = &new_state->surf; for (int i = 0; fb->format->num_planes && i < fb->format->num_planes; i++) { @@ -279,6 +285,33 @@ static void apple_plane_atomic_update(struct drm_plane *plane, .tile_h = bh, }; + if (fb->modifier == DRM_FORMAT_MOD_APPLE_INTERCHANGE_COMPRESSED) { + const u32 gpu_page_size = 0x4000; + + u32 tw = ALIGN(width, 16) / 16; + u32 th = ALIGN(height, 16) / 16; + u32 tsize_B = 16 * 16 * 4; + + surf->planes[i].tile_w = 16; + surf->planes[i].tile_h = 16; + surf->planes[i].stride = tw * tsize_B; + surf->planes[i].tile_size = tsize_B; + surf->planes[i].address_format = 5; + + surf->compression_info[i] = (struct dcp_compression_info) { + .tile_w = 16, + .tile_h = 16, + .data_offset = 0, + .meta_offset = ALIGN(tw * th * tsize_B, gpu_page_size), + .tile_meta_bytes = 8, + .tiles_w = tw, + .tiles_h = th, + .tile_bytes = tsize_B, + .row_stride = tw * tsize_B, + .compresson_type = 3, + }; + } + if (i > 0) surf->buf_size += surf->planes[i].size; } @@ -426,6 +459,7 @@ static const u32 dcp_overlay_formats_12_x[] = { }; u64 apple_format_modifiers[] = { + DRM_FORMAT_MOD_APPLE_INTERCHANGE_COMPRESSED, DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_MOD_INVALID }; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index e527b24bd824b1..fe4ffdc42bd08d 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -1599,6 +1599,7 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) */ #define DRM_FORMAT_MOD_APPLE_GPU_TILED fourcc_mod_code(APPLE, 1) #define DRM_FORMAT_MOD_APPLE_GPU_TILED_COMPRESSED fourcc_mod_code(APPLE, 2) +#define DRM_FORMAT_MOD_APPLE_INTERCHANGE_COMPRESSED fourcc_mod_code(APPLE, 3) /* * AMD modifiers