118 lines · c
1/* SPDX-License-Identifier: GPL-2.0 OR MIT */2/*3 * Copyright 2007-2021 VMware, Inc.4 *5 * Permission is hereby granted, free of charge, to any person6 * obtaining a copy of this software and associated documentation7 * files (the "Software"), to deal in the Software without8 * restriction, including without limitation the rights to use, copy,9 * modify, merge, publish, distribute, sublicense, and/or sell copies10 * of the Software, and to permit persons to whom the Software is11 * furnished to do so, subject to the following conditions:12 *13 * The above copyright notice and this permission notice shall be14 * included in all copies or substantial portions of the Software.15 *16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS20 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN21 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE23 * SOFTWARE.24 *25 */26 27/*28 * svga_overlay.h --29 *30 * Definitions for video-overlay support.31 */32 33 34 35#ifndef _SVGA_OVERLAY_H_36#define _SVGA_OVERLAY_H_37 38#include "svga_reg.h"39 40#if defined __cplusplus41extern "C" {42#endif43 44#define VMWARE_FOURCC_YV12 0x3231565945#define VMWARE_FOURCC_YUY2 0x3259555946#define VMWARE_FOURCC_UYVY 0x5956595547 48typedef enum {49 SVGA_OVERLAY_FORMAT_INVALID = 0,50 SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12,51 SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2,52 SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY,53} SVGAOverlayFormat;54 55#define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff56 57#define SVGA_ESCAPE_VMWARE_VIDEO 0x0002000058 59#define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x0002000160 61#define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x0002000262 63typedef struct SVGAEscapeVideoSetRegs {64 struct {65 uint32 cmdType;66 uint32 streamId;67 } header;68 69 struct {70 uint32 registerId;71 uint32 value;72 } items[1];73} SVGAEscapeVideoSetRegs;74 75typedef struct SVGAEscapeVideoFlush {76 uint32 cmdType;77 uint32 streamId;78} SVGAEscapeVideoFlush;79 80#pragma pack(push, 1)81typedef struct {82 uint32 command;83 uint32 overlay;84} SVGAFifoEscapeCmdVideoBase;85#pragma pack(pop)86 87#pragma pack(push, 1)88typedef struct {89 SVGAFifoEscapeCmdVideoBase videoCmd;90} SVGAFifoEscapeCmdVideoFlush;91#pragma pack(pop)92 93#pragma pack(push, 1)94typedef struct {95 SVGAFifoEscapeCmdVideoBase videoCmd;96 struct {97 uint32 regId;98 uint32 value;99 } items[1];100} SVGAFifoEscapeCmdVideoSetRegs;101#pragma pack(pop)102 103#pragma pack(push, 1)104typedef struct {105 SVGAFifoEscapeCmdVideoBase videoCmd;106 struct {107 uint32 regId;108 uint32 value;109 } items[SVGA_VIDEO_NUM_REGS];110} SVGAFifoEscapeCmdVideoSetAllRegs;111#pragma pack(pop)112 113#if defined __cplusplus114}115#endif116 117#endif118