Compare commits

..
9 changed files with 59 additions and 54 deletions
+6
View File
@@ -105,6 +105,12 @@ seat=seat0
[fbcon]
defaultmode=1024x768-16bpp
dpi=96
# Whether double buffering is enabled (only for threads and standalone runmodes).
# Use `true` or `yes` for enabled, anything else for disabled.
# Note that under compositing schema, double buffering is always enabled.
# Since 5.0.10.
double_buffering=true
#}}
#{{ifdef _MGGAL_PCXVFB
+1 -1
View File
@@ -93,7 +93,7 @@ typedef struct tagDC* PDC;
# else /* not defined _MGSCHEMA_COMPOSITING */
void __mg_lock_recalc_gcrinfo (PDC pdc);
void __mg_unlock_gcrinfo (PDC pdc);
#define LOCK_GCRINFO(pdc) __mg_lock_recalc_gcrinfo (pdc)
#define LOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_lock_recalc_gcrinfo (pdc)
#define UNLOCK_GCRINFO(pdc) if (dc_IsGeneralDC(pdc)) __mg_unlock_gcrinfo (pdc)
# endif /* not defined _MGSCHEMA_COMPOSITING */
+2 -2
View File
@@ -1067,8 +1067,8 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
uint32_t name, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video,
uint32_t handle, size_t size, uint32_t drm_format, uint32_t pixels_off,
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch);
GAL_Surface* __drm_create_surface_from_prime_fd (GHANDLE video,
+2 -2
View File
@@ -1403,7 +1403,7 @@ static LRESULT WindowMessageHandler(UINT message, PMAINWIN pWin, LPARAM lParam)
else {
from = 0;
}
lock_zi_for_read (zi);
from = __kernel_get_next_znode (zi, from);
@@ -1821,7 +1821,7 @@ static void dskRefreshAllWindow (const RECT* invrc)
info.is_empty_invrc = TRUE;
#ifdef _MGHAVE_MENU
dskForceCloseMenu ();
dskForceCloseMenu ();
#endif
SendMessage (HWND_DESKTOP, MSG_ERASEDESKTOP, 0,
+3 -3
View File
@@ -3641,6 +3641,9 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
do_for_all_znodes (&rcOld, zi, _cb_update_znode, ZT_ALL);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
if (nodes [0].flags & ZOF_IF_REFERENCE) {
SendMessage (HWND_DESKTOP,
MSG_ERASEDESKTOP, 0, (LPARAM)&rcOld);
@@ -3680,9 +3683,6 @@ static int dskMoveWindow (int cli, int idx_znode, HDC memdc, const RECT* rcWin)
update_client_window_rgn (nodes [idx_znode].cli,
nodes [idx_znode].hwnd);
/* unlock zi for change ... */
unlock_zi_for_change (zi);
}
else {
lock_zi_for_change (zi);
+1 -1
View File
@@ -3575,7 +3575,7 @@ GAL_Surface* __drm_create_surface_from_name (GHANDLE video,
/* called by drmCreateDCFromHandle */
GAL_Surface* __drm_create_surface_from_handle (GHANDLE video, uint32_t handle,
unsigned long size, uint32_t drm_format, uint32_t pixels_off,
size_t size, uint32_t drm_format, uint32_t pixels_off,
uint32_t width, uint32_t height, uint32_t pitch)
{
GAL_VideoDevice *this = (GAL_VideoDevice *)video;
+34 -33
View File
@@ -102,8 +102,6 @@ static void FB_FreeHWSurface(_THIS, GAL_Surface *surface);
static void FB_WaitVBL(_THIS);
static void FB_WaitIdle(_THIS);
#ifdef _MGSCHEMA_COMPOSITING
#include "../shadow-screen.h"
#include "debug.h"
@@ -133,13 +131,6 @@ static BOOL FB_SyncUpdate (_THIS)
return FALSE;
}
#endif /* _MGSCHEMA_COMPOSITING */
#if 0
static int FB_LockHWSurface(_THIS, GAL_Surface *surface);
static void FB_UnlockHWSurface(_THIS, GAL_Surface *surface);
static int FB_FlipHWSurface(_THIS, GAL_Surface *surface);
#endif
/* Internal palette functions */
static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,
@@ -169,11 +160,9 @@ static int FB_Available(void)
static void FB_DeleteDevice(GAL_VideoDevice *device)
{
#ifdef _MGSCHEMA_COMPOSITING
if (device->hidden->shadow_screen) {
GAL_FreeSurface (device->hidden->real_screen);
}
#endif /* _MGSCHEMA_COMPOSITING */
free(device->hidden);
free(device);
@@ -197,11 +186,8 @@ static GAL_VideoDevice *FB_CreateDevice(int devindex)
return(0);
}
memset(this->hidden, 0, (sizeof *this->hidden));
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
this->hidden->magic = MAGIC_SHADOW_SCREEN_HEADER;
this->hidden->version = 0;
#endif
wait_vbl = FB_WaitVBL;
wait_idle = FB_WaitIdle;
@@ -278,7 +264,7 @@ static int FB_EnterGraphicsMode (_THIS)
if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {
_WRN_PRINTF ("Error when setting the terminal (%s) "
"to graphics mode: %m\n", tty_dev);
_WRN_PRINTF ("It might is not a console.\n");
_WRN_PRINTF ("It might not be a console.\n");
goto fail;
}
#ifdef _MGRM_PROCESSES
@@ -421,16 +407,6 @@ static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat)
(((long)finfo.smem_start)&~(getpagesize () - 1)));
mapped_memlen = finfo.smem_len+mapped_offset;
#if defined(__TARGET_R818__) && defined(_MGSCHEMA_COMPOSITING)
if (mgIsServer) {
uintptr_t args[2] = { 1, 0 };
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
GAL_SetError("NEWGAL/FBCON: FBIO_ENABLE_CACHE failed\n");
return -1;
}
}
#endif
#ifdef __uClinux__
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
mapped_mem = mmap(NULL, mapped_memlen,
@@ -609,6 +585,7 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
Uint32 Amask;
char *surfaces_mem;
int surfaces_len;
BOOL dblbuff = FALSE;
#ifdef __TARGET_STB810__
bpp = 32;
@@ -793,6 +770,30 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
// allocate hardware surface first.
GAL_PublicSurface = current;
dblbuff = TRUE;
}
else {
// client never call SetVideoMode
assert (0);
}
#elif !IS_SHAREDFB_SCHEMA_PROC
{
char tmp [8];
if (GetMgEtcValue ("fbcon", "double_buffering", tmp, 8) >= 0 &&
(strcasecmp (tmp, "true") == 0 || strcasecmp (tmp, "yes") == 0)) {
dblbuff = TRUE;
}
}
#endif /* !IS_SHAREDFB_SCHEMA_PROC */
if (dblbuff) {
#if defined(__TARGET_R818__)
uintptr_t args[2] = { 1, 0 };
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
GAL_SetError("NEWGAL/FBCON: FBIO_ENABLE_CACHE failed\n");
}
#endif
/* create shadow screen */
this->hidden->shadow_screen = GAL_CreateRGBSurface (GAL_HWSURFACE,
current->w, current->h,
@@ -801,10 +802,12 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
current->format->Bmask, current->format->Amask);
if (this->hidden->shadow_screen) {
#if IS_COMPOSITING_SCHEMA
this->info.hw_cursor = 1;
this->hidden->cursor = NULL;
this->SetCursor = shadowScreen_SetCursor;
this->MoveCursor = shadowScreen_MoveCursor;
#endif
this->UpdateRects = shadowScreen_UpdateRects;
this->SyncUpdate = FB_SyncUpdate;
@@ -814,6 +817,7 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
GAL_SetClipRect (this->hidden->real_screen, NULL);
GAL_SetColorKey (this->hidden->shadow_screen, 0, 0);
GAL_SetAlpha (this->hidden->shadow_screen, 0, 0);
SetRectEmpty (&this->hidden->dirty_rc);
}
else {
this->hidden->real_screen = NULL;
@@ -821,10 +825,9 @@ static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current,
}
}
else {
// client never call SetVideoMode
assert (0);
this->hidden->real_screen = current;
this->hidden->shadow_screen = NULL;
}
#endif /* _MGSCHEMA_COMPOSITING */
/* We're done */
return (current);
@@ -1042,8 +1045,8 @@ static int FB_AllocHWSurface (_THIS, GAL_Surface *surface)
REQUEST req;
#ifdef _MGSCHEMA_COMPOSITING
if (!mgIsServer)
return -1;
if (!mgIsServer)
return -1;
#endif
req.id = REQID_HWSURFACE;
req.data = &request;
@@ -1296,11 +1299,9 @@ static void FB_VideoQuit(_THIS)
}
}
#ifdef _MGSCHEMA_COMPOSITING
if (mgIsServer && this->hidden->shadow_screen) {
if (this->hidden->shadow_screen) {
GAL_FreeSurface (this->hidden->shadow_screen);
}
#endif
/* Clean up the memory bucket list */
#ifdef _MGRM_PROCESSES
+10 -10
View File
@@ -68,19 +68,26 @@ typedef struct vidmem_bucket {
/* Private display data */
struct GAL_PrivateVideoData {
/* For compositing schema, we force to use double buffering */
#ifdef _MGSCHEMA_COMPOSITING
/* When double buffering supported, the real surface represents the ultimate
* scan-out frame buffer, and the shadow screen represents the rendering
* surface. When double buffering disabled, shadow_screen is NULL.
*
* For compositing schema, we force to use double buffering.
* For threads and standalone mode, controlled by `fbcon.double_buffering`
* run-time option. Not supported for processes mode.
*/
/* start of header for shadow screen */
int magic, version;
GAL_Surface *real_screen, *shadow_screen;
RECT dirty_rc;
#ifdef _MGSCHEMA_COMPOSITING
/* Used to simulate the hardware cursor. */
GAL_Surface *cursor;
int csr_x, csr_y;
int hot_x, hot_y;
#endif
/* end of header for shadow screen */
#endif /* _MGSCHEMA_COMPOSITING */
int console_fd;
struct fb_var_screeninfo cache_vinfo;
@@ -104,13 +111,6 @@ struct GAL_PrivateVideoData {
void (*wait_vbl)(_THIS);
void (*wait_idle)(_THIS);
#if 0 /* deprecated code */
int flip_page;
char *flip_address[2];
#define flip_page (this->hidden->flip_page)
#define flip_address (this->hidden->flip_address)
#endif
};
/* Old variable names */
-2
View File
@@ -4349,8 +4349,6 @@ static void on_surface_changed_for_control (struct _travel_context* ctxt,
RECT rc_surface, rc_minimal;
PDC pdc = dc_HDC2PDC (ctrl->privCDC);
_WRN_PRINTF ("called\n");
pdc->surface = ctxt->surface;
if (pdc->surface != __gal_screen) {