diff --git a/drivers/rwbuffer.c b/drivers/rwbuffer.c index 6bb6c27625..7cd72246a4 100644 --- a/drivers/rwbuffer.c +++ b/drivers/rwbuffer.c @@ -834,9 +834,13 @@ int rwb_read(FAR struct rwbuffer_s *rwb, off_t startblock, uint32_t nblocks, } else #else - { - ret = rwb->rhreload(rwb->dev, startblock, nblocks, rdbuffer); - } + { + /* No read-ahead buffering, (re)load the data directly into + * the user buffer. + */ + + ret = rwb->rhreload(rwb->dev, startblock, nblocks, rdbuffer); + } #endif return ret; diff --git a/include/nuttx/nx/nxglib.h b/include/nuttx/nx/nxglib.h index 3b6037c4a9..6e2d1a53d5 100644 --- a/include/nuttx/nx/nxglib.h +++ b/include/nuttx/nx/nxglib.h @@ -633,8 +633,12 @@ void nxgl_trapcopy(FAR struct nxgl_trapezoid_s *dest, * ****************************************************************************/ +#if CONFIG_NX_NPLANES == 1 +# define nxgl_colorcopy(d,s) do { (d)[0] = s[0]; } while (0) +#else void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES], const nxgl_mxpixel_t src[CONFIG_NX_NPLANES]); +#endif /**************************************************************************** * Name: nxgl_colorcmp @@ -646,8 +650,12 @@ void nxgl_colorcopy(nxgl_mxpixel_t dest[CONFIG_NX_NPLANES], * ****************************************************************************/ +#if CONFIG_NX_NPLANES == 1 +# define nxgl_colorcmp(d,s) ((d)[0] == s[0]) +#else bool nxgl_colorcmp(const nxgl_mxpixel_t color1[CONFIG_NX_NPLANES], const nxgl_mxpixel_t color2[CONFIG_NX_NPLANES]); +#endif /**************************************************************************** * Name: nxgl_splitline diff --git a/libnx/nxglib/Make.defs b/libnx/nxglib/Make.defs index bc0ca0c934..8593c91aca 100644 --- a/libnx/nxglib/Make.defs +++ b/libnx/nxglib/Make.defs @@ -37,14 +37,18 @@ ifeq ($(CONFIG_NX),y) -CSRCS += nxglib_circlepts.c nxglib_circletraps.c nxglib_colorcmp.c -CSRCS += nxglib_colorcopy.c nxglib_intersecting.c nxglib_nonintersecting.c -CSRCS += nxglib_nullrect.c nxglib_rectadd.c nxglib_rectcopy.c -CSRCS += nxglib_rectinside.c nxglib_rectintersect.c nxglib_rectoffset.c -CSRCS += nxglib_rectoverlap.c nxglib_rectsize.c nxglib_rectunion.c -CSRCS += nxglib_rgb2yuv.c nxglib_runcopy.c nxglib_runoffset.c -CSRCS += nxglib_splitline.c nxglib_trapcopy.c nxglib_trapoffset.c -CSRCS += nxglib_vectoradd.c nxglib_vectsubtract.c nxglib_yuv2rgb.c +CSRCS += nxglib_circlepts.c nxglib_circletraps.c nxglib_intersecting.c +CSRCS += nxglib_nonintersecting.c nxglib_nullrect.c nxglib_rectadd.c +CSRCS += nxglib_rectcopy.c nxglib_rectinside.c nxglib_rectintersect.c +CSRCS += nxglib_rectoffset.c nxglib_rectoverlap.c nxglib_rectsize.c +CSRCS += nxglib_rectunion.c nxglib_rgb2yuv.c nxglib_runcopy.c +CSRCS += nxglib_runoffset.c nxglib_splitline.c nxglib_trapcopy.c +CSRCS += nxglib_trapoffset.c nxglib_vectoradd.c nxglib_vectsubtract.c +CSRCS += nxglib_yuv2rgb.c + +ifneq ($(CONFIG_NX_NPLANES),1) +CSRCS += nxglib_colorcmp.c nxglib_colorcopy.c +endif # Add the nxglib/ directory to the build