Discussion:
[nuttx] Bad NX graphics dependency in apps/examples/fb
Sebastien Lorquet sebastien@lorquet.fr [nuttx]
2018-02-14 16:55:18 UTC
Permalink
Greg,

apps/examples/fb draws rectangles on a screen using the fb device.

This device is able to work without NX library enabled.

However the call to FBIO_UPDATE has been made conditional over CONFIG_NX_UPDATE
which in turn requires nx graphics library to be enabled

But nx graphics library is not required for fb usage!

A configuration should be added to signal the need of framebuffer update
notification. it should be available when the fbdev char driver has been
enabled, even if NX graphics lib is not enabled.

Regards

Sebastien
spudarnia@yahoo.com [nuttx]
2018-02-14 18:03:26 UTC
Permalink
That is not true.

There are two (mostly) independent configuration settings

./drivers/lcd/Kconfig:config LCD_UPDATE
./drivers/lcd/Kconfig: select NX_UPDATE if NX

./graphics/Kconfig:config NX_UPDATE
./graphics/vnc/server/Kconfig: select NX_UPDATE

CONFIG_LCD_UPDATE is the only one that matters. CONFIG_NX_UPDATE is only for backward compatibility.

Notice that if CONFIG_ NX enabled, they are kept in lock step. However, if CONFIG_NX is not enabled, the CONFIG_LCD_UPDATE can be enabled or disabled independently without :CONFIG_NX being enabled.

There are several configurations that do this. There are several configurations using the framebuffer driver and none of them set NX (except for opn1788 and that is for a different purpose):

configs/lpcxpresso-lpc54628/fb
configs/open1788/fb
configs/sim/fb
configs/stm3240g-eval/fb
configs/stm32f429i-disco/fb

Of those, only configs/stm3240g-eval/fb uses CONFIG_LCD_FRAMEBUFFEr

$ find configs -name fb | xargs grep -r CONFIG_LCD_FRAMEBUFFER
configs/stm3240g-eval/fb/defconfig:CONFIG_LCD_FRAMEBUFFER=y

NOTE that CONFIG_NX is not set and CONFIG_NX_UPDATE is not set. CONFIG_LCD_UPDATE is not set in the configuration either, but that is because it is the default when CONFIG_LCD_FRAMEBUFFER=y; it will reappear when the configuration is refreshed.

33 config LCD_FRAMEBUFFER
34 bool "LCD framebuffer front end"
35 default n
36 select LCD_UPDATE
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2018-02-14 18:31:00 UTC
Permalink
Hi Greg,

I think it was because in my video tutorial I selected the NX Graphics.

In fact is was not necessary, I just need to remove "#ifdef
CONFIG_NX_LCDDRIVER" from stm32_ssd1306.c.

I will submit a new patch to fix it.

BR,

Alan
Post by ***@yahoo.com [nuttx]
That is not true.
There are two (mostly) independent configuration settings
./drivers/lcd/Kconfig:config LCD_UPDATE
./drivers/lcd/Kconfig: select NX_UPDATE if NX
./graphics/Kconfig:config NX_UPDATE
./graphics/vnc/server/Kconfig: select NX_UPDATE
CONFIG_LCD_UPDATE is the only one that matters. CONFIG_NX_UPDATE is only
for backward compatibility.
Notice that if CONFIG_ NX enabled, they are kept in lock step. However, if
CONFIG_NX is not enabled, the CONFIG_LCD_UPDATE can be enabled or disabled
independently without :CONFIG_NX being enabled.
There are several configurations that do this. There are several
configurations using the framebuffer driver and none of them set NX (except
configs/lpcxpresso-lpc54628/fb
configs/open1788/fb
configs/sim/fb
configs/stm3240g-eval/fb
configs/stm32f429i-disco/fb
Of those, only configs/stm3240g-eval/fb uses CONFIG_LCD_FRAMEBUFFEr
$ find configs -name fb | xargs grep -r CONFIG_LCD_FRAMEBUFFER
configs/stm3240g-eval/fb/defconfig:CONFIG_LCD_FRAMEBUFFER=y
NOTE that CONFIG_NX is not set and CONFIG_NX_UPDATE is not set.
CONFIG_LCD_UPDATE is not set in the configuration either, but that is
because it is the default when CONFIG_LCD_FRAMEBUFFER=y; it will reappear
when the configuration is refreshed.
33 config LCD_FRAMEBUFFER
34 bool "LCD framebuffer front end"
35 default n
36 select LCD_UPDATE
spudarnia@yahoo.com [nuttx]
2018-02-14 18:18:11 UTC
Permalink
I didn't read very carefully and didn't respond exactly to point.
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
apps/examples/fb draws rectangles on a screen using the fb device.
This device is able to work without NX library enabled.
However the call to FBIO_UPDATE has been made conditional over CONFIG_NX_UPDATE
which in turn requires nx graphics library to be enabled


I still think you are mistaken, however. I see:


267 #ifdef CONFIG_LCD_UPDATE
268 ret = ioctl(state->fd, FBIO_UPDATE,
269 (unsigned long)((uintptr_t)rect));
270 if (ret < 0)
271 {
272 int errcode = errno;
273 fprintf(stderr, "ERROR: ioctl(FBIO_UPDATE) failed: %d\n",
274 errcode);
275 }
276 #endif



which has nothing to do with NX. Am I missing something?
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
A configuration should be added to signal the need of framebuffer update
notification. it should be available when the fbdev char driver has been
enabled, even if NX graphics lib is not enabled.



Patches welcome,
Greg
Sebastien Lorquet sebastien@lorquet.fr [nuttx]
2018-02-14 20:10:10 UTC
Permalink
Yes sorry, my apps working tree was not up to date!

The correct commit is here:

https://bitbucket.org/nuttx/apps/commits/42bb5643bfd0ee4789ef42d973c8e3f82d520cbe

It is correct after having updated the working tree for apps.

Sebastien
Post by ***@yahoo.com [nuttx]
 
I didn't read very carefully and didn't respond exactly to point.
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
apps/examples/fb draws rectangles on a screen using the fb device.
This device is able to work without NX library enabled.
However the call to FBIO_UPDATE has been made conditional over
CONFIG_NX_UPDATE
which in turn requires nx graphics library to be enabled
267 #ifdef CONFIG_LCD_UPDATE
268   ret = ioctl(state->fd, FBIO_UPDATE,
269               (unsigned long)((uintptr_t)rect));
270   if (ret < 0)
271     {
272       int errcode = errno;
273       fprintf(stderr, "ERROR: ioctl(FBIO_UPDATE) failed: %d\n",
274               errcode);
275     }
276 #endif
which has nothing to do with NX.  Am I missing something?
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
A configuration should be added to signal the need of framebuffer update
notification. it should be available when the fbdev char driver has been
enabled, even if NX graphics lib is not enabled.
Patches welcome,
Greg
Alan Carvalho de Assis acassis@gmail.com [nuttx]
2018-02-14 23:21:56 UTC
Permalink
I just edited my video tutorial to remove the NX Graphics configuration.

It helped reducing about 40s of the video length! :-)
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
Yes sorry, my apps working tree was not up to date!
https://bitbucket.org/nuttx/apps/commits/42bb5643bfd0ee4789ef42d973c8e3f82d520cbe
It is correct after having updated the working tree for apps.
Sebastien
Post by ***@yahoo.com [nuttx]
I didn't read very carefully and didn't respond exactly to point.
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
apps/examples/fb draws rectangles on a screen using the fb device.
This device is able to work without NX library enabled.
However the call to FBIO_UPDATE has been made conditional over
CONFIG_NX_UPDATE
which in turn requires nx graphics library to be enabled
267 #ifdef CONFIG_LCD_UPDATE
268 ret = ioctl(state->fd, FBIO_UPDATE,
269 (unsigned long)((uintptr_t)rect));
270 if (ret < 0)
271 {
272 int errcode = errno;
273 fprintf(stderr, "ERROR: ioctl(FBIO_UPDATE) failed: %d\n",
274 errcode);
275 }
276 #endif
which has nothing to do with NX. Am I missing something?
Post by Sebastien Lorquet ***@lorquet.fr [nuttx]
A configuration should be added to signal the need of framebuffer update
notification. it should be available when the fbdev char driver has been
enabled, even if NX graphics lib is not enabled.
Patches welcome,
Greg
Loading...