Skip to content

Commit f5fe764

Browse files
jianglianfangxiaoxiang781216
authored andcommitted
sim: read the second buffer
It can only read the contents of the first buffer, so fblen should be changed to ensure that it can read the second buffer as well. Signed-off-by: jianglianfang <[email protected]>
1 parent 4d42fdf commit f5fe764

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

arch/sim/src/sim/posix/sim_x11framebuffer.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ static unsigned short g_fbpixelwidth;
8383
static unsigned short g_fbpixelheight;
8484
static int g_fbbpp;
8585
static int g_fblen;
86-
static int g_fbcount;
8786
static int g_shmcheckpoint = 0;
8887
static int b_useshm;
8988

9089
static unsigned char *g_trans_framebuffer;
90+
static unsigned int g_offset;
9191

9292
/****************************************************************************
9393
* Private Functions
@@ -465,7 +465,6 @@ int sim_x11initialize(unsigned short width, unsigned short height,
465465

466466
g_fbbpp = depth;
467467
g_fblen = *fblen;
468-
g_fbcount = fbcount;
469468

470469
/* Create conversion framebuffer */
471470

@@ -541,6 +540,7 @@ int sim_x11setoffset(unsigned int offset)
541540
if (g_fbbpp == 32 && CONFIG_SIM_FBBPP == 16)
542541
{
543542
g_image->data = g_framebuffer + (offset << 1);
543+
g_offset = offset;
544544
}
545545
else
546546
{
@@ -620,9 +620,9 @@ int sim_x11update(void)
620620

621621
if (g_fbbpp == 32 && CONFIG_SIM_FBBPP == 16)
622622
{
623-
sim_x11depth16to32(g_framebuffer,
624-
g_fblen * g_fbcount,
625-
g_trans_framebuffer);
623+
sim_x11depth16to32(g_image->data,
624+
g_fblen,
625+
g_trans_framebuffer + g_offset);
626626
}
627627

628628
XSync(g_display, 0);

arch/sim/src/sim/sim_framebuffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ int up_fbinitialize(int display)
470470
&g_planeinfo.fbmem, &g_planeinfo.fblen,
471471
&g_planeinfo.bpp, &g_planeinfo.stride,
472472
CONFIG_SIM_FRAMEBUFFER_COUNT);
473+
g_planeinfo.fblen *= CONFIG_SIM_FRAMEBUFFER_COUNT;
473474
#endif
474475

475476
return ret;

tools/nxstyle.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ static const char *g_white_content_list[] =
451451
"AsyncBoth",
452452
"CurrentTime",
453453
"XUnmapWindow",
454+
"XFree",
454455

455456
/* Ref:
456457
* nuttx/arch/sim/src/sim_hostdecoder.*

0 commit comments

Comments
 (0)