1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 21:11:34 +03:00
mobile-nixos/devices/motorola-addison/kernel/0003-Allow-building-qualcomm-mdss-without-CONFIG_DEBUG_FS.patch
Samuel Dionne-Riel 4c11bf2c50 motorola-addison: Reduce size of the kernel
The patches added here are required to build under some conditions, but
not all are ended up needed as CONFIG_DEBUG_FS is required to be active
otherwise the kernel doesn't even boot :/

The kernel size was reduced by:

 * Removing tracing support
 * Removing unneeded exfat and sdcardfs filesystems
 * Removing all sound support
 * Removing video input (camera) support

The latter options seem awfully shortsighted, until you remember that a goal is
to eventually deal with booting our own kernels through kexec.

The Moto Z Play device's boot partition size is putting us in a hard
spot.
2019-12-04 17:39:46 -05:00

144 lines
4.9 KiB
Diff

From 83f926eaf84c62c3e7a479a10a8fcf5847ae3bac Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date: Wed, 4 Dec 2019 02:58:15 -0500
Subject: [PATCH 3/6] Allow building qualcomm mdss without CONFIG_DEBUG_FS
---
drivers/video/msm/mdss/mdss_debug.h | 5 -----
drivers/video/msm/mdss/mdss_debug_xlog.c | 4 ++++
drivers/video/msm/mdss/mdss_mdp_debug.c | 2 ++
drivers/video/msm/mdss/mdss_mdp_overlay.c | 6 ++++++
drivers/video/msm/mdss/mdss_smmu.c | 2 ++
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/video/msm/mdss/mdss_debug.h b/drivers/video/msm/mdss/mdss_debug.h
index dad43ca56678..f41d22f6d18f 100644
--- a/drivers/video/msm/mdss/mdss_debug.h
+++ b/drivers/video/msm/mdss/mdss_debug.h
@@ -227,11 +227,6 @@ static inline void mdss_xlog(const char *name, int line, int flag, ...) { }
static inline void mdss_dsi_debug_check_te(struct mdss_panel_data *pdata) { }
static inline void mdss_xlog_tout_handler_default(bool is_mmi, bool queue,
const char *name, ...) { }
-u32 get_dump_range(struct dump_offset *range_node, size_t max_offset)
- { return 0; }
-void mdss_dump_reg(const char *dump_name, u32 reg_dump_flag, char *addr,
- int len, u32 **dump_mem, phys_addr_t *regs_phys, bool from_isr) { }
-void mdss_mdp_debug_mid(u32 mid) { }
#endif
int mdss_dump_misr_data(char **buf, u32 size);
diff --git a/drivers/video/msm/mdss/mdss_debug_xlog.c b/drivers/video/msm/mdss/mdss_debug_xlog.c
index ab4fe9c0b6f2..a74f0485b6bb 100644
--- a/drivers/video/msm/mdss/mdss_debug_xlog.c
+++ b/drivers/video/msm/mdss/mdss_debug_xlog.c
@@ -227,6 +227,7 @@ static void mdss_xlog_dump_all(void)
mdss_dbg_xlog.xlog_user_buf[off] = '\0';
}
+#ifdef CONFIG_DEBUG_FS
u32 get_dump_range(struct dump_offset *range_node, size_t max_offset)
{
u32 length = 0;
@@ -241,6 +242,7 @@ u32 get_dump_range(struct dump_offset *range_node, size_t max_offset)
return length;
}
+#endif
static void mdss_dump_debug_bus(u32 bus_dump_flag,
u32 **dump_mem)
@@ -427,6 +429,7 @@ static void mdss_dump_vbif_debug_bus(u32 bus_dump_flag,
pr_info("========End VBIF Debug bus=========\n");
}
+#ifdef CONFIG_DEBUG_FS
void mdss_dump_reg(const char *dump_name, u32 reg_dump_flag,
char *addr, int len, u32 **dump_mem, phys_addr_t *regs_phys, bool from_isr)
{
@@ -492,6 +495,7 @@ void mdss_dump_reg(const char *dump_name, u32 reg_dump_flag,
if (!from_isr)
mdss_mdp_clk_ctrl(MDP_BLOCK_POWER_OFF);
}
+#endif
static void mdss_dump_reg_by_ranges(struct mdss_debug_base *dbg,
u32 reg_dump_flag)
diff --git a/drivers/video/msm/mdss/mdss_mdp_debug.c b/drivers/video/msm/mdss/mdss_mdp_debug.c
index 0a91925b1249..2fa1338fffef 100644
--- a/drivers/video/msm/mdss/mdss_mdp_debug.c
+++ b/drivers/video/msm/mdss/mdss_mdp_debug.c
@@ -971,6 +971,7 @@ void mdss_mdp_hw_rev_debug_caps_init(struct mdss_data_type *mdata)
}
}
+#ifdef CONFIG_DEBUG_FS
void mdss_mdp_debug_mid(u32 mid)
{
struct mdss_data_type *mdata = mdss_mdp_get_mdata();
@@ -1002,6 +1003,7 @@ void mdss_mdp_debug_mid(u32 mid)
}
}
}
+#endif
static void __print_time(char *buf, u32 size, u64 ts)
{
diff --git a/drivers/video/msm/mdss/mdss_mdp_overlay.c b/drivers/video/msm/mdss/mdss_mdp_overlay.c
index b8c43596cdee..8e07fc5e74a0 100644
--- a/drivers/video/msm/mdss/mdss_mdp_overlay.c
+++ b/drivers/video/msm/mdss/mdss_mdp_overlay.c
@@ -4426,6 +4426,7 @@ static ssize_t mdss_mdp_cmd_autorefresh_store(struct device *dev,
}
+#ifdef CONFIG_DEBUG_FS
/* Print the last CRC Value read for batch mode */
static ssize_t mdss_mdp_misr_show(struct device *dev,
struct device_attribute *attr, char *buf)
@@ -4450,6 +4451,7 @@ static ssize_t mdss_mdp_misr_show(struct device *dev,
return ret;
}
+#endif
/*
* Enable crc batch mode. By enabling this mode through sysfs
@@ -4529,8 +4531,10 @@ static ssize_t mdss_mdp_misr_store(struct device *dev,
return len;
}
+#ifdef CONFIG_DEBUG_FS
static DEVICE_ATTR(msm_misr_en, S_IRUGO | S_IWUSR,
mdss_mdp_misr_show, mdss_mdp_misr_store);
+#endif
static DEVICE_ATTR(msm_cmd_autorefresh_en, S_IRUGO | S_IWUSR,
mdss_mdp_cmd_autorefresh_show, mdss_mdp_cmd_autorefresh_store);
static DEVICE_ATTR(vsync_event, S_IRUGO, mdss_mdp_vsync_show_event, NULL);
@@ -4552,7 +4556,9 @@ static struct attribute *mdp_overlay_sysfs_attrs[] = {
&dev_attr_lineptr_value.attr,
&dev_attr_ad.attr,
&dev_attr_dyn_pu.attr,
+#ifdef CONFIG_DEBUG_FS
&dev_attr_msm_misr_en.attr,
+#endif
&dev_attr_msm_cmd_autorefresh_en.attr,
&dev_attr_hist_event.attr,
&dev_attr_bl_event.attr,
diff --git a/drivers/video/msm/mdss/mdss_smmu.c b/drivers/video/msm/mdss/mdss_smmu.c
index e0d0579009a1..a0d9c64fbc6c 100644
--- a/drivers/video/msm/mdss/mdss_smmu.c
+++ b/drivers/video/msm/mdss/mdss_smmu.c
@@ -463,7 +463,9 @@ int mdss_smmu_fault_handler(struct iommu_domain *domain, struct device *dev,
if (i == MDSS_IOMMU_MAX_DOMAIN)
goto end;
+#ifdef CONFIG_DEBUG_FS
mdss_mdp_debug_mid(mid);
+#endif
end:
return -ENOSYS;
}
--
2.23.0