summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2016-07-06 11:06:18 +0200
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-07-12 18:26:05 +0200
commitb575b31387f64f63019c88a0ddbf1e0cc0cd8cd9 (patch)
tree427adc3374ccb4460fa2a6d2fe81ec3a8b04a417 /drivers/gpu
parent4f7a5129134148ad917be5c4164a42823056a9f3 (diff)
downloadtalos-obmc-linux-b575b31387f64f63019c88a0ddbf1e0cc0cd8cd9.tar.gz
talos-obmc-linux-b575b31387f64f63019c88a0ddbf1e0cc0cd8cd9.zip
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/ipu-v3/ipu-dc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-dc.c b/drivers/gpu/ipu-v3/ipu-dc.c
index cd72dadb0fd7..659475c1e44a 100644
--- a/drivers/gpu/ipu-v3/ipu-dc.c
+++ b/drivers/gpu/ipu-v3/ipu-dc.c
@@ -150,6 +150,9 @@ static void dc_write_tmpl(struct ipu_dc *dc, int word, u32 opcode, u32 operand,
static int ipu_bus_format_to_map(u32 fmt)
{
switch (fmt) {
+ default:
+ WARN_ON(1);
+ /* fall-through */
case MEDIA_BUS_FMT_RGB888_1X24:
return IPU_DC_MAP_RGB24;
case MEDIA_BUS_FMT_RGB565_1X16:
@@ -162,8 +165,6 @@ static int ipu_bus_format_to_map(u32 fmt)
return IPU_DC_MAP_LVDS666;
case MEDIA_BUS_FMT_BGR888_1X24:
return IPU_DC_MAP_BGR24;
- default:
- return -EINVAL;
}
}
@@ -178,7 +179,6 @@ int ipu_dc_init_sync(struct ipu_dc *dc, struct ipu_di *di, bool interlaced,
dc->di = ipu_di_get_num(di);
map = ipu_bus_format_to_map(bus_format);
- BUG_ON(map < 0);
/*
* In interlaced mode we need more counters to create the asymmetric
OpenPOWER on IntegriCloud