• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2 * Copyright (c) 2020, 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     media_copy_m12_0.h
24 //! \brief    Common interface and structure used in media copy
25 //! \details  Common interface and structure used in media copy which are platform independent
26 //!
27 
28 #ifndef __MEDIA_COPY_M12_0_H__
29 #define __MEDIA_COPY_M12_0_H__
30 
31 #include "media_copy.h"
32 #include "mos_defs.h"
33 #include "mos_os_specific.h"
34 
35 class VeboxCopyState;
36 class BltState;
37 class MhwInterfaces;
38 
39 class MediaCopyStateM12_0: public MediaCopyBaseState
40 {
41 public:
42     //!
43     //! \brief    MediaCopyStateM12_0 constructor
44     //! \details  Initialize the MediaCopy members.
45     //! \param    osInterface
46     //!           [in] Pointer to MOS_INTERFACE.
47     //!
48     MediaCopyStateM12_0();
49     virtual ~MediaCopyStateM12_0();
50 
51     //!
52     //! \brief    init function.
53     virtual MOS_STATUS Initialize(  PMOS_INTERFACE  osInterface, MhwInterfaces *mhwInterfaces);
54     using MediaCopyBaseState::Initialize;
55 
56     //!
57     //! \brief    render format support.
58     //! \details  surface format support.
59     //! \param    src
60     //!           [in] Pointer to source surface
61     //! \param    dst
62     //!           [in] Pointer to destination surface
63     //! \return   bool
64     //!           Return true if support, otherwise return false.
65     //!
66     virtual bool RenderFormatSupportCheck(PMOS_RESOURCE src, PMOS_RESOURCE dst);
67 
68     //!
69     //! \brief    feature support check on specific check.
70     //! \details  media copy feature support.
71     //! \param    src
72     //!           [in] Pointer to source surface
73     //! \param    dst
74     //!           [in] Pointer to destination surface
75     //! \param    caps
76     //!           [in] reference of featue supported engine
77     //! \return   bool
78     //!           Return true if support, otherwise return false.
79     //!
80     virtual MOS_STATUS FeatureSupport(PMOS_RESOURCE src, PMOS_RESOURCE dst,
81             MCPY_STATE_PARAMS& mcpy_src, MCPY_STATE_PARAMS& mcpy_dst, MCPY_ENGINE_CAPS& caps);
82 
83 protected:
84 
85     //!
86     //! \brief    use blt engie to do surface copy.
87     //! \details  implementation media blt copy.
88     //! \param    src
89     //!           [in] Pointer to source surface
90     //! \param    dst
91     //!           [in] Pointer to destination surface
92     //! \return   MOS_STATUS
93     //!           Return MOS_STATUS_SUCCESS if support, otherwise return unspoort.
94     //!
95     virtual MOS_STATUS MediaBltCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst);
96 
97     //!
98     //! \brief    use Render engie to do surface copy.
99     //! \details  implementation media Render copy.
100     //! \param    src
101     //!           [in] Pointer to source surface
102     //! \param    dst
103     //!           [in] Pointer to destination surface
104     //! \return   MOS_STATUS
105     //!           Return MOS_STATUS_SUCCESS if support, otherwise return unspoort.
106     //!
107     virtual MOS_STATUS MediaRenderCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst);
108 
109     //!
110     //! \brief    use vebox engie to do surface copy.
111     //! \details  implementation media vebox copy.
112     //! \param    src
113     //!           [in] Pointer to source surface
114     //! \param    dst
115     //!           [in] Pointer to destination surface
116     //! \return   MOS_STATUS
117     //!           Return MOS_STATUS_SUCCESS if support, otherwise return unspoort.
118     //!
119     virtual MOS_STATUS MediaVeboxCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst);
120 
121     virtual bool IsVeboxCopySupported(PMOS_RESOURCE src, PMOS_RESOURCE dst);
122     virtual MOS_STATUS TaskDispatch(MCPY_STATE_PARAMS mcpySrc, MCPY_STATE_PARAMS mcpyDst, MCPY_ENGINE mcpyEngine);
123 
124     MhwInterfaces   *m_mhwInterfaces  = nullptr;
125     BltState        *m_bltState       = nullptr;
126     VeboxCopyState  *m_veboxCopyState = nullptr;
127     MEDIA_CLASS_DEFINE_END(MediaCopyStateM12_0)
128 };
129 #endif // __MEDIA_COPY_M12_0_H__