Path: blob/21.2-virgl/src/amd/common/ac_drm_fourcc.h
7233 views
/*1* Copyright © 2021 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining4* a copy of this software and associated documentation files (the5* "Software"), to deal in the Software without restriction, including6* without limitation the rights to use, copy, modify, merge, publish,7* distribute, sub license, and/or sell copies of the Software, and to8* permit persons to whom the Software is furnished to do so, subject to9* the following conditions:10*11* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,12* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES13* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND14* NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS15* AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,17* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE18* USE OR OTHER DEALINGS IN THE SOFTWARE.19*20* The above copyright notice and this permission notice (including the21* next paragraph) shall be included in all copies or substantial portions22* of the Software.23*/2425#ifndef AC_DRM_FOURCC_H26#define AC_DRM_FOURCC_H2728#ifdef _WIN3229#include <stdint.h>30typedef uint64_t __u64;31#define DRM_FORMAT_MOD_VENDOR_NONE 032#define DRM_FORMAT_MOD_VENDOR_AMD 0x0233#define DRM_FORMAT_RESERVED ((1ULL << 56) - 1)34#define fourcc_mod_code(vendor, val) \35((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))36#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)37#define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0)38#define AMD_FMT_MOD fourcc_mod_code(AMD, 0)39#define IS_AMD_FMT_MOD(val) (((val) >> 56) == DRM_FORMAT_MOD_VENDOR_AMD)40#define AMD_FMT_MOD_TILE_VER_GFX9 141#define AMD_FMT_MOD_TILE_VER_GFX10 242#define AMD_FMT_MOD_TILE_VER_GFX10_RBPLUS 343#define AMD_FMT_MOD_TILE_GFX9_64K_S 944#define AMD_FMT_MOD_TILE_GFX9_64K_D 1045#define AMD_FMT_MOD_TILE_GFX9_64K_S_X 2546#define AMD_FMT_MOD_TILE_GFX9_64K_D_X 2647#define AMD_FMT_MOD_TILE_GFX9_64K_R_X 2748#define AMD_FMT_MOD_DCC_BLOCK_64B 049#define AMD_FMT_MOD_DCC_BLOCK_128B 150#define AMD_FMT_MOD_TILE_VERSION_SHIFT 051#define AMD_FMT_MOD_TILE_VERSION_MASK 0xFF52#define AMD_FMT_MOD_TILE_SHIFT 853#define AMD_FMT_MOD_TILE_MASK 0x1F54#define AMD_FMT_MOD_DCC_SHIFT 1355#define AMD_FMT_MOD_DCC_MASK 0x156#define AMD_FMT_MOD_DCC_RETILE_SHIFT 1457#define AMD_FMT_MOD_DCC_RETILE_MASK 0x158#define AMD_FMT_MOD_DCC_PIPE_ALIGN_SHIFT 1559#define AMD_FMT_MOD_DCC_PIPE_ALIGN_MASK 0x160#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_SHIFT 1661#define AMD_FMT_MOD_DCC_INDEPENDENT_64B_MASK 0x162#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_SHIFT 1763#define AMD_FMT_MOD_DCC_INDEPENDENT_128B_MASK 0x164#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 1865#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x366#define AMD_FMT_MOD_DCC_CONSTANT_ENCODE_SHIFT 2067#define AMD_FMT_MOD_PIPE_XOR_BITS_SHIFT 2168#define AMD_FMT_MOD_BANK_XOR_BITS_SHIFT 2469#define AMD_FMT_MOD_PACKERS_SHIFT 27 /* aliases with BANK_XOR_BITS */70#define AMD_FMT_MOD_RB_SHIFT 3071#define AMD_FMT_MOD_RB_MASK 0x772#define AMD_FMT_MOD_PIPE_SHIFT 3373#define AMD_FMT_MOD_SET(field, value) \74((uint64_t)(value) << AMD_FMT_MOD_##field##_SHIFT)75#define AMD_FMT_MOD_GET(field, value) \76(((value) >> AMD_FMT_MOD_##field##_SHIFT) & AMD_FMT_MOD_##field##_MASK)77#else78#include "drm-uapi/drm_fourcc.h"79#endif8081#endif /* AC_DRM_FOURCC_H */828384