1 /* SPDX-License-Identifier: GPL-2.0 OR MIT */ 2 /* 3 * Copyright (c) 2007-2021 Broadcom. All Rights Reserved. The term 4 * "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. 5 * 6 * Permission is hereby granted, free of charge, to any person 7 * obtaining a copy of this software and associated documentation 8 * files (the "Software"), to deal in the Software without 9 * restriction, including without limitation the rights to use, copy, 10 * modify, merge, publish, distribute, sublicense, and/or sell copies 11 * of the Software, and to permit persons to whom the Software is 12 * furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice shall be 15 * included in all copies or substantial portions of the Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 24 * SOFTWARE. 25 * 26 */ 27 28 /* 29 * svga_overlay.h -- 30 * 31 * Definitions for video-overlay support. 32 */ 33 34 #ifndef _SVGA_OVERLAY_H_ 35 #define _SVGA_OVERLAY_H_ 36 37 #include "svga_reg.h" 38 39 #if defined __cplusplus 40 extern "C" { 41 #endif 42 43 #define VMWARE_FOURCC_YV12 0x32315659 44 #define VMWARE_FOURCC_YUY2 0x32595559 45 #define VMWARE_FOURCC_UYVY 0x59565955 46 47 typedef enum { 48 SVGA_OVERLAY_FORMAT_INVALID = 0, 49 SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12, 50 SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2, 51 SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY, 52 } SVGAOverlayFormat; 53 54 #define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff 55 56 #define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000 57 58 #define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001 59 60 #define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002 61 62 typedef struct SVGAEscapeVideoSetRegs { 63 struct { 64 uint32 cmdType; 65 uint32 streamId; 66 } header; 67 68 struct { 69 uint32 registerId; 70 uint32 value; 71 } items[1]; 72 } SVGAEscapeVideoSetRegs; 73 74 typedef struct SVGAEscapeVideoFlush { 75 uint32 cmdType; 76 uint32 streamId; 77 } SVGAEscapeVideoFlush; 78 79 #pragma pack(push, 1) 80 typedef struct { 81 uint32 command; 82 uint32 overlay; 83 } SVGAFifoEscapeCmdVideoBase; 84 #pragma pack(pop) 85 86 #pragma pack(push, 1) 87 typedef struct { 88 SVGAFifoEscapeCmdVideoBase videoCmd; 89 } SVGAFifoEscapeCmdVideoFlush; 90 #pragma pack(pop) 91 92 #pragma pack(push, 1) 93 typedef struct { 94 SVGAFifoEscapeCmdVideoBase videoCmd; 95 struct { 96 uint32 regId; 97 uint32 value; 98 } items[1]; 99 } SVGAFifoEscapeCmdVideoSetRegs; 100 #pragma pack(pop) 101 102 #pragma pack(push, 1) 103 typedef struct { 104 SVGAFifoEscapeCmdVideoBase videoCmd; 105 struct { 106 uint32 regId; 107 uint32 value; 108 } items[SVGA_VIDEO_NUM_REGS]; 109 } SVGAFifoEscapeCmdVideoSetAllRegs; 110 #pragma pack(pop) 111 112 #if defined __cplusplus 113 } 114 #endif 115 116 #endif 117