diff --git a/examples/ltdc/ltdc_main.c b/examples/ltdc/ltdc_main.c index aab6f84f3..4d0827cfa 100644 --- a/examples/ltdc/ltdc_main.c +++ b/examples/ltdc/ltdc_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/ltdc/ltdc_main.c * - * Copyright (C) 2008, 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -2084,13 +2084,13 @@ int ltdc_main(int argc, char *argv[]) FAR struct fb_videoinfo_s vinfo; FAR struct fb_vtable_s *fbtable; - if (up_fbinitialize()<0) + if (up_fbinitialize(0) < 0) { dbg("up_fbinitialize() failed\n"); return -1; } - fbtable = up_fbgetvplane(0); + fbtable = up_fbgetvplane(0,0); if (!fbtable) { diff --git a/examples/nx/nx_main.c b/examples/nx/nx_main.c index dbdd608fa..fb2bb1d99 100644 --- a/examples/nx/nx_main.c +++ b/examples/nx/nx_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nx/nx_main.c * - * Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -482,18 +482,22 @@ static inline int nxeg_suinitialize(void) /* Initialize the frame buffer device */ printf("nxeg_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxeg_initialize: up_fbinitialize failed: %d\n", -ret); + g_exitcode = NXEXIT_FBINITIALIZE; return ERROR; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NX_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NX_VPLANE); if (!dev) { - printf("nxeg_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); + printf("nxeg_initialize: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NX_VPLANE); + g_exitcode = NXEXIT_FBGETVPLANE; return ERROR; } @@ -502,10 +506,12 @@ static inline int nxeg_suinitialize(void) /* Then open NX */ printf("nxeg_initialize: Open NX\n"); + g_hnx = nx_open(dev); if (!g_hnx) { printf("nxeg_suinitialize: nx_open failed: %d\n", errno); + g_exitcode = NXEXIT_NXOPEN; return ERROR; } diff --git a/examples/nx/nx_server.c b/examples/nx/nx_server.c index b13eb6d54..f4b6b13bd 100644 --- a/examples/nx/nx_server.c +++ b/examples/nx/nx_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nx/nx_server.c * - * Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -141,17 +141,19 @@ int nx_servertask(int argc, char *argv[]) /* Initialize the frame buffer device */ printf("nx_servertask: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nx_servertask: up_fbinitialize failed: %d\n", -ret); return 1; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NX_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NX_VPLANE); if (!dev) { - printf("nx_servertask: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NX_VPLANE); + printf("nx_servertask: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NX_VPLANE); return 2; } #endif diff --git a/examples/nxhello/nxhello_main.c b/examples/nxhello/nxhello_main.c index 2082d71b0..f7774b2dd 100644 --- a/examples/nxhello/nxhello_main.c +++ b/examples/nxhello/nxhello_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxhello/nxhello_main.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -181,18 +181,22 @@ static inline int nxhello_initialize(void) /* Initialize the frame buffer device */ printf("nxhello_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxhello_initialize: up_fbinitialize failed: %d\n", -ret); + g_nxhello.code = NXEXIT_FBINITIALIZE; return ERROR; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXHELLO_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXHELLO_VPLANE); if (!dev) { - printf("nxhello_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXHELLO_VPLANE); + printf("nxhello_initialize: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXHELLO_VPLANE); + g_nxhello.code = NXEXIT_FBGETVPLANE; return ERROR; } diff --git a/examples/nximage/nximage_main.c b/examples/nximage/nximage_main.c index 9d84b64ba..75c0d60e2 100644 --- a/examples/nximage/nximage_main.c +++ b/examples/nximage/nximage_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nximage/nximage_main.c * - * Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -185,18 +185,22 @@ static inline int nximage_initialize(void) /* Initialize the frame buffer device */ printf("nximage_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nximage_initialize: up_fbinitialize failed: %d\n", -ret); + g_nximage.code = NXEXIT_FBINITIALIZE; return ERROR; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXIMAGE_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXIMAGE_VPLANE); if (!dev) { - printf("nximage_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXIMAGE_VPLANE); + printf("nximage_initialize: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXIMAGE_VPLANE); + g_nximage.code = NXEXIT_FBGETVPLANE; return ERROR; } @@ -212,6 +216,7 @@ static inline int nximage_initialize(void) g_nximage.code = NXEXIT_NXOPEN; return ERROR; } + return OK; } diff --git a/examples/nxlines/nxlines_main.c b/examples/nxlines/nxlines_main.c index eb4a26b13..15671ce49 100644 --- a/examples/nxlines/nxlines_main.c +++ b/examples/nxlines/nxlines_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxlines/nxlines_main.c * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -177,18 +177,22 @@ static inline int nxlines_initialize(void) /* Initialize the frame buffer device */ printf("nxlines_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxlines_initialize: up_fbinitialize failed: %d\n", -ret); + g_nxlines.code = NXEXIT_FBINITIALIZE; return ERROR; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXLINES_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXLINES_VPLANE); if (!dev) { - printf("nxlines_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXLINES_VPLANE); + printf("nxlines_initialize: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXLINES_VPLANE); + g_nxlines.code = NXEXIT_FBGETVPLANE; return ERROR; } @@ -197,10 +201,12 @@ static inline int nxlines_initialize(void) /* Then open NX */ printf("nxlines_initialize: Open NX\n"); + g_nxlines.hnx = nx_open(dev); if (!g_nxlines.hnx) { printf("nxlines_initialize: nx_open failed: %d\n", errno); + g_nxlines.code = NXEXIT_NXOPEN; return ERROR; } diff --git a/examples/nxterm/nxterm_server.c b/examples/nxterm/nxterm_server.c index 50867a29c..fdb93a4b5 100644 --- a/examples/nxterm/nxterm_server.c +++ b/examples/nxterm/nxterm_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxterm/nxterm_server.c * - * Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -137,17 +137,19 @@ int nxterm_server(int argc, char *argv[]) /* Initialize the frame buffer device */ printf("nxterm_server: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxterm_server: up_fbinitialize failed: %d\n", -ret); return 1; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXTERM_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXTERM_VPLANE); if (!dev) { - printf("nxterm_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXTERM_VPLANE); + printf("nxterm_server: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXTERM_VPLANE); return 2; } #endif diff --git a/examples/nxtext/nxtext_main.c b/examples/nxtext/nxtext_main.c index 80c3479b9..56a8226ef 100644 --- a/examples/nxtext/nxtext_main.c +++ b/examples/nxtext/nxtext_main.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxtext/nxtext_main.c * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -223,18 +223,22 @@ static inline int nxtext_suinitialize(void) /* Initialize the frame buffer device */ printf("nxtext_initialize: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxtext_initialize: up_fbinitialize failed: %d\n", -ret); + g_exitcode = NXEXIT_FBINITIALIZE; return ERROR; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXTEXT_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXTEXT_VPLANE); if (!dev) { - printf("nxtext_initialize: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXTEXT_VPLANE); + printf("nxtext_initialize: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXTEXT_VPLANE); + g_exitcode = NXEXIT_FBGETVPLANE; return ERROR; } @@ -243,13 +247,16 @@ static inline int nxtext_suinitialize(void) /* Then open NX */ printf("nxtext_initialize: Open NX\n"); + g_hnx = nx_open(dev); if (!g_hnx) { printf("nxtext_initialize: nx_open failed: %d\n", errno); + g_exitcode = NXEXIT_NXOPEN; return ERROR; } + return OK; } #endif diff --git a/examples/nxtext/nxtext_server.c b/examples/nxtext/nxtext_server.c index 813d56ed1..0514b61b5 100644 --- a/examples/nxtext/nxtext_server.c +++ b/examples/nxtext/nxtext_server.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/nxtext/nxtext_server.c * - * Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2012, 2015-2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -140,17 +140,19 @@ int nxtext_server(int argc, char *argv[]) /* Initialize the frame buffer device */ printf("nxtext_server: Initializing framebuffer\n"); - ret = up_fbinitialize(); + + ret = up_fbinitialize(0); if (ret < 0) { printf("nxtext_server: up_fbinitialize failed: %d\n", -ret); return 1; } - dev = up_fbgetvplane(CONFIG_EXAMPLES_NXTEXT_VPLANE); + dev = up_fbgetvplane(0, CONFIG_EXAMPLES_NXTEXT_VPLANE); if (!dev) { - printf("nxtext_server: up_fbgetvplane failed, vplane=%d\n", CONFIG_EXAMPLES_NXTEXT_VPLANE); + printf("nxtext_server: up_fbgetvplane failed, vplane=%d\n", + CONFIG_EXAMPLES_NXTEXT_VPLANE); return 2; } #endif diff --git a/graphics/traveler/src/trv_graphics.c b/graphics/traveler/src/trv_graphics.c index f7ff1249e..cd0386644 100644 --- a/graphics/traveler/src/trv_graphics.c +++ b/graphics/traveler/src/trv_graphics.c @@ -1,7 +1,7 @@ /**************************************************************************** * apps/graphics/traveler/src/trv_graphics.c * - * Copyright (C) 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -83,20 +83,20 @@ static FAR struct fb_vtable_s *trv_get_fbdev(void) /* Initialize the frame buffer device */ - ret = up_fbinitialize(); + ret = up_fbinitialize(0); if (ret < 0) { - trv_abort("ERROR: up_fbinitialize failed: %d\n", -ret); + trv_abort("ERROR: up_fbinitialize() failed: %d\n", -ret); } /* Set up to use video plane 0. There is no support for anything but * video plane 0. */ - fbdev = up_fbgetvplane(0); + fbdev = up_fbgetvplane(0,0); if (!fbdev) { - trv_abort("ERROR: up_fbgetvplane(0) failed\n"); + trv_abort("ERROR: up_fbgetvplane() failed\n"); } return fbdev;