[common] kvmfr: add damage rectangles to the protocol

Co-Authored-By: Tudor Brindus <me@tbrindus.ca>
This commit is contained in:
Quantum 2021-07-10 18:38:44 -04:00 committed by Geoffrey McRae
parent 38a018ebfa
commit 69b20aee05
2 changed files with 27 additions and 12 deletions

View File

@ -28,7 +28,9 @@
#include "types.h" #include "types.h"
#define KVMFR_MAGIC "KVMFR---" #define KVMFR_MAGIC "KVMFR---"
#define KVMFR_VERSION 10 #define KVMFR_VERSION 11
#define KVMFR_MAX_DAMAGE_RECTS 64
#define LGMP_Q_POINTER 1 #define LGMP_Q_POINTER 1
#define LGMP_Q_FRAME 2 #define LGMP_Q_FRAME 2
@ -66,17 +68,19 @@ KVMFRCursor;
typedef struct KVMFRFrame typedef struct KVMFRFrame
{ {
uint32_t formatVer; // the frame format version number uint32_t formatVer; // the frame format version number
FrameType type; // the frame data type FrameType type; // the frame data type
uint32_t width; // the frame width uint32_t width; // the frame width
uint32_t height; // the frame height uint32_t height; // the frame height
uint32_t realHeight; // the real height if the frame was truncated due to low mem uint32_t realHeight; // the real height if the frame was truncated due to low mem
FrameRotation rotation; // the frame rotation FrameRotation rotation; // the frame rotation
uint32_t stride; // the row stride (zero if compressed data) uint32_t stride; // the row stride (zero if compressed data)
uint32_t pitch; // the row pitch (stride in bytes or the compressed frame size) uint32_t pitch; // the row pitch (stride in bytes or the compressed frame size)
uint32_t offset; // offset from the start of this header to the FrameBuffer header uint32_t offset; // offset from the start of this header to the FrameBuffer header
uint32_t mouseScalePercent; // movement scale factor of the mouse (relates to DPI of display, 100 = no scale) uint32_t damageRectsCount; // the number of damage rectangles (zero for full-frame damage)
bool blockScreensaver; // whether the guest has requested to block screensavers FrameDamageRect damageRects[KVMFR_MAX_DAMAGE_RECTS];
uint32_t mouseScalePercent; // movement scale factor of the mouse (relates to DPI of display, 100 = no scale)
bool blockScreensaver; // whether the guest has requested to block screensavers
} }
KVMFRFrame; KVMFRFrame;

View File

@ -21,6 +21,8 @@
#ifndef _LG_TYPES_H_ #ifndef _LG_TYPES_H_
#define _LG_TYPES_H_ #define _LG_TYPES_H_
#include <stdint.h>
struct Point struct Point
{ {
int x, y; int x, y;
@ -61,6 +63,15 @@ typedef enum FrameRotation
} }
FrameRotation; FrameRotation;
typedef struct FrameDamageRect
{
uint32_t x;
uint32_t y;
uint32_t width;
uint32_t height;
}
FrameDamageRect;
extern const char * FrameTypeStr[FRAME_TYPE_MAX]; extern const char * FrameTypeStr[FRAME_TYPE_MAX];
typedef enum CursorType typedef enum CursorType