xref: /linux/drivers/gpu/drm/vmwgfx/device_include/svga_overlay.h (revision 03ab8e6297acd1bc0eedaa050e2a1635c576fd11)
1*b05fa564SZack Rusin /* SPDX-License-Identifier: GPL-2.0 OR MIT */
2*b05fa564SZack Rusin /*
3ebc9ac7cSZack Rusin  * Copyright 2007-2021 VMware, Inc.
48ce75f8aSSinclair Yeh  *
58ce75f8aSSinclair Yeh  * Permission is hereby granted, free of charge, to any person
68ce75f8aSSinclair Yeh  * obtaining a copy of this software and associated documentation
78ce75f8aSSinclair Yeh  * files (the "Software"), to deal in the Software without
88ce75f8aSSinclair Yeh  * restriction, including without limitation the rights to use, copy,
98ce75f8aSSinclair Yeh  * modify, merge, publish, distribute, sublicense, and/or sell copies
108ce75f8aSSinclair Yeh  * of the Software, and to permit persons to whom the Software is
118ce75f8aSSinclair Yeh  * furnished to do so, subject to the following conditions:
128ce75f8aSSinclair Yeh  *
138ce75f8aSSinclair Yeh  * The above copyright notice and this permission notice shall be
148ce75f8aSSinclair Yeh  * included in all copies or substantial portions of the Software.
158ce75f8aSSinclair Yeh  *
168ce75f8aSSinclair Yeh  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
178ce75f8aSSinclair Yeh  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
188ce75f8aSSinclair Yeh  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
198ce75f8aSSinclair Yeh  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
208ce75f8aSSinclair Yeh  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
218ce75f8aSSinclair Yeh  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
228ce75f8aSSinclair Yeh  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
238ce75f8aSSinclair Yeh  * SOFTWARE.
248ce75f8aSSinclair Yeh  *
25*b05fa564SZack Rusin  */
268ce75f8aSSinclair Yeh 
278ce75f8aSSinclair Yeh /*
288ce75f8aSSinclair Yeh  * svga_overlay.h --
298ce75f8aSSinclair Yeh  *
308ce75f8aSSinclair Yeh  *    Definitions for video-overlay support.
318ce75f8aSSinclair Yeh  */
328ce75f8aSSinclair Yeh 
33ebc9ac7cSZack Rusin 
34ebc9ac7cSZack Rusin 
358ce75f8aSSinclair Yeh #ifndef _SVGA_OVERLAY_H_
368ce75f8aSSinclair Yeh #define _SVGA_OVERLAY_H_
378ce75f8aSSinclair Yeh 
388ce75f8aSSinclair Yeh #include "svga_reg.h"
398ce75f8aSSinclair Yeh 
40ebc9ac7cSZack Rusin #if defined __cplusplus
41ebc9ac7cSZack Rusin extern "C" {
42ebc9ac7cSZack Rusin #endif
438ce75f8aSSinclair Yeh 
44ebc9ac7cSZack Rusin #define VMWARE_FOURCC_YV12 0x32315659
45ebc9ac7cSZack Rusin #define VMWARE_FOURCC_YUY2 0x32595559
46ebc9ac7cSZack Rusin #define VMWARE_FOURCC_UYVY 0x59565955
478ce75f8aSSinclair Yeh 
488ce75f8aSSinclair Yeh typedef enum {
498ce75f8aSSinclair Yeh 	SVGA_OVERLAY_FORMAT_INVALID = 0,
508ce75f8aSSinclair Yeh 	SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12,
518ce75f8aSSinclair Yeh 	SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2,
528ce75f8aSSinclair Yeh 	SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY,
538ce75f8aSSinclair Yeh } SVGAOverlayFormat;
548ce75f8aSSinclair Yeh 
558ce75f8aSSinclair Yeh #define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff
568ce75f8aSSinclair Yeh 
578ce75f8aSSinclair Yeh #define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000
588ce75f8aSSinclair Yeh 
598ce75f8aSSinclair Yeh #define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001
608ce75f8aSSinclair Yeh 
618ce75f8aSSinclair Yeh #define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002
628ce75f8aSSinclair Yeh 
63ebc9ac7cSZack Rusin typedef struct SVGAEscapeVideoSetRegs {
648ce75f8aSSinclair Yeh 	struct {
658ce75f8aSSinclair Yeh 		uint32 cmdType;
668ce75f8aSSinclair Yeh 		uint32 streamId;
678ce75f8aSSinclair Yeh 	} header;
688ce75f8aSSinclair Yeh 
698ce75f8aSSinclair Yeh 	struct {
708ce75f8aSSinclair Yeh 		uint32 registerId;
718ce75f8aSSinclair Yeh 		uint32 value;
728ce75f8aSSinclair Yeh 	} items[1];
738ce75f8aSSinclair Yeh } SVGAEscapeVideoSetRegs;
748ce75f8aSSinclair Yeh 
75ebc9ac7cSZack Rusin typedef struct SVGAEscapeVideoFlush {
768ce75f8aSSinclair Yeh 	uint32 cmdType;
778ce75f8aSSinclair Yeh 	uint32 streamId;
788ce75f8aSSinclair Yeh } SVGAEscapeVideoFlush;
798ce75f8aSSinclair Yeh 
80ebc9ac7cSZack Rusin #pragma pack(push, 1)
81ebc9ac7cSZack Rusin typedef struct {
828ce75f8aSSinclair Yeh 	uint32 command;
838ce75f8aSSinclair Yeh 	uint32 overlay;
848ce75f8aSSinclair Yeh } SVGAFifoEscapeCmdVideoBase;
85ebc9ac7cSZack Rusin #pragma pack(pop)
868ce75f8aSSinclair Yeh 
87ebc9ac7cSZack Rusin #pragma pack(push, 1)
88ebc9ac7cSZack Rusin typedef struct {
898ce75f8aSSinclair Yeh 	SVGAFifoEscapeCmdVideoBase videoCmd;
908ce75f8aSSinclair Yeh } SVGAFifoEscapeCmdVideoFlush;
91ebc9ac7cSZack Rusin #pragma pack(pop)
928ce75f8aSSinclair Yeh 
93ebc9ac7cSZack Rusin #pragma pack(push, 1)
94ebc9ac7cSZack Rusin typedef struct {
958ce75f8aSSinclair Yeh 	SVGAFifoEscapeCmdVideoBase videoCmd;
968ce75f8aSSinclair Yeh 	struct {
978ce75f8aSSinclair Yeh 		uint32 regId;
988ce75f8aSSinclair Yeh 		uint32 value;
998ce75f8aSSinclair Yeh 	} items[1];
1008ce75f8aSSinclair Yeh } SVGAFifoEscapeCmdVideoSetRegs;
101ebc9ac7cSZack Rusin #pragma pack(pop)
1028ce75f8aSSinclair Yeh 
103ebc9ac7cSZack Rusin #pragma pack(push, 1)
104ebc9ac7cSZack Rusin typedef struct {
1058ce75f8aSSinclair Yeh 	SVGAFifoEscapeCmdVideoBase videoCmd;
1068ce75f8aSSinclair Yeh 	struct {
1078ce75f8aSSinclair Yeh 		uint32 regId;
1088ce75f8aSSinclair Yeh 		uint32 value;
1098ce75f8aSSinclair Yeh 	} items[SVGA_VIDEO_NUM_REGS];
1108ce75f8aSSinclair Yeh } SVGAFifoEscapeCmdVideoSetAllRegs;
111ebc9ac7cSZack Rusin #pragma pack(pop)
1128ce75f8aSSinclair Yeh 
113ebc9ac7cSZack Rusin #if defined __cplusplus
1148ce75f8aSSinclair Yeh }
115ebc9ac7cSZack Rusin #endif
1168ce75f8aSSinclair Yeh 
117ebc9ac7cSZack Rusin #endif
118