From d2f7483c24fc21716c24a690c9f363db3162feab Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 14 Apr 2016 11:32:00 -0600 Subject: [PATCH] VNC: Add an allocated (local) framebuffer --- graphics/vnc/server/vnc_server.h | 2 ++ graphics/vnc/server/vnc_session.c | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/graphics/vnc/server/vnc_server.h b/graphics/vnc/server/vnc_server.h index ef24920515..403a2d8465 100644 --- a/graphics/vnc/server/vnc_server.h +++ b/graphics/vnc/server/vnc_server.h @@ -90,7 +90,9 @@ struct vnc_session_s /* Display geometry and color characteristics */ uint8_t colorfmt; /* See include/nuttx/fb.h */ + uint8_t bpp; /* Bits per pixel */ struct nxgl_size_s screen; /* Size of the screen in pixels x rows */ + FAR uint8_t *fb; /* Allocated local frame buffer */ }; /**************************************************************************** diff --git a/graphics/vnc/server/vnc_session.c b/graphics/vnc/server/vnc_session.c index 16ec9ff846..3558993800 100644 --- a/graphics/vnc/server/vnc_session.c +++ b/graphics/vnc/server/vnc_session.c @@ -216,5 +216,12 @@ void vnc_release_session(FAR struct vnc_session_s *session) psock_close(&session->listen); } + /* Free the allocated framebuffer */ + + if (session->fb) + { + kmm_free(session->fb); + } + vnc_initialize_session(session); }