1 /*
2 * Copyright (c) 2024, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file     mhw_blt_xe2_lpm_impl.h
24 //! \brief    MHW blt interface common base for xe2_lpm
25 //! \details
26 //!
27 
28 #ifndef __MHW_BLT_XE2_LPM_IMPL_H__
29 #define __MHW_BLT_XE2_LPM_IMPL_H__
30 
31 #include "mhw_blt_impl.h"
32 #include "mhw_blt_hwcmd_xe2_lpm.h"
33 #include "mhw_blt_itf.h"
34 #include "mhw_impl.h"
35 #include "mos_solo_generic.h"
36 
37 namespace mhw
38 {
39 namespace blt
40 {
41 namespace xe2_lpm
42 {
43 class Impl : public blt::Impl<mhw::blt::xe2_lpm::Cmd>
44 {
45 public:
Impl(PMOS_INTERFACE osItf)46     Impl(PMOS_INTERFACE osItf) : base_t(osItf)
47     {
48         MHW_FUNCTION_ENTER;
49     }
50 
GetFastTilingMode(BLT_TILE_TYPE TileType)51     uint32_t GetFastTilingMode(BLT_TILE_TYPE TileType) override
52     {
53         MHW_FUNCTION_ENTER;
54         switch (TileType)
55         {
56         case BLT_NOT_TILED:
57             return Cmd::XY_FAST_COPY_BLT_CMD::DESTINATION_TILING_METHOD_LINEAR_TILINGDISABLED;
58         case BLT_TILED_Y:
59         case BLT_TILED_4:
60             return Cmd::XY_FAST_COPY_BLT_CMD::DESTINATION_TILING_METHOD_TILE_Y;
61         case BLT_TILED_64:
62             return Cmd::XY_FAST_COPY_BLT_CMD::DESTINATION_TILING_METHOD_64KBTILING;
63         default:
64             MHW_ASSERTMESSAGE("BLT: Can't support GMM TileType %d.", TileType);
65         }
66         return Cmd::XY_FAST_COPY_BLT_CMD::DESTINATION_TILING_METHOD_LINEAR_TILINGDISABLED;
67     }
68 
69 protected:
70     using base_t = blt::Impl<mhw::blt::xe2_lpm::Cmd>;
71 
72 MEDIA_CLASS_DEFINE_END(mhw__blt__xe2_lpm__Impl)
73 };  // Impl
74 }  // xe2_lpm
75 }  // namespace blt
76 }  // namespace mhw
77 
78 #endif  // __MHW_BLT_XE2_LPM_IMPL_H__
79