Skip to content

Commit

Permalink
sim: read the second buffer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jianglianfang committed Aug 22, 2024
1 parent 86c2e42 commit 09407a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions arch/sim/src/sim/posix/sim_x11framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ static unsigned short g_fbpixelwidth;
static unsigned short g_fbpixelheight;
static int g_fbbpp;
static int g_fblen;
static int g_fbcount;
static int g_shmcheckpoint = 0;
static int b_useshm;

static unsigned char *g_trans_framebuffer;
static unsigned int g_offset;

/****************************************************************************
* Private Functions
Expand Down Expand Up @@ -465,7 +465,6 @@ int sim_x11initialize(unsigned short width, unsigned short height,

g_fbbpp = depth;
g_fblen = *fblen;
g_fbcount = fbcount;

/* Create conversion framebuffer */

Expand Down Expand Up @@ -541,6 +540,7 @@ int sim_x11setoffset(unsigned int offset)
if (g_fbbpp == 32 && CONFIG_SIM_FBBPP == 16)
{
g_image->data = g_framebuffer + (offset << 1);
g_offset = offset;
}
else
{
Expand Down Expand Up @@ -620,9 +620,9 @@ int sim_x11update(void)

if (g_fbbpp == 32 && CONFIG_SIM_FBBPP == 16)
{
sim_x11depth16to32(g_framebuffer,
g_fblen * g_fbcount,
g_trans_framebuffer);
sim_x11depth16to32(g_image->data,
g_fblen,
g_trans_framebuffer + g_offset);
}

XSync(g_display, 0);
Expand Down
1 change: 1 addition & 0 deletions arch/sim/src/sim/sim_framebuffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ int up_fbinitialize(int display)
&g_planeinfo.fbmem, &g_planeinfo.fblen,
&g_planeinfo.bpp, &g_planeinfo.stride,
CONFIG_SIM_FRAMEBUFFER_COUNT);
g_planeinfo.fblen *= CONFIG_SIM_FRAMEBUFFER_COUNT;
#endif

return ret;
Expand Down
1 change: 1 addition & 0 deletions tools/nxstyle.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ static const char *g_white_content_list[] =
"AsyncBoth",
"CurrentTime",
"XUnmapWindow",
"XFree",

/* Ref:
* nuttx/arch/sim/src/sim_hostdecoder.*
Expand Down

0 comments on commit 09407a1

Please sign in to comment.