linux/drivers/gpu/drm/vmwgfx/device_include/svga3d_cmd.h

/* SPDX-License-Identifier: GPL-2.0 OR MIT */
/*
 * Copyright 2012-2021 VMware, Inc.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * files (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy,
 * modify, merge, publish, distribute, sublicense, and/or sell copies
 * of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 *
 */

/*
 * svga3d_cmd.h --
 *
 *    SVGA 3d hardware cmd definitions
 */



#ifndef _SVGA3D_CMD_H_
#define _SVGA3D_CMD_H_

#include "svga3d_types.h"
#include "svga3d_limits.h"
#include "svga_reg.h"

SVGAFifo3dCmdId;

#define SVGA_NUM_3D_CMD

#pragma pack(push, 1)
SVGA3dCmdHeader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dSurfaceFace;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineSurface_v2;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroySurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdClear;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dLightData;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdPresent;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dRenderState;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetRenderState;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetRenderTarget;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSurfaceCopy;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdIntraSurfaceCopy;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdWholeSurfaceCopy;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSurfaceStretchBltNonMSToMS;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSurfaceStretchBlt;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dSurfaceDMAFlags;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSurfaceDMA;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSurfaceDMASuffix;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dArrayRangeHint;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dArray;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dVertexArrayIdentity;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dVertexDecl;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dPrimitiveRange;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDrawPrimitives;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDraw;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDrawIndexed;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dVertexElement;
#pragma pack(pop)

#define SVGA3D_VERTEX_ELEMENT_RESPECT_STREAM

#pragma pack(push, 1)
SVGA3dCmdSetVertexDecls;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dVertexStream;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetVertexStreams;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetVertexDivisors;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dTextureState;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetTextureState;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetTransform;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dZRange;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetZRange;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dMaterial;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetMaterial;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetLightData;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetLightEnabled;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetViewport;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetScissorRect;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetClipPlane;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetShaderConst;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBeginQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdEndQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdWaitForQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dQueryResult;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBlitSurfaceToScreen;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdGenerateMipmaps;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdActivateSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDeactivateSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdScreenDMA;
#pragma pack(pop)

#define SVGA3D_LOTRANSBLT_HONORALPHA
#define SVGA3D_LOSTRETCHBLT_MIRRORX
#define SVGA3D_LOSTRETCHBLT_MIRRORY
#define SVGA3D_LOALPHABLEND_SRCHASALPHA

#pragma pack(push, 1)
SVGA3dCmdLogicOpsBitBlt;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdLogicOpsTransBlt;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdLogicOpsStretchBlt;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdLogicOpsColorFill;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdLogicOpsAlphaBlend;
#pragma pack(pop)

#define SVGA3D_CLEARTYPE_INVALID_GAMMA_INDEX

#define SVGA3D_CLEARTYPE_GAMMA_WIDTH
#define SVGA3D_CLEARTYPE_GAMMA_HEIGHT

#pragma pack(push, 1)
SVGA3dCmdLogicOpsClearTypeBlend;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAOTableMobEntry;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAOTableSurfaceEntry;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAOTableContextEntry;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAOTableShaderEntry;
#pragma pack(pop)

#define SVGA_STFLAG_PRIMARY
#define SVGA_STFLAG_RESERVED
SVGAScreenTargetFlags;

#pragma pack(push, 1)
SVGAOTableScreenTargetEntry;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dShaderConstFloat;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dShaderConstInt;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dShaderConstBool;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAGBVertexElement;
#pragma pack(pop)

#pragma pack(push, 1)
SVGAGBVertexStream;
#pragma pack(pop)
#pragma pack(push, 1)
SVGAGBContextData;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetOTableBase;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetOTableBase64;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdGrowOTable;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdReadbackOTable;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBMob;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyGBMob;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBMob64;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdRedefineGBMob64;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBMobMapping;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBSurface_v2;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBSurface_v3;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBSurface_v4;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBindGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBindGBSurfaceWithPitch;
#pragma pack(pop)

#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_READBACK
#define SVGA3D_COND_BIND_GB_SURFACE_FLAG_UPDATE

#pragma pack(push, 1)
SVGA3dCmdCondBindGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBImage;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdReadbackGBImage;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdReadbackGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdReadbackGBImagePartial;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdInvalidateGBImage;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdInvalidateGBSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdInvalidateGBImagePartial;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyGBContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBindGBContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdReadbackGBContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdInvalidateGBContext;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBindGBShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyGBShader;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdSetGBShaderConstInline;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBeginGBQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdEndGBQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdWaitForGBQuery;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdEnableGart;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdMapMobIntoGart;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUnmapGartRange;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDefineGBScreenTarget;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdDestroyGBScreenTarget;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdBindGBScreenTarget;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBScreenTarget;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBScreenTarget_v2;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateGBScreenTargetMove;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdGBScreenDMA;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdGBMobFence;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdScreenCopy;
#pragma pack(pop)

#define SVGA_SCREEN_COPY_STATUS_FAILURE
#define SVGA_SCREEN_COPY_STATUS_SUCCESS
#define SVGA_SCREEN_COPY_STATUS_INVALID

#pragma pack(push, 1)
SVGA3dCmdWriteZeroSurface;
#pragma pack(pop)

#pragma pack(push, 1)
SVGA3dCmdUpdateZeroSurface;
#pragma pack(pop)

#endif