1 /* 2 * Copyright (C) 2022 Rockchip Electronics Co., Ltd. 3 * Authors: 4 * Cerf Yu <cerf.yu@rock-chips.com> 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 */ 18 19 #include "android_utils/android_utils.h" 20 #include "drm_utils/drm_utils.h" 21 22 /* 23 * When a pointer is converted to uint64_t, it must first be assigned to 24 * an integer of the same size, and then converted to uint64_t. The opposite 25 * is true. 26 */ 27 #define ptr_to_u64(ptr) ((uint64_t)(uintptr_t)(ptr)) 28 #define u64_to_ptr(var) ((void *)(uintptr_t)(var)) 29 30 #define is_rga_format(format) ((format) & 0xff00 || (format) == 0) 31 32 int convert_to_rga_format(int ex_format); 33