xref: /aosp_15_r20/external/intel-media-driver/media_softlet/agnostic/common/hw/mhw_blt.cpp (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2020-2022, 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.cpp
24 //! \brief    MHW interface for constructing commands for the BLT
25 //!
26 #include "mhw_blt.h"
27 
XY_BLOCK_COPY_BLT_CMD()28 mhw_blt_state::XY_BLOCK_COPY_BLT_CMD::XY_BLOCK_COPY_BLT_CMD()
29 {
30     DW0.Value                                        = 0x5040000a;
31     //DW0.DwordLength                                  = GetOpLength(dwSize);
32     //DW0.ColorDepth                                   = COLOR_DEPTH_8BITCOLOR;
33     //DW0.InstructionTargetOpcode                      = INSTRUCTION_TARGETOPCODE_INSTRUCTIONTARGETXYBLOCKCOPYBLT;
34     //DW0.Client                                       = CLIENT_2DPROCESSOR;
35 
36     DW1.Value                                        = 0x00000000;
37     //DW1.DestinationTiling                            = DESTINATION_TILING_LINEAR;
38 
39     DW2.Value                                        = 0x00000000;
40 
41     DW3.Value                                        = 0x00000000;
42 
43     DW4_5.Value[0] = DW4_5.Value[1]                  = 0x00000000;
44 
45     DW6.Value                                        = 0x00000000;
46 
47     DW7.Value                                        = 0x00000000;
48 
49     DW8.Value                                        = 0x00000000;
50     //DW8.SourceTiling                                 = SOURCE_TILING_LINEAR;
51 
52     DW9_10.Value[0] = DW9_10.Value[1]                = 0x00000000;
53 
54     DW11.Value                                       = 0x00000000;
55 }
56 
XY_FAST_COPY_BLT_CMD()57 mhw_blt_state::XY_FAST_COPY_BLT_CMD::XY_FAST_COPY_BLT_CMD()
58 {
59     DW0.Value                                        = 0x50800008;
60     //DW0.DwordLength                                  = GetOpLength(dwSize);
61     //DW0.DestinationTilingMethod                      = DESTINATION_TILING_METHOD_LINEAR_TILINGDISABLED;
62     //DW0.SourceTilingMethod                           = SOURCE_TILING_METHOD_LINEAR_TILINGDISABLED;
63     //DW0.InstructionTargetOpcode                      = INSTRUCTION_TARGETOPCODE_UNNAMED66;
64     //DW0.Client                                       = CLIENT_2DPROCESSOR;
65 
66     DW1.Value                                        = 0x00000000;
67     //DW1.ColorDepth                                   = COLOR_DEPTH_8BITCOLOR;
68     //DW1.TileYTypeForDestination                      = 0;
69     //DW1.TileYTypeForSource                           = 0;
70 
71     DW2.Value                                        = 0x00000000;
72 
73     DW3.Value                                        = 0x00000000;
74 
75     DW4_5.Value[0] = DW4_5.Value[1]                  = 0x00000000;
76 
77     DW6.Value                                        = 0x00000000;
78 
79     DW7.Value                                        = 0x00000000;
80 
81     DW8_9.Value[0] = DW8_9.Value[1]                  = 0x00000000;
82 
83 }
84 
85 
BCS_SWCTRL_CMD()86 mhw_blt_state::BCS_SWCTRL_CMD::BCS_SWCTRL_CMD()
87 {
88     DW0.Value                                        = 0;
89     DW0.TileYSource                                  = 0x0;
90     DW0.TileYDestination                             = 0x0;
91     DW0.NotInvalidateBlitterCacheonBCSFlush          = 0x0;
92     DW0.ShrinkBlitterCache                           = 0x0;
93     DW0.TileYSourceMask                              = 0x1;
94     DW0.TileYDestinationMask                         = 0x1;
95     DW0.Mask                                         = 0x0;
96 }
97 
BCS_SWCTRL_XE()98 mhw_blt_state::BCS_SWCTRL_XE::BCS_SWCTRL_XE()
99 {
100     DW0.Value                                        = 0;
101     DW0.Tile4Source                                  = TILE_4_SOURCE_XMAJOR;
102     DW0.Tile4Destination                             = TILE_4_DESTINATION_XMAJOR;
103     DW0.SystemMemoryThrottleThreshold                = 0x40;
104     DW0.Mask = 0x0;
105 }