aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <emulator@emulace.cz>2024-08-13 09:23:30 +0200
committerJaroslav Hensl <emulator@emulace.cz>2024-08-13 09:23:30 +0200
commita1812e7538bd018ffbabb6573dee9e7345c6d57a (patch)
tree5d7a7eddada953a32b6d43f3b37ae7ab2980b07a
parenta58f69cf53f7504069cfbe695cda873208ac2086 (diff)
downloadvmdisp9x-a1812e7538bd018ffbabb6573dee9e7345c6d57a.tar.gz
overlay + gamma + frame buffering (in progress)
-rw-r--r--3d_accel.h26
-rw-r--r--dddrv.c14
-rw-r--r--makefile2
-rw-r--r--vxd_fbhda.c3
-rw-r--r--vxd_lib.c147
-rw-r--r--vxd_lib.h3
-rw-r--r--vxd_main.c49
-rw-r--r--vxd_strings.h2
-rw-r--r--vxd_svga.c56
9 files changed, 194 insertions, 108 deletions
diff --git a/3d_accel.h b/3d_accel.h
index 46f73a3..979d747 100644
--- a/3d_accel.h
+++ b/3d_accel.h
@@ -33,7 +33,7 @@ THE SOFTWARE.
#endif
#endif
-#define API_3DACCEL_VER 20240724
+#define API_3DACCEL_VER 20240808
#define ESCAPE_DRV_NT 0x1103 /* (4355) */
@@ -46,6 +46,7 @@ THE SOFTWARE.
#define OP_FBHDA_PALETTE_SET 0x1110 /* VXD, DRV, ESCAPE_DRV_NT */
#define OP_FBHDA_PALETTE_GET 0x1111 /* VXD, DRV, ESCAPE_DRV_NT */
#define OP_FBHDA_ACCESS_RECT 0x1112 /* VXD, DRV, ESCAPE_DRV_NT */
+#define OB_FBHDA_OVERLAY 0x1113 /* VXD, ESCAPE_DRV_NT */
#define OP_SVGA_VALID 0x2000 /* VXD, DRV, ESCAPE_DRV_NT */
#define OP_SVGA_SETMODE 0x2001 /* DRV */
@@ -91,6 +92,18 @@ THE SOFTWARE.
# define FBPTR *
#endif
+#define FBHA_OVERLAYS_MAX 16
+
+typedef struct FBHDA_overlay
+{
+#ifndef FBHDA_SIXTEEN
+ void *ptr;
+#else
+ DWORD ptr32;
+#endif
+ DWORD size;
+} FBHDA_overlay_t;
+
typedef struct FBHDA
{
DWORD cb;
@@ -111,6 +124,15 @@ typedef struct FBHDA
#endif
DWORD vram_size;
char vxdname[16]; /* file name or "NT" */
+ DWORD overlay;
+ FBHDA_overlay_t overlays[FBHA_OVERLAYS_MAX];
+ DWORD overlays_size;
+ DWORD gamma; // fixed decimal point, 65536 = 1.0
+ DWORD res1;
+ DWORD res2;
+ DWORD res3;
+ DWORD res4;
+ DWORD res5;
} FBHDA_t;
#define FB_SUPPORT_FLIPING 1
@@ -145,9 +167,9 @@ void FBHDA_access_end(DWORD flags);
void FBHDA_access_rect(DWORD left, DWORD top, DWORD right, DWORD bottom);
BOOL FBHDA_swap(DWORD offset);
void FBHDA_clean();
-
void FBHDA_palette_set(unsigned char index, DWORD rgb);
DWORD FBHDA_palette_get(unsigned char index);
+DWORD FBHDA_overlay(DWORD overlay, DWORD width, DWORD height, DWORD bpp);
/* mouse */
#ifdef FBHDA_SIXTEEN
diff --git a/dddrv.c b/dddrv.c
index fc351f7..e7244f9 100644
--- a/dddrv.c
+++ b/dddrv.c
@@ -239,7 +239,6 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
WORD bytes_per_pixel;
// static DWORD dwpFOURCCs[3];
// DWORD bufpos;
- DWORD screenSize;
LPDWORD pGbl, pHAL;
LPDDHAL_DDEXEBUFCALLBACKS pExeBuf;
@@ -296,9 +295,7 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
*/
hal->ddHALInfo.vmiData.dwNumHeaps = 0;
heap = 0;
- can_flip = TRUE;
-
- screenSize = hal->ddHALInfo.vmiData.lDisplayPitch * hal->ddHALInfo.vmiData.dwDisplayHeight;
+ can_flip = hda->flags & FB_SUPPORT_FLIPING;
vidMem[0].dwFlags = VIDMEM_ISLINEAR;
vidMem[0].ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
@@ -308,7 +305,7 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
vidMem[0].fpStart += hda->stride; // extra backbuffer for vGPU9 present
}
- vidMem[0].fpEnd = hda->vram_pm32 + hda->vram_size - 1;
+ vidMem[0].fpEnd = hda->vram_pm32 + hda->vram_size - hda->overlays_size - 1;
hal->ddHALInfo.vmiData.dwNumHeaps = 1;
@@ -400,16 +397,11 @@ static void buildDDHALInfo(VMDAHAL_t __far *hal, int modeidx)
// DDFXCAPS_BLTROTATION90
hal->ddHALInfo.ddCaps.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN |
- DDSCAPS_PRIMARYSURFACE |
DDSCAPS_ALPHA;
if(can_flip)
{
- hal->ddHALInfo.ddCaps.ddsCaps.dwCaps |= DDSCAPS_FLIP;
- }
- else
- {
- hal->ddHALInfo.ddCaps.ddsCaps.dwCaps &= ~DDSCAPS_FLIP;
+ hal->ddHALInfo.ddCaps.ddsCaps.dwCaps |= DDSCAPS_FLIP | DDSCAPS_PRIMARYSURFACE;
}
/*
diff --git a/makefile b/makefile
index be492e6..b036288 100644
--- a/makefile
+++ b/makefile
@@ -36,7 +36,7 @@ FIXLINK_CC = wcl386 -q fixlink\fixlink.c -fe=$(FIXLINK_EXE)
#FLAGS += -DHWBLT
# Set DBGPRINT to add debug printf logging.
-#DBGPRINT = 1
+DBGPRINT = 1
!ifdef DBGPRINT
FLAGS += -DDBGPRINT
diff --git a/vxd_fbhda.c b/vxd_fbhda.c
index 0fe8f5b..ca20438 100644
--- a/vxd_fbhda.c
+++ b/vxd_fbhda.c
@@ -75,7 +75,8 @@ void FBHDA_release_hw()
FBHDA_t *FBHDA_setup()
{
- dbg_printf(dbg_fbhda_setup);
+ dbg_printf("FBHDA_setup()\n");
+ dbg_printf("sizeof(FBHDA_t) = %ld\n", sizeof(FBHDA_t));
return hda;
}
diff --git a/vxd_lib.c b/vxd_lib.c
index 2e53cbb..b8e43a8 100644
--- a/vxd_lib.c
+++ b/vxd_lib.c
@@ -85,6 +85,36 @@ void *memcpy(void *dst, const void *src, unsigned int size)
return dst;
}
+unsigned int strlen(const char *s)
+{
+ const char *ptr = s;
+ while(*ptr != '\0') ptr++;
+ return ptr - s;
+}
+
+char *strcpy(char *dst, const char *src)
+{
+ char *pdst = dst;
+
+ while(*src != '\0')
+ {
+ *pdst = *src;
+ src++;
+ pdst++;
+ }
+
+ *pdst = '\0';
+
+ return dst;
+}
+
+char *strcat(char *dst, const char *src)
+{
+ unsigned int i = strlen(dst);
+ strcpy(dst+i, src);
+ return dst;
+}
+
/* temp for reading registry */
static union
{
@@ -142,7 +172,7 @@ BOOL RegReadConf(UINT root, const char *path, const char *name, DWORD *out)
**/
DWORD Get_VMM_Version()
{
- static WORD ver = 0;
+ WORD ver = 0;
_asm push ecx
_asm push eax
@@ -157,11 +187,8 @@ DWORD Get_VMM_Version()
volatile void __cdecl Begin_Critical_Section(ULONG Flags)
{
- static ULONG sFlags;
- sFlags = Flags;
-
_asm push ecx
- _asm mov ecx, [sFlags]
+ _asm mov ecx, [Flags]
VMMCall(Begin_Critical_Section);
_asm pop ecx
}
@@ -173,48 +200,37 @@ volatile void __cdecl End_Critical_Section()
ULONG __cdecl Create_Semaphore(ULONG TokenCount)
{
- static ULONG sTokenCount;
- static ULONG sSemHandle;
- sTokenCount = TokenCount;
- sSemHandle = 0;
-
+ ULONG SemHandle = 0;
+
_asm push eax
_asm push ecx
- _asm mov ecx, [sTokenCount]
+ _asm mov ecx, [TokenCount]
VMMCall(Create_Semaphore);
_asm {
jc create_sem_error
- mov [sSemHandle], eax
+ mov [SemHandle], eax
create_sem_error:
pop ecx
pop eax
}
- return sSemHandle;
+ return SemHandle;
}
void __cdecl Destroy_Semaphore(ULONG SemHandle)
{
- static ULONG sSemHandle;
- sSemHandle = SemHandle;
-
_asm push eax
- _asm mov eax, [sSemHandle]
+ _asm mov eax, [SemHandle]
VMMCall(Destroy_Semaphore);
_asm pop eax
}
void __cdecl Wait_Semaphore(ULONG semHandle, ULONG flags)
{
- static ULONG sSemHandle;
- static ULONG sFlags;
- sSemHandle = semHandle;
- sFlags = flags;
-
_asm push eax
_asm push ecx
- _asm mov eax, [sSemHandle]
- _asm mov ecx, [sFlags]
+ _asm mov eax, [semHandle]
+ _asm mov ecx, [flags]
VMMCall(Wait_Semaphore);
_asm pop ecx
_asm pop eax
@@ -222,22 +238,16 @@ void __cdecl Wait_Semaphore(ULONG semHandle, ULONG flags)
void __cdecl Signal_Semaphore(ULONG SemHandle)
{
- static ULONG sSemHandle;
- sSemHandle = SemHandle;
-
_asm push eax
- _asm mov eax, [sSemHandle]
+ _asm mov eax, [SemHandle]
VMMCall(Signal_Semaphore);
_asm pop eax
}
void __cdecl Resume_VM(ULONG VM)
{
- static ULONG sVM;
- sVM = VM;
-
_asm push ebx
- _asm mov ebx, [sVM]
+ _asm mov ebx, [VM]
VMMCall(Resume_VM);
_asm pop ebx
}
@@ -249,19 +259,14 @@ void Release_Time_Slice()
void __cdecl *Map_Flat(BYTE SegOffset, BYTE OffOffset)
{
- static BYTE sSegOffset;
- static BYTE sOffOffset;
- static void *result;
-
- sSegOffset = SegOffset;
- sOffOffset = OffOffset;
+ void *result = NULL;
_asm
{
push eax
xor eax, eax
- mov al, [sOffOffset]
- mov ah, [sSegOffset]
+ mov al, [OffOffset]
+ mov ah, [SegOffset]
}
VMMCall(Map_Flat);
_asm
@@ -275,12 +280,6 @@ void __cdecl *Map_Flat(BYTE SegOffset, BYTE OffOffset)
void __cdecl Install_IO_Handler(DWORD port, DWORD callback)
{
- static DWORD sPort = 0;
- static DWORD sCallback = 0;
-
- sPort = port;
- sCallback = callback;
-
/*
* esi <- IOCallback
* edx <- I/O port numbers
@@ -289,8 +288,8 @@ void __cdecl Install_IO_Handler(DWORD port, DWORD callback)
{
push esi
push edx
- mov esi, [sCallback]
- mov edx, [sPort]
+ mov esi, [callback]
+ mov edx, [port]
}
VMMCall(Install_IO_Handler);
_asm
@@ -302,8 +301,8 @@ void __cdecl Install_IO_Handler(DWORD port, DWORD callback)
DWORD __cdecl _GetFreePageCount(DWORD *pLockablePages)
{
- static DWORD sLockablePages = 0;
- static DWORD sFreePages = 0;
+ DWORD LockablePages = 0;
+ DWORD FreePages = 0;
_asm
{
push edx
@@ -313,19 +312,19 @@ DWORD __cdecl _GetFreePageCount(DWORD *pLockablePages)
VMMCall(_GetFreePageCount);
_asm
{
- mov [sLockablePages], edx
- mov [sFreePages], eax
+ mov [LockablePages], edx
+ mov [FreePages], eax
pop eax
pop ecx
pop edx
}
- if(pLockablePages != NULL)
+ if(LockablePages != NULL)
{
- *pLockablePages = sLockablePages;
+ *pLockablePages = LockablePages;
}
- return sFreePages;
+ return FreePages;
}
static void __declspec(naked) __cdecl _BuildDescriptorDWORDs_(ULONG DESCBase, ULONG DESCLimit, ULONG DESCType, ULONG DESCSize, ULONG flags)
@@ -335,18 +334,18 @@ static void __declspec(naked) __cdecl _BuildDescriptorDWORDs_(ULONG DESCBase, UL
void __cdecl _BuildDescriptorDWORDs(ULONG DESCBase, ULONG DESCLimit, ULONG DESCType, ULONG DESCSize, ULONG flags, DWORD *outDescHigh, DWORD *outDescLow)
{
- static DWORD sHigh;
- static DWORD sLow;
+ DWORD High = 0;
+ DWORD Low = 0;
_BuildDescriptorDWORDs_(DESCBase, DESCLimit, DESCType, DESCSize, flags);
_asm
{
- mov [sHigh], edx
- mov [sLow], eax
+ mov [High], edx
+ mov [Low], eax
}
- *outDescHigh = sHigh;
- *outDescLow = sLow;
+ *outDescHigh = High;
+ *outDescLow = Low;
}
static void __declspec(naked) __cdecl _Allocate_LDT_Selector_(ULONG vm, ULONG DescHigh, ULONG DescLow, ULONG Count, ULONG flags)
@@ -356,8 +355,8 @@ static void __declspec(naked) __cdecl _Allocate_LDT_Selector_(ULONG vm, ULONG De
void __cdecl _Allocate_LDT_Selector(ULONG vm, ULONG DescHigh, ULONG DescLow, ULONG Count, ULONG flags, DWORD *outFirstSelector, DWORD *outSelectorTable)
{
- static DWORD firstSelector;
- static DWORD selectorTable;
+ DWORD firstSelector = 0;
+ DWORD selectorTable = 0;
_Allocate_LDT_Selector_(vm, DescHigh, DescLow, Count, flags);
_asm
@@ -384,8 +383,8 @@ static void __declspec(naked) __cdecl _Allocate_GDT_Selector_(ULONG DescHigh, UL
void __cdecl _Allocate_GDT_Selector(ULONG DescHigh, ULONG DescLow, ULONG flags, DWORD *outFirstSelector, DWORD *outSelectorTable)
{
- static DWORD firstSelector;
- static DWORD selectorTable;
+ DWORD firstSelector = 0;
+ DWORD selectorTable = 0;
_Allocate_GDT_Selector_(DescHigh, DescLow, flags);
_asm
@@ -479,37 +478,27 @@ DWORD __declspec(naked) __cdecl _RegQueryValueEx(DWORD hKey, char *lpszValueName
void Enable_Global_Trapping(DWORD port)
{
- static DWORD sPort = 0;
- sPort = port;
-
_asm push edx
- _asm mov edx, [sPort];
+ _asm mov edx, [port];
VMMCall(Enable_Global_Trapping);
_asm pop edx
}
void Disable_Global_Trapping(DWORD port)
{
- static DWORD sPort = 0;
- sPort = port;
-
_asm push edx
- _asm mov edx, [sPort];
+ _asm mov edx, [port];
VMMCall(Disable_Global_Trapping);
_asm pop edx
}
BOOL VPICD_Virtualize_IRQ(struct _VPICD_IRQ_Descriptor *vid)
{
- static VPICD_IRQ_Descriptor *svid;
- static BOOL r;
-
- r = 0;
- svid = vid;
+ BOOL r = 0;
_asm {
push edi
- mov edi, [svid]
+ mov edi, [vid]
};
VxDCall(VPICD, Virtualize_IRQ)
_asm {
diff --git a/vxd_lib.h b/vxd_lib.h
index 96453e5..9f29f20 100644
--- a/vxd_lib.h
+++ b/vxd_lib.h
@@ -26,6 +26,9 @@ THE SOFTWARE.
void memset(void *dst, int c, unsigned int size);
void *memcpy(void *dst, const void *src, unsigned int size);
+unsigned int strlen(const char *s);
+char *strcpy(char *dst, const char *src);
+char *strcat(char *dst, const char *src);
BOOL RegReadConf(UINT root, const char *path, const char *name, DWORD *out);
diff --git a/vxd_main.c b/vxd_main.c
index c61e33e..966adb5 100644
--- a/vxd_main.c
+++ b/vxd_main.c
@@ -403,22 +403,55 @@ void __declspec(naked) VXD_API_entry()
}
}
-static char reg_path[] = "Software\\vmdisp9x";
-static char reg_force_sw[] = "FORCE_SOFTWARE";
-static char reg_force_qemu3dfx[] = "FORCE_QEMU3DFX";
+const char reg_path[] = "Software\\vmdisp9x";
static void configure_FBHDA()
{
FBHDA_t *fbhda;
DWORD force_sw = 0;
DWORD force_qemu3dfx = 0;
+ int i;
+ char buf[32];
fbhda = FBHDA_setup();
if(fbhda)
- {
- RegReadConf(HKEY_LOCAL_MACHINE, reg_path, reg_force_sw, &force_sw);
- RegReadConf(HKEY_LOCAL_MACHINE, reg_path, reg_force_qemu3dfx, &force_qemu3dfx);
+ {
+ RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "FORCE_SOFTWARE", &force_sw);
+ RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "FORCE_QEMU3DFX", &force_qemu3dfx);
+
+ for(i = 1; i < FBHA_OVERLAYS_MAX; i++)
+ {
+ char *ptr;
+ strcpy(buf, "OVERLAY_");
+
+ ptr = buf + strlen(buf);
+ if(i >= 10)
+ {
+ *ptr = '0' + (i/10);
+ ptr++;
+ }
+ *ptr = '0' + (i % 10);
+ ptr++;
+ *ptr = '\0';
+ strcat(buf, "_SIZE");
+
+ fbhda->overlays[i].size = 0;
+
+ RegReadConf(HKEY_LOCAL_MACHINE, reg_path, buf, &fbhda->overlays[i].size);
+
+ if(fbhda->overlays[i].size > 0)
+ {
+ fbhda->overlays_size += fbhda->overlays[i].size;
+ fbhda->overlays[i].ptr = ((BYTE*)fbhda->vram_pm32) + fbhda->vram_size - fbhda->overlays_size;
+ }
+ else
+ {
+ fbhda->overlays[i].ptr = 0;
+ }
+
+ dbg_printf("Overlay #%d: %ld\n", fbhda->overlays[i].size);
+ }
if(force_sw)
{
@@ -543,6 +576,10 @@ DWORD __stdcall Device_IO_Control_proc(DWORD vmhandle, struct DIOCParams *params
rc = 0;
break;
#ifdef SVGA
+ case OB_FBHDA_OVERLAY:
+ //outBuf[0] = FBHDA_overlay(inBuf[0], inBuf[1], inBuf[2], inBuf[3]);
+ rc = 0;
+ break;
case OP_SVGA_VALID:
outBuf[0] = SVGA_valid();
rc = 0;
diff --git a/vxd_strings.h b/vxd_strings.h
index 3c9784b..a41cdd1 100644
--- a/vxd_strings.h
+++ b/vxd_strings.h
@@ -88,8 +88,6 @@ DSTR(dbg_vbe_init, "Bochs VBE: vram: %X, size: %ld\n");
DSTR(dbg_vbe_lfb, "LFB at %X\n");
-DSTR(dbg_fbhda_setup, "FBHDA_setup()\n");
-
DSTR(dbg_mouse_cur, "Mouse %d %d %d %d\n");
DSTR(dbg_flatptr, "Flatptr: %X\n");
diff --git a/vxd_svga.c b/vxd_svga.c
index 1c98243..4493893 100644
--- a/vxd_svga.c
+++ b/vxd_svga.c
@@ -676,12 +676,14 @@ DWORD SVGA_pitch(DWORD width, DWORD bpp)
return (bp * width + 3) & 0xFFFFFFFC;
}
-static void SVGA_defineScreen(DWORD w, DWORD h, DWORD bpp)
+static void SVGA_defineScreen(DWORD w, DWORD h, DWORD bpp, DWORD offset)
{
SVGAFifoCmdDefineScreen *screen;
SVGAFifoCmdDefineGMRFB *fbgmr;
DWORD cmdoff = 0;
+ DWORD pitch = SVGA_pitch(w, bpp);
+
wait_for_cmdbuf();
screen = SVGA_cmd_ptr(cmdbuf, &cmdoff, SVGA_CMD_DEFINE_SCREEN, sizeof(SVGAFifoCmdDefineScreen));
@@ -698,10 +700,10 @@ static void SVGA_defineScreen(DWORD w, DWORD h, DWORD bpp)
if(bpp < 32)
{
- screen->screen.backingStore.pitch = SVGA_pitch(w, bpp);
+ screen->screen.backingStore.pitch = pitch;
}
- screen->screen.backingStore.ptr.offset = 0;
+ screen->screen.backingStore.ptr.offset = offset;
screen->screen.backingStore.ptr.gmrId = SVGA_GMR_FRAMEBUFFER;
/* set GMR to same location as screen */
@@ -712,8 +714,8 @@ static void SVGA_defineScreen(DWORD w, DWORD h, DWORD bpp)
if(fbgmr)
{
fbgmr->ptr.gmrId = SVGA_GMR_FRAMEBUFFER;
- fbgmr->ptr.offset = 0;
- fbgmr->bytesPerLine = SVGA_pitch(w, bpp);
+ fbgmr->ptr.offset = offset;
+ fbgmr->bytesPerLine = pitch;
fbgmr->format.colorDepth = bpp;
if(bpp >= 24)
{
@@ -842,7 +844,7 @@ BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
{
if(!st_useable(bpp))
{
- SVGA_defineScreen(w, h, bpp);
+ SVGA_defineScreen(w, h, bpp, 0);
/* reenable fifo */
SVGA_Enable();
@@ -860,6 +862,8 @@ BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
SVGA_Flush_CB();
+ hda->flags &= ~((DWORD)FB_SUPPORT_FLIPING);
+
if(st_useable(bpp))
{
SVGA_CB_stop();
@@ -871,6 +875,11 @@ BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
else
{
hda->flags &= ~((DWORD)FB_ACCEL_VMSVGA10_ST);
+
+ if(bpp >= 15)
+ {
+ hda->flags |= FB_SUPPORT_FLIPING;
+ }
}
if(st_useable(bpp))
@@ -1070,6 +1079,41 @@ BOOL SVGA_valid()
BOOL FBHDA_swap(DWORD offset)
{
+ if(hda->bpp == 32)
+ {
+ FBHDA_access_begin(0);
+ SVGA_defineScreen(hda->width, hda->height, hda->bpp, offset);
+ hda->surface = offset;
+ FBHDA_access_end(0);
+
+ return TRUE;
+ }
+ else
+ {
+ DWORD ps = (hda->bpp + 7) / 8;
+ DWORD offset_y = offset/hda->pitch;
+ DWORD offset_x = (offset % hda->pitch)/ps;
+
+ if(offset_y > 0 || offset_x > 0)
+ {
+ offset_y = 1;
+ offset_x = 0;
+ }
+
+ SVGA_WriteReg(SVGA_REG_NUM_GUEST_DISPLAYS, 1);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_ID, 0);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_IS_PRIMARY, 1);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_POSITION_X, offset_x);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_POSITION_Y, offset_y);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_WIDTH, hda->width);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_HEIGHT, hda->height);
+ SVGA_WriteReg(SVGA_REG_DISPLAY_ID, SVGA_ID_INVALID);
+
+ hda->surface = offset;
+
+ return TRUE;
+ }
+
return FALSE;
}