1e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák/*
2e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * Copyright © 2014 Advanced Micro Devices, Inc.
3e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * All Rights Reserved.
4e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák *
5e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * Permission is hereby granted, free of charge, to any person obtaining
6e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * a copy of this software and associated documentation files (the
7e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * "Software"), to deal in the Software without restriction, including
8e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * without limitation the rights to use, copy, modify, merge, publish,
9e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * distribute, sub license, and/or sell copies of the Software, and to
10e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * permit persons to whom the Software is furnished to do so, subject to
11e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * the following conditions:
12e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák *
13e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
17e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * USE OR OTHER DEALINGS IN THE SOFTWARE.
21e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák *
22e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * The above copyright notice and this permission notice (including the
23e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * next paragraph) shall be included in all copies or substantial portions
24e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák * of the Software.
25e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák */
26e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
27e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák/**
28e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
29e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák* @file  siaddrlib.h
30e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák* @brief Contains the R800AddrLib class definition.
31e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
32e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák*/
33e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
34e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák#ifndef __SI_ADDR_LIB_H__
35e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák#define __SI_ADDR_LIB_H__
36e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
37e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák#include "addrlib.h"
38e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák#include "egbaddrlib.h"
39e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
40e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák/**
41e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
42e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák* @brief Describes the information in tile mode table
43e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
44e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák*/
45e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákstruct ADDR_TILECONFIG
46e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák{
47e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    AddrTileMode  mode;
48e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    AddrTileType  type;
49e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    ADDR_TILEINFO info;
50e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák};
51e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
52e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák/**
53e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
54e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák* @brief SI specific settings structure.
55e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
56e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák*/
57e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákstruct SIChipSettings
58e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák{
59e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    struct
60e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    {
61e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isSouthernIsland    : 1;
62e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isTahiti            : 1;
63e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isPitCairn          : 1;
64e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isCapeVerde         : 1;
65e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        /// Oland/Hainan are of GFXIP 6.0, similar with SI
66e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isOland             : 1;
67e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 isHainan            : 1;
68e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    };
69e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák};
70e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
71e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák/**
72e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
73e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák* @brief This class is the SI specific address library
74e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák*        function set.
75e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák***************************************************************************************************
76e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák*/
77e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákclass SIAddrLib : public EgBasedAddrLib
78e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák{
79e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákpublic:
80e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    /// Creates SIAddrLib object
81e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    static AddrLib* CreateObj(const AddrClient* pClient)
82e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    {
83e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        return new(pClient) SIAddrLib(pClient);
84e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    }
85e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
86e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákprotected:
87e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    SIAddrLib(const AddrClient* pClient);
88e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual ~SIAddrLib();
89e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
90e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    // Hwl interface - defined in AddrLib
91e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual ADDR_E_RETURNCODE HwlComputeSurfaceInfo(
92e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
93e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
94e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
95e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual ADDR_E_RETURNCODE HwlConvertTileInfoToHW(
96e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_CONVERT_TILEINFOTOHW_INPUT* pIn,
97e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_CONVERT_TILEINFOTOHW_OUTPUT* pOut) const;
98e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
99e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_64 HwlComputeXmaskAddrFromCoord(
100e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 pitch, UINT_32 height, UINT_32 x, UINT_32 y, UINT_32 slice, UINT_32 numSlices,
101e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
102e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo, UINT_32* pBitPosition) const;
103e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
104e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID HwlComputeXmaskCoordFromAddr(
105e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_64 addr, UINT_32 bitPosition, UINT_32 pitch, UINT_32 height, UINT_32 numSlices,
106e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 factor, BOOL_32 isLinear, BOOL_32 isWidth8, BOOL_32 isHeight8,
107e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo, UINT_32* pX, UINT_32* pY, UINT_32* pSlice) const;
108e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
109e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual ADDR_E_RETURNCODE HwlGetTileIndex(
110e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_GET_TILEINDEX_INPUT* pIn,
111e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_GET_TILEINDEX_OUTPUT*      pOut) const;
112e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
113e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlComputeMipLevel(
114e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn) const;
115e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
116e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual AddrChipFamily HwlConvertChipFamily(
117e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 uChipFamily, UINT_32 uChipRevision);
118e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
119e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlInitGlobalParams(
120e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_CREATE_INPUT* pCreateIn);
121e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
122e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual ADDR_E_RETURNCODE HwlSetupTileCfg(
123e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        INT_32 index, INT_32 macroModeIndex,
124e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pInfo, AddrTileMode* pMode = 0, AddrTileType* pType = 0) const;
125e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
126e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID HwlComputeTileDataWidthAndHeightLinear(
127e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32* pMacroWidth, UINT_32* pMacroHeight,
128e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bpp, ADDR_TILEINFO* pTileInfo) const;
129e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
130e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_64 HwlComputeHtileBytes(
131e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 pitch, UINT_32 height, UINT_32 bpp,
132e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        BOOL_32 isLinear, UINT_32 numSlices, UINT_64* pSliceBytes, UINT_32 baseAlign) const;
133e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
134e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 ComputePipeFromCoord(
135e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 x, UINT_32 y, UINT_32 slice,
136e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode tileMode, UINT_32 pipeSwizzle, BOOL_32 ignoreSE,
137e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo) const;
138e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
139e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlGetPipes(const ADDR_TILEINFO* pTileInfo) const;
140e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
141e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    /// Pre-handler of 3x pitch (96 bit) adjustment
142e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlPreHandleBaseLvl3xPitch(
143e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
144e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    /// Post-handler of 3x pitch adjustment
145e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlPostHandleBaseLvl3xPitch(
146e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, UINT_32 expPitch) const;
147e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
148e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    /// Dummy function to finalize the inheritance
149e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlComputeXmaskCoordYFrom8Pipe(
150e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 pipe, UINT_32 x) const;
151e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
152e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    // Sub-hwl interface - defined in EgBasedAddrLib
153e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID HwlSetupTileInfo(
154e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode tileMode, ADDR_SURFACE_FLAGS flags,
155e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bpp, UINT_32 pitch, UINT_32 height, UINT_32 numSamples,
156e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* inputTileInfo, ADDR_TILEINFO* outputTileInfo,
157e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileType inTileType, ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
158e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
159e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlGetPitchAlignmentMicroTiled(
160e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode tileMode, UINT_32 bpp, ADDR_SURFACE_FLAGS flags, UINT_32 numSamples) const;
161e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
162e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_64 HwlGetSizeAdjustmentMicroTiled(
163e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 thickness, UINT_32 bpp, ADDR_SURFACE_FLAGS flags, UINT_32 numSamples,
164e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 baseAlign, UINT_32 pitchAlign,
165e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 *pPitch, UINT_32 *pHeight) const;
166e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
167e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID HwlCheckLastMacroTiledLvl(
168e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn, ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pOut) const;
169e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
170e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlTileInfoEqual(
171e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_TILEINFO* pLeft, const ADDR_TILEINFO* pRight) const;
172e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
173e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual AddrTileMode HwlDegradeThickTileMode(
174e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode baseTileMode, UINT_32 numSlices, UINT_32* pBytesPerTile) const;
175e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
176e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlOverrideTileMode(
177e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_INPUT* pIn,
178e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode* pTileMode,
179e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileType* pTileType) const;
180e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
181e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlSanityCheckMacroTiled(
182e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo) const
183e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    {
184e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        return TRUE;
185e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    }
186e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
187e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlGetPitchAlignmentLinear(UINT_32 bpp, ADDR_SURFACE_FLAGS flags) const;
188e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
189e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_64 HwlGetSizeAdjustmentLinear(
190e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode tileMode,
191e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bpp, UINT_32 numSamples, UINT_32 baseAlign, UINT_32 pitchAlign,
192e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 *pPitch, UINT_32 *pHeight, UINT_32 *pHeightAlign) const;
193e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
194e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID HwlComputeSurfaceCoord2DFromBankPipe(
195e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        AddrTileMode tileMode, UINT_32* pX, UINT_32* pY, UINT_32 slice,
196e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bank, UINT_32 pipe,
197e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bankSwizzle, UINT_32 pipeSwizzle, UINT_32 tileSlices,
198e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        BOOL_32 ignoreSE,
199e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo) const;
200e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
201e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlPreAdjustBank(
202e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 tileX, UINT_32 bank, ADDR_TILEINFO* pTileInfo) const;
203e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
204e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual INT_32 HwlPostCheckTileIndex(
205e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_TILEINFO* pInfo, AddrTileMode mode, AddrTileType type,
206e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        INT curIndex = TileIndexInvalid) const;
207e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
208e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID   HwlFmaskPreThunkSurfInfo(
209e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_FMASK_INFO_INPUT* pFmaskIn,
210e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut,
211e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_COMPUTE_SURFACE_INFO_INPUT* pSurfIn,
212e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut) const;
213e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
214e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual VOID   HwlFmaskPostThunkSurfInfo(
215e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_SURFACE_INFO_OUTPUT* pSurfOut,
216e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_COMPUTE_FMASK_INFO_OUTPUT* pFmaskOut) const;
217e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
218e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual UINT_32 HwlComputeFmaskBits(
219e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_COMPUTE_FMASK_INFO_INPUT* pIn,
220e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32* pNumSamples) const;
221e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
222e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    virtual BOOL_32 HwlReduceBankWidthHeight(
223e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 tileSize, UINT_32 bpp, ADDR_SURFACE_FLAGS flags, UINT_32 numSamples,
224e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 bankHeightAlign, UINT_32 pipes,
225e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        ADDR_TILEINFO* pTileInfo) const
226e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    {
227e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        return TRUE;
228e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    }
229e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
230e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    // Protected non-virtual functions
231e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    VOID ComputeTileCoordFromPipeAndElemIdx(
232e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 elemIdx, UINT_32 pipe, AddrPipeCfg pipeCfg, UINT_32 pitchInMacroTile,
233e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 x, UINT_32 y, UINT_32* pX, UINT_32* pY) const;
234e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
235e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    UINT_32 TileCoordToMaskElementIndex(
236e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 tx, UINT_32 ty, AddrPipeCfg  pipeConfig,
237e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 *macroShift, UINT_32 *elemIdxBits) const;
238e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
239e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    BOOL_32 DecodeGbRegs(
240e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const ADDR_REGISTER_VALUE* pRegValue);
241e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
242e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    const ADDR_TILECONFIG* GetTileSetting(
243e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 index) const;
244e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
245e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    static const UINT_32    TileTableSize = 32;
246e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    ADDR_TILECONFIG         m_tileTable[TileTableSize];
247e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    UINT_32                 m_noOfEntries;
248e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
249e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšákprivate:
250e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
251e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    UINT_32 GetPipePerSurf(AddrPipeCfg pipeConfig) const;
252e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
253e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    VOID ReadGbTileMode(
254e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        UINT_32 regValue, ADDR_TILECONFIG* pCfg) const;
255e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    BOOL_32 InitTileSettingTable(
256e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák        const UINT_32 *pSetting, UINT_32 noOfEntries);
257e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
258e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák    SIChipSettings          m_settings;
259e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák};
260e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
261e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák#endif
262e7fc664b91a5d886c2709d05a498f6a1dfbaf136Marek Olšák
263