ioctls for FBVIDEO on R818

This commit is contained in:
Vincent Wei
2021-06-04 15:52:03 +08:00
parent e08a87fc93
commit 550fb04731

View File

@@ -105,6 +105,11 @@ static void FB_WaitIdle(_THIS);
#include "../shadow-screen.h"
#include "debug.h"
#if defined(__TARGET_R818__)
#define FBIO_CACHE_SYNC 0x4630
#define FBIO_ENABLE_CACHE 0x4631
#endif
static BOOL FB_SyncUpdate (_THIS)
{
if (IsRectEmpty (&this->hidden->dirty_rc))
@@ -112,6 +117,14 @@ static BOOL FB_SyncUpdate (_THIS)
if (shadowScreen_BlitToReal (this) == 0) {
SetRectEmpty (&this->hidden->dirty_rc);
#if defined(__TARGET_R818__)
uintptr_t args[2];
args[0] = (uintptr_t)this->hidden->real_screen->pixels;
args[1] = this->hidden->real_screen->pitch * this->hidden->real_screen->h;
if (ioctl (console_fd, FBIO_CACHE_SYNC, args) < 0) {
return FALSE;
}
#endif
return TRUE;
}
@@ -393,6 +406,16 @@ 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)
{
uintptr_t args[2] = { 1};
if (ioctl(console_fd, FBIO_ENABLE_CACHE, args) < 0) {
GAL_SetError("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,