1 | /* $Id: VBoxDispVrdpBmp.h 76563 2019-01-01 03:53:56Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * VBox XPDM Display driver
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2011-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_xpdm_VBoxDispVrdpBmp_h
|
---|
19 | #define GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_xpdm_VBoxDispVrdpBmp_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | /* RDP cache holds about 350 tiles 64x64. Therefore
|
---|
25 | * the driver does not have to cache more then the
|
---|
26 | * RDP capacity. Most of bitmaps will be tiled, so
|
---|
27 | * number of RDP tiles will be greater than number of
|
---|
28 | * bitmaps. Also the number of bitmaps must be a power
|
---|
29 | * of 2. So the 256 is a good number.
|
---|
30 | */
|
---|
31 | #define VRDPBMP_N_CACHED_BITMAPS (256)
|
---|
32 |
|
---|
33 | #define VRDPBMP_RC_NOT_CACHED (0x0000)
|
---|
34 | #define VRDPBMP_RC_CACHED (0x0001)
|
---|
35 | #define VRDPBMP_RC_ALREADY_CACHED (0x0002)
|
---|
36 |
|
---|
37 | #define VRDPBMP_RC_F_DELETED (0x10000)
|
---|
38 |
|
---|
39 | /* Bitmap hash. */
|
---|
40 | #pragma pack (1)
|
---|
41 | typedef struct _VRDPBCHASH
|
---|
42 | {
|
---|
43 | /* A 64 bit hash value of pixels. */
|
---|
44 | uint64_t hash64;
|
---|
45 |
|
---|
46 | /* Bitmap width. */
|
---|
47 | uint16_t cx;
|
---|
48 |
|
---|
49 | /* Bitmap height. */
|
---|
50 | uint16_t cy;
|
---|
51 |
|
---|
52 | /* Bytes per pixel at the bitmap. */
|
---|
53 | uint8_t bytesPerPixel;
|
---|
54 |
|
---|
55 | /* Padding to 16 bytes. */
|
---|
56 | uint8_t padding[3];
|
---|
57 | } VRDPBCHASH;
|
---|
58 | #pragma pack ()
|
---|
59 |
|
---|
60 | #define VRDP_BC_ENTRY_STATUS_EMPTY 0
|
---|
61 | #define VRDP_BC_ENTRY_STATUS_TEMPORARY 1
|
---|
62 | #define VRDP_BC_ENTRY_STATUS_CACHED 2
|
---|
63 |
|
---|
64 | typedef struct _VRDPBCENTRY
|
---|
65 | {
|
---|
66 | struct _VRDPBCENTRY *next;
|
---|
67 | struct _VRDPBCENTRY *prev;
|
---|
68 | VRDPBCHASH hash;
|
---|
69 | uint32_t u32Status;
|
---|
70 | } VRDPBCENTRY;
|
---|
71 |
|
---|
72 | typedef struct _VRDPBC
|
---|
73 | {
|
---|
74 | VRDPBCENTRY *headTmp;
|
---|
75 | VRDPBCENTRY *tailTmp;
|
---|
76 | VRDPBCENTRY *headCached;
|
---|
77 | VRDPBCENTRY *tailCached;
|
---|
78 | VRDPBCENTRY aEntries[VRDPBMP_N_CACHED_BITMAPS];
|
---|
79 | } VRDPBC;
|
---|
80 |
|
---|
81 | void vrdpbmpReset (VRDPBC *pCache);
|
---|
82 | int vrdpbmpCacheSurface (VRDPBC *pCache, const SURFOBJ *pso, VRDPBCHASH *phash, VRDPBCHASH *phashDeleted, BOOL bForce);
|
---|
83 |
|
---|
84 | #endif /* !GA_INCLUDED_SRC_WINNT_Graphics_Video_disp_xpdm_VBoxDispVrdpBmp_h */
|
---|