1 /*
2  * Copyright (C) 2020 Arm Limited.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef GRALLOC_LIBS_DRMUTILS_H
19 #define GRALLOC_LIBS_DRMUTILS_H
20 
21 #include "mali_fourcc.h"
22 #include "mali_gralloc_buffer.h"
23 
24 /**
25  * @brief Obtain the FOURCC corresponding to the given Gralloc internal format.
26  *
27  * @param hnd Private handle where the format information is stored.
28  *
29  * @return The DRM FOURCC format or DRM_FORMAT_INVALID in case of errors.
30  */
31 uint32_t drm_fourcc_from_handle(const private_handle_t *hnd);
32 
33 /**
34  * @brief Extract the part of the DRM modifier stored inside the given internal format and private handle.
35  *
36  * @param hnd Private handle where part of the modifier information is stored.
37  * @param internal_format The internal format, where part of the modifier information is stored.
38  *
39  * @return The information extracted from the argument, in the form of a DRM modifier.
40  */
41 uint64_t drm_modifier_from_handle(const private_handle_t *hnd);
42 
43 #endif
44