linux/drivers/gpu/drm/amd/amdgpu/vpe_6_1_fw_if.h

/* Copyright 2023 Advanced Micro Devices, 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
 *
 * Authors: AMD
 *
 */

#ifndef __VPE_6_1_FW_IF_H_
#define __VPE_6_1_FW_IF_H_

/****************
 * VPE OP Codes
 ****************/
enum VPE_CMD_OPCODE {};

/** Generic Command Header
 * Generic Commands include:
 *  Noop, Fence, Trap,
 *  RegisterWrite, PollRegisterWriteMemory,
 *  SetLocalTimestamp, GetLocalTimestamp
 *  GetGlobalGPUTimestamp */
#define VPE_HEADER_SUB_OPCODE__SHIFT
#define VPE_HEADER_SUB_OPCODE_MASK
#define VPE_HEADER_OPCODE__SHIFT
#define VPE_HEADER_OPCODE_MASK

#define VPE_CMD_HEADER(op, subop)


 /***************************
  * VPE NOP
  ***************************/
#define VPE_CMD_NOP_HEADER_COUNT__SHIFT
#define VPE_CMD_NOP_HEADER_COUNT_MASK

#define VPE_CMD_NOP_HEADER_COUNT(count)

 /***************************
  * VPE Descriptor
  ***************************/
#define VPE_DESC_CD__SHIFT
#define VPE_DESC_CD_MASK

#define VPE_DESC_CMD_HEADER(cd)

 /***************************
  * VPE Plane Config
  ***************************/
enum VPE_PLANE_CFG_SUBOP {};

#define VPE_PLANE_CFG_ONE_PLANE
#define VPE_PLANE_CFG_TWO_PLANES

#define VPE_PLANE_CFG_NPS0__SHIFT
#define VPE_PLANE_CFG_NPS0_MASK

#define VPE_PLANE_CFG_NPD0__SHIFT
#define VPE_PLANE_CFG_NPD0_MASK

#define VPE_PLANE_CFG_NPS1__SHIFT
#define VPE_PLANE_CFG_NPS1_MASK

#define VPE_PLANE_CFG_NPD1__SHIFT
#define VPE_PLANE_CFG_NPD1_MASK

#define VPE_PLANE_CFG_TMZ__SHIFT
#define VPE_PLANE_CFG_TMZ_MASK

#define VPE_PLANE_CFG_SWIZZLE_MODE__SHIFT
#define VPE_PLANE_CFG_SWIZZLE_MODE_MASK

#define VPE_PLANE_CFG_ROTATION__SHIFT
#define VPE_PLANE_CFG_ROTATION_MASK

#define VPE_PLANE_ADDR_LO__SHIFT
#define VPE_PLANE_ADDR_LO_MASK

#define VPE_PLANE_CFG_PITCH__SHIFT
#define VPE_PLANE_CFG_PITCH_MASK

#define VPE_PLANE_CFG_VIEWPORT_Y__SHIFT
#define VPE_PLANE_CFG_VIEWPORT_Y_MASK
#define VPE_PLANE_CFG_VIEWPORT_X__SHIFT
#define VPE_PLANE_CFG_VIEWPORT_X_MASK


#define VPE_PLANE_CFG_VIEWPORT_HEIGHT__SHIFT
#define VPE_PLANE_CFG_VIEWPORT_HEIGHT_MASK
#define VPE_PLANE_CFG_VIEWPORT_ELEMENT_SIZE__SHIFT
#define VPE_PLANE_CFG_VIEWPORT_ELEMENT_SIZE_MASK
#define VPE_PLANE_CFG_VIEWPORT_WIDTH__SHIFT
#define VPE_PLANE_CFG_VIEWPORT_WIDTH_MASK

enum VPE_PLANE_CFG_ELEMENT_SIZE {};

#define VPE_PLANE_CFG_CMD_HEADER(subop, nps0, npd0, nps1, npd1)


/************************
 * VPEP Config
 ************************/
enum VPE_VPEP_CFG_SUBOP {};


// Direct Config Command Header
#define VPE_DIR_CFG_HEADER_ARRAY_SIZE__SHIFT
#define VPE_DIR_CFG_HEADER_ARRAY_SIZE_MASK

#define VPE_DIR_CFG_CMD_HEADER(subop, arr_sz)


#define VPE_DIR_CFG_PKT_REGISTER_OFFSET__SHIFT
#define VPE_DIR_CFG_PKT_REGISTER_OFFSET_MASK

#define VPE_DIR_CFG_PKT_DATA_SIZE__SHIFT
#define VPE_DIR_CFG_PKT_DATA_SIZE_MASK


// InDirect Config Command Header
#define VPE_IND_CFG_HEADER_NUM_DST__SHIFT
#define VPE_IND_CFG_HEADER_NUM_DST_MASK

#define VPE_IND_CFG_CMD_HEADER(subop, num_dst)

// Indirect Buffer Command Header
#define VPE_CMD_INDIRECT_HEADER_VMID__SHIFT
#define VPE_CMD_INDIRECT_HEADER_VMID_MASK
#define VPE_CMD_INDIRECT_HEADER_VMID(vmid)


/**************************
 * Poll Reg/Mem Sub-OpCode
 **************************/
enum VPE_POLL_REGMEM_SUBOP {};

#define VPE_CMD_POLL_REGMEM_HEADER_FUNC__SHIFT
#define VPE_CMD_POLL_REGMEM_HEADER_FUNC_MASK
#define VPE_CMD_POLL_REGMEM_HEADER_FUNC(func)

#define VPE_CMD_POLL_REGMEM_HEADER_MEM__SHIFT
#define VPE_CMD_POLL_REGMEM_HEADER_MEM_MASK
#define VPE_CMD_POLL_REGMEM_HEADER_MEM(mem)

#define VPE_CMD_POLL_REGMEM_DW5_INTERVAL__SHIFT
#define VPE_CMD_POLL_REGMEM_DW5_INTERVAL_MASK
#define VPE_CMD_POLL_REGMEM_DW5_INTERVAL(interval)

#define VPE_CMD_POLL_REGMEM_DW5_RETRY_COUNT__SHIFT
#define VPE_CMD_POLL_REGMEM_DW5_RETRY_COUNT_MASK
#define VPE_CMD_POLL_REGMEM_DW5_RETRY_COUNT(count)

#endif