Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpu: ipu-v3: ipu-dc: don't bug out on invalid bus_format

If imx-drm is combined with a bridge or panel that requests an
unsupported format, warn and use a default mapping instead of
hanging the machine. The worst that can happen here are wrong
colors.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

+3 -3
+3 -3
drivers/gpu/ipu-v3/ipu-dc.c
··· 150 150 static int ipu_bus_format_to_map(u32 fmt) 151 151 { 152 152 switch (fmt) { 153 + default: 154 + WARN_ON(1); 155 + /* fall-through */ 153 156 case MEDIA_BUS_FMT_RGB888_1X24: 154 157 return IPU_DC_MAP_RGB24; 155 158 case MEDIA_BUS_FMT_RGB565_1X16: ··· 165 162 return IPU_DC_MAP_LVDS666; 166 163 case MEDIA_BUS_FMT_BGR888_1X24: 167 164 return IPU_DC_MAP_BGR24; 168 - default: 169 - return -EINVAL; 170 165 } 171 166 } 172 167 ··· 179 178 dc->di = ipu_di_get_num(di); 180 179 181 180 map = ipu_bus_format_to_map(bus_format); 182 - BUG_ON(map < 0); 183 181 184 182 /* 185 183 * In interlaced mode we need more counters to create the asymmetric