* [PATCH] omap2 dss: omap_display_init: Dont allow more than the maximum number of displays.
@ 2013-06-10 7:57 Andreas Naumann
2013-06-12 6:05 ` Tomi Valkeinen
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Naumann @ 2013-06-10 7:57 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, Andreas Naumann
Currently the maximum number of display is hardcoded in the array omapfb2_device. Made the number a #define and check it in init routine.
Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
---
Our board supports a lot of panels and we could probably solve this more effectively, but arrays shouldnt silently overflow when using more than 10 displays. Created the patch on 3.1 and tested it there. This one is rebased on todays linux-omap.git
arch/arm/mach-omap2/display.c | 5 +++++
drivers/video/omap2/omapfb/omapfb.h | 10 +++++-----
include/video/omapdss.h | 2 ++
3 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index ff37be1..6f1a147 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -338,6 +338,11 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
return -ENODEV;
}
+ if( board_data->num_devices > OMAPFB_MAX_DISPLAY_NUM ){
+ pr_err("Trying to init more displays(%d) than possible.(%d)\n", board_data->num_devices, OMAPFB_MAX_DISPLAY_NUM);
+ return -ENODEV;
+ }
+
board_data->version = ver;
board_data->dsi_enable_pads = omap_dsi_enable_pads;
board_data->dsi_disable_pads = omap_dsi_disable_pads;
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 623cd87..00d3fbc 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -96,15 +96,15 @@ struct omapfb2_device {
int state;
unsigned num_fbs;
- struct fb_info *fbs[10];
- struct omapfb2_mem_region regions[10];
+ struct fb_info *fbs[OMAPFB_MAX_DISPLAY_NUM];
+ struct omapfb2_mem_region regions[OMAPFB_MAX_DISPLAY_NUM];
unsigned num_displays;
- struct omapfb_display_data displays[10];
+ struct omapfb_display_data displays[OMAPFB_MAX_DISPLAY_NUM];
unsigned num_overlays;
- struct omap_overlay *overlays[10];
+ struct omap_overlay *overlays[OMAPFB_MAX_DISPLAY_NUM];
unsigned num_managers;
- struct omap_overlay_manager *managers[10];
+ struct omap_overlay_manager *managers[OMAPFB_MAX_DISPLAY_NUM];
struct workqueue_struct *auto_update_wq;
};
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index aeb4e9a..dfb054f 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -54,6 +54,8 @@
#define DISPC_IRQ_ACBIAS_COUNT_STAT3 (1 << 29)
#define DISPC_IRQ_FRAMEDONE3 (1 << 30)
+#define OMAPFB_MAX_DISPLAY_NUM 10
+
struct omap_dss_device;
struct omap_overlay_manager;
struct dss_lcd_mgr_config;
--
1.8.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] omap2 dss: omap_display_init: Dont allow more than the maximum number of displays.
2013-06-10 7:57 [PATCH] omap2 dss: omap_display_init: Dont allow more than the maximum number of displays Andreas Naumann
@ 2013-06-12 6:05 ` Tomi Valkeinen
0 siblings, 0 replies; 2+ messages in thread
From: Tomi Valkeinen @ 2013-06-12 6:05 UTC (permalink / raw)
To: Andreas Naumann; +Cc: linux-omap
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
Hi,
On 10/06/13 10:57, Andreas Naumann wrote:
> Currently the maximum number of display is hardcoded in the array omapfb2_device. Made the number a #define and check it in init routine.
>
> Signed-off-by: Andreas Naumann <anaumann@ultratronik.de>
> ---
> Our board supports a lot of panels and we could probably solve this more effectively, but arrays shouldnt silently overflow when using more than 10 displays. Created the patch on 3.1 and tested it there. This one is rebased on todays linux-omap.git
> arch/arm/mach-omap2/display.c | 5 +++++
> drivers/video/omap2/omapfb/omapfb.h | 10 +++++-----
> include/video/omapdss.h | 2 ++
> 3 files changed, 12 insertions(+), 5 deletions(-)
This is an omapfb change, so it should only change omapfb files, not
omapdss.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-12 6:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10 7:57 [PATCH] omap2 dss: omap_display_init: Dont allow more than the maximum number of displays Andreas Naumann
2013-06-12 6:05 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).