Jump to content
darknighte

How to enable GDISP_HARDWARE_STREAM_WRITE for pixmap display, but not my RA8875 display?

Recommended Posts

TLDR;

How do I specify GDISP_HARDWARE_STREAM_WRITE configuration for the RA8875 display, but not the pixmap display?

-------------------------------

I have GDISP working with a RA8875 that is connected via SPI.  However, I am running into issues trying to enable pixmap support.  In particular, I'd like to draw to the pixmap display and then transfer the entire screen for enhanced performance when needed.  So, after enabling pixmap support in my gfxconf.h, I get the following errors:

ugfx/src/gdisp/gdisp.c: In function 'gdispGStreamColor':
ugfx/src/gdisp/gdisp.c:824:6: error: 'GDisplay {aka struct GDisplay}' has no member named 'linebuf'
     g->linebuf[g->p.cx++] = color;
      ^~
ugfx/src/gdisp/gdisp.c:826:6: error: 'sx1' undeclared (first use in this function)
      sx1 = g->p.x1;
      ^~~
ugfx/src/gdisp/gdisp.c:826:6: note: each undeclared identifier is reported only once for each function it appears in
ugfx/src/gdisp/gdisp.c:827:6: error: 'sy1' undeclared (first use in this function); did you mean 'sx1'?
      sy1 = g->p.y1;
      ^~~
      sx1
ugfx/src/gdisp/gdisp.c:830:26: error: 'GDisplay {aka struct GDisplay}' has no member named 'linebuf'
      g->p.ptr = (void *)g->linebuf;
                          ^~
ugfx/src/gdisp/gdisp.c:845:27: error: 'GDisplay {aka struct GDisplay}' has no member named 'linebuf'
       g->p.ptr = (void *)g->linebuf;
                           ^~
ugfx/src/gdisp/gdisp.c: In function 'gdispGStreamStop':
ugfx/src/gdisp/gdisp.c:945:26: error: 'GDisplay {aka struct GDisplay}' has no member named 'linebuf'
      g->p.ptr = (void *)g->linebuf;
                          ^~

Looking in gdisp.c, I see:

	void gdispGStreamColor(GDisplay *g, color_t color) {
		#if !GDISP_HARDWARE_STREAM_WRITE && GDISP_LINEBUF_SIZE != 0 && GDISP_HARDWARE_BITFILLS
			coord_t	 sx1, sy1;
		#endif

This leads me to believe that I need to specify the GDISP_HARDWARE_STREAM_WRITE configuration for the RA8875 display only, but I'm not sure how.

For reference, I am building with Cmake and manually including files that I need. (So, not the same as the single include issue here: 

For reference, here's my gxfconf.h (with all commented out lines removed for brevity) :

#ifndef _GFXCONF_H
#define _GFXCONF_H
#define GDISP_SCREEN_WIDTH              800
#define GDISP_SCREEN_HEIGHT             480
#define GDISP_INITIAL_CONTRAST          100
#define GDISP_INITIAL_BACKLIGHT         100
#define GFX_USE_OS_FREERTOS                            TRUE
#define GFX_COMPILER                                   GFX_COMPILER_GCC
#define GFX_CPU                                        GFX_CPU_CORTEX_M4_FP
#define GFX_CPU_ENDIAN                                 GFX_CPU_ENDIAN_LITTLE
#define GFX_OS_NO_INIT                                 TRUE
#define GFX_OS_INIT_NO_WARNING                         TRUE
#define GFX_USE_GDISP                                  TRUE
#define GDISP_NEED_MULTITHREAD                         TRUE
#define GDISP_NEED_STREAMING                           TRUE
#define GDISP_NEED_PIXMAP                              TRUE
#define GDISP_STARTUP_COLOR                            Black
#define GDISP_NEED_STARTUP_LOGO                        FALSE
#define GDISP_DRIVER_LIST                              GDISPVMT_RA8875, GDISPVMT_PIXMAP
#define GDISP_HARDWARE_CLEARS                          TRUE
#define GDISP_HARDWARE_FILLS                           TRUE
#define GDISP_PIXELFORMAT                              GDISP_PIXELFORMAT_RGB565
#endif /* _GFXCONF_H */

Share this post


Link to post
Share on other sites

With pixmap you don't need to include it in your driver list (or even add the driver list config) as pixmap is handled differently to all other drivers.

You should also not include the following in your gfxconf.h:

The GDISP_SCREEN_xxx or GDISP_INITIAL_xxx variables. These should be in your RA8875 board file as they are display specific.

The GDISP_HARDWARE_xxx variables as they are already appropriately defined in the respective display config file and are modified and played with by the multi-display handling code.

Share this post


Link to post
Share on other sites

Thanks for the response. I'm not sure that it directly addresses the compilation errors though.  In any case, I relocated the GDISP_SCREEN_xxx to the board header and the GDISP_HARDWARE_xxx #defines to the gdisp_lld_config.h.  Also, I tried alternately dropping the PIXMAP from the DRIVER_LIST and removing DRIVER_LIST entirely.  Unfortunately, the error remains the same.

What else would you suggest?

Build env: I'm using the ARMGCC toolchain and building against the 2.8 release tag in git.

For reference, here's my updated and stripped down gfxconf.h

#ifndef _GFXCONF_H
#define _GFXCONF_H
#define GFX_USE_OS_FREERTOS                            TRUE
#define GFX_COMPILER                                   GFX_COMPILER_GCC
#define GFX_CPU                                        GFX_CPU_CORTEX_M4_FP
#define GFX_CPU_ENDIAN                                 GFX_CPU_ENDIAN_LITTLE
#define GFX_OS_NO_INIT                                 TRUE
#define GFX_OS_INIT_NO_WARNING                         TRUE
#define GFX_USE_GDISP                                  TRUE
#define GDISP_NEED_MULTITHREAD                         TRUE
#define GDISP_NEED_STREAMING                           TRUE
#define GDISP_NEED_PIXMAP                              TRUE
#define GDISP_STARTUP_COLOR                            Black
#define GDISP_NEED_STARTUP_LOGO                        FALSE
#endif /* _GFXCONF_H */

.

 

Edited by darknighte

Share this post


Link to post
Share on other sites

Ahh.

GDISP_NEED_STREAMING is completely different to GDISP_HARDWARE_STREAM_WRITE.

The first is whether the streaming API is enabled in GDISP, the second tells GDISP whether a specific display hardware requires a streamed write methodology. The two are completely different things and are completely independent of each other.

My guess is that you have been playing with the GDISP_HARDWARE_xxx definitions. Please restore these to the defaults and then try a make clean before compiling again.

Share this post


Link to post
Share on other sites
On 24/08/2018 at 18:32, inmarket said:

GDISP_NEED_STREAMING is completely different to GDISP_HARDWARE_STREAM_WRITE.

The first is whether the streaming API is enabled in GDISP, the second tells GDISP whether a specific display hardware requires a streamed write methodology. The two are completely different things and are completely independent of each other.

Thanks for the clarification.

On 24/08/2018 at 18:32, inmarket said:

My guess is that you have been playing with the GDISP_HARDWARE_xxx definitions. Please restore these to the defaults and then try a make clean before compiling again.

Unfortunately, disabling those options does not fix the issue.  When I set GDISP_NEED_PIXMAP to TRUE, I get the same compilation issues.
It looks like the conditional compile #ifdefs guarding the linbuf in the struct GDisplay found in gdisp_driver.h at line #376 and around the sx1/sy1 variables in gdisp.c::gdispGStreamColor() at line #796, are creating the issue.  Removing the conditional compilation in those two places compiles, but I'm not sure if that's the best approach.

Anyone have any advice on the best way to proceed here?

 

 

 

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×