File: GmmResourceInfo.h

package info (click to toggle)
intel-gmmlib 20.4.1%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,524 kB
  • sloc: cpp: 52,910; ansic: 5,587; makefile: 6
file content (104 lines) | stat: -rw-r--r-- 4,581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*==============================================================================
Copyright(c) 2017 Intel Corporation

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.
============================================================================*/
#pragma once


#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/

// Set packing alignment
#pragma pack(push, 8)

extern const uint32_t __GmmMSAAConversion[5][2];
extern const uint32_t __GmmTileYConversionTable[5][2];

//
// Normally, GMM_RESOURCE_INFO should not contain any user mode pointers because
// if the resource is shared, then the pointer will be invalid in the other process.
// However, the pointers below are OK because pMappedTiles and pTiledPoolArray are
// associated with a TR surface, which is not shareable. AuxInfo.pTilePoolInfo is associated
// with tile pools; Tile Pools are shareable, but Aux tile pool aren't.
//
typedef struct TILE_POOL_INFO_REC
{
    uint64_t                          UsedTiles[4];       // Tiles being used in 1 tile pool
    GMM_GFX_ADDRESS                   StartingGfxAddress; // GfxAddress associated with the TilePool
} TILE_POOL_INFO;

typedef struct GMM_TILED_RESOURCE_INFO_REC
{
    GMM_GFX_ADDRESS                     TiledResourceGfxAddress; // used for tiled resources
    uint64_t                            pMappedTiles;            // tracks which tiles have been mapped
    uint64_t                            pTilePoolArray;          // list of tile pool allocation
                                                                 // handles (D3DKMT_HANDLE),
                                                                 // only used for tiled resources
    uint64_t                            pAuxTilePoolResArray;    // list of aux tile pool allocation resource, and handles

    uint32_t                            TilePoolArraySize;
    uint32_t                            AuxTilePoolArraySize;

    struct
    {
        uint64_t                        pTilePoolInfo;
        uint64_t                        PagingFenceValue;
        uint32_t                        TilePoolInfoTotalNumElements; // Number of elements in pTilePoolInfo array
        uint32_t                        TilePoolInfoFreeNumElements;  // Number of free tile pools
    } AuxInfo;
} GMM_TILED_RESOURCE_INFO;

typedef struct GMM_EXISTING_SYS_MEM_REC
{
    // 64bit kernel mode drivers must validate sizeof structs passed from
    // 32bit & 64bit user mode drivers. Store as 64bit to keep uniform size.
    uint64_t                        pExistingSysMem; //Original buffer address.
    uint64_t                        pVirtAddress;
    uint64_t                        pGfxAlignedVirtAddress;
#if(LHDM)
    D3DKMT_HANDLE                   hParentAllocation;
#endif
    GMM_GFX_SIZE_T                  Size;
    uint8_t                         IsGmmAllocated;
} GMM_EXISTING_SYS_MEM;
//===========================================================================
// typedef:
//      GMM_RESOURCE_INFO
//
// Description:
//     Struct describing the attributes and properties of a user mode resource
//
//----------------------------------------------------------------------------
#ifndef _WIN32
    #include "../Linux/GmmResourceInfoLin.h"
#endif

// Reset packing alignment to project default
#pragma pack(pop)

uint8_t     GMM_STDCALL GmmResValidateParams(GMM_RESOURCE_INFO *pResourceInfo);
void        GMM_STDCALL GmmResGetRestrictions(GMM_RESOURCE_INFO* pResourceInfo, __GMM_BUFFER_TYPE* pRestrictions);
uint8_t     __CanSupportStdTiling(GMM_TEXTURE_INFO Surface);

#ifdef __cplusplus
}
#endif /*__cplusplus*/