1 /*
2 * Copyright (c) 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 //!
24 //! \file     decode_predication_packet_g12.h
25 //! \brief    Defines the common interface for decode predication sub packet
26 //! \details  The decocode predication sub packet interface is further sub-divided by different
27 //!           packet usages,this file is for the base interface which is shared by all decode packets.
28 //!
29 
30 #ifndef __DECODE_PREDICATION_PACKET_G12_H__
31 #define __DECODE_PREDICATION_PACKET_G12_H__
32 
33 #include "decode_sub_packet.h"
34 #include "codechal_setting.h"
35 #include "decode_pipeline.h"
36 #include "decode_predication.h"
37 #include "codechal_hw.h"
38 
39 namespace decode
40 {
41 
42 class DecodePredicationPktG12 : public DecodeSubPacket
43 {
44 public:
45     //!
46     //! \brief  Decode predication sub packet constructor
47     //!
48     DecodePredicationPktG12(DecodePipeline *pipeline, CodechalHwInterface *hwInterface);
49 
50     //!
51     //! \brief  Decode predication sub packet destructor
52     //!
~DecodePredicationPktG12()53     virtual ~DecodePredicationPktG12() {};
54 
55     //!
56     //! \brief  Initialize the predication sub packet
57     //! \return MOS_STATUS
58     //!         MOS_STATUS_SUCCESS if success, else fail reason
59     //!
60     virtual MOS_STATUS Init() override;
61 
62     //!
63     //! \brief  Update the parameters for predication sub packet
64     //! \return MOS_STATUS
65     //!         MOS_STATUS_SUCCESS if success, else fail reason
66     //!
67     virtual MOS_STATUS Prepare() override;
68 
69     //!
70     //! \brief  Execute sub packet
71     //! \return MOS_STATUS
72     //!         MOS_STATUS_SUCCESS if success, else fail reason
73     //!
74     virtual MOS_STATUS Execute(MOS_COMMAND_BUFFER& cmdBuffer);
75 
76     //!
77     //! \brief  Calculate Command Size
78     //!
79     //! \param  [in, out] commandBufferSize
80     //!         requested size
81     //! \param  [in, out] requestedPatchListSize
82     //!         requested size
83     //! \return MOS_STATUS
84     //!         status
85     //!
86     MOS_STATUS CalculateCommandSize(
87         uint32_t &commandBufferSize,
88         uint32_t &requestedPatchListSize) override;
89 
90 protected:
91     MhwMiInterface* m_miInterface = nullptr;
92     DecodePredication* m_predication = nullptr;
93     CodechalHwInterface *m_hwInterface = nullptr;
94 
95 MEDIA_CLASS_DEFINE_END(decode__DecodePredicationPktG12)
96 };
97 
98 }
99 
100 #endif  // !__DECODE_PREDICATION_PACKET_G12_H__
101 
102 
103