Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR MIT */
0002 /*
0003  * Copyright 2007-2021 VMware, Inc.
0004  *
0005  * Permission is hereby granted, free of charge, to any person
0006  * obtaining a copy of this software and associated documentation
0007  * files (the "Software"), to deal in the Software without
0008  * restriction, including without limitation the rights to use, copy,
0009  * modify, merge, publish, distribute, sublicense, and/or sell copies
0010  * of the Software, and to permit persons to whom the Software is
0011  * furnished to do so, subject to the following conditions:
0012  *
0013  * The above copyright notice and this permission notice shall be
0014  * included in all copies or substantial portions of the Software.
0015  *
0016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0017  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0018  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0019  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
0020  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
0021  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0022  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0023  * SOFTWARE.
0024  *
0025  */
0026 
0027 /*
0028  * svga_overlay.h --
0029  *
0030  *    Definitions for video-overlay support.
0031  */
0032 
0033 
0034 
0035 #ifndef _SVGA_OVERLAY_H_
0036 #define _SVGA_OVERLAY_H_
0037 
0038 #include "svga_reg.h"
0039 
0040 #if defined __cplusplus
0041 extern "C" {
0042 #endif
0043 
0044 #define VMWARE_FOURCC_YV12 0x32315659
0045 #define VMWARE_FOURCC_YUY2 0x32595559
0046 #define VMWARE_FOURCC_UYVY 0x59565955
0047 
0048 typedef enum {
0049     SVGA_OVERLAY_FORMAT_INVALID = 0,
0050     SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12,
0051     SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2,
0052     SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY,
0053 } SVGAOverlayFormat;
0054 
0055 #define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff
0056 
0057 #define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000
0058 
0059 #define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001
0060 
0061 #define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002
0062 
0063 typedef struct SVGAEscapeVideoSetRegs {
0064     struct {
0065         uint32 cmdType;
0066         uint32 streamId;
0067     } header;
0068 
0069     struct {
0070         uint32 registerId;
0071         uint32 value;
0072     } items[1];
0073 } SVGAEscapeVideoSetRegs;
0074 
0075 typedef struct SVGAEscapeVideoFlush {
0076     uint32 cmdType;
0077     uint32 streamId;
0078 } SVGAEscapeVideoFlush;
0079 
0080 #pragma pack(push, 1)
0081 typedef struct {
0082     uint32 command;
0083     uint32 overlay;
0084 } SVGAFifoEscapeCmdVideoBase;
0085 #pragma pack(pop)
0086 
0087 #pragma pack(push, 1)
0088 typedef struct {
0089     SVGAFifoEscapeCmdVideoBase videoCmd;
0090 } SVGAFifoEscapeCmdVideoFlush;
0091 #pragma pack(pop)
0092 
0093 #pragma pack(push, 1)
0094 typedef struct {
0095     SVGAFifoEscapeCmdVideoBase videoCmd;
0096     struct {
0097         uint32 regId;
0098         uint32 value;
0099     } items[1];
0100 } SVGAFifoEscapeCmdVideoSetRegs;
0101 #pragma pack(pop)
0102 
0103 #pragma pack(push, 1)
0104 typedef struct {
0105     SVGAFifoEscapeCmdVideoBase videoCmd;
0106     struct {
0107         uint32 regId;
0108         uint32 value;
0109     } items[SVGA_VIDEO_NUM_REGS];
0110 } SVGAFifoEscapeCmdVideoSetAllRegs;
0111 #pragma pack(pop)
0112 
0113 #if defined __cplusplus
0114 }
0115 #endif
0116 
0117 #endif