blob: 5ac6dbfb3ff05a718903e5a0a3098bec08698b8c
1 | /* |
2 | * Copyright (C) 2014 ARM Limited. All rights reserved. |
3 | * |
4 | * Copyright (C) 2008 The Android Open Source Project |
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 <cutils/memory.h> |
20 | |
21 | static void display_afbc_hwc_blkinit(struct hwblk *blk,int16_t **array) |
22 | { |
23 | static int16_t hwc_pref_formats[GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_LAST]; |
24 | android_memset16((uint16_t*) hwc_pref_formats, (uint16_t) DEFAULT_WEIGHT_UNSUPPORTED, sizeof(uint16_t) * GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_LAST); |
25 | blk->usage = GRALLOC_USAGE_HW_COMPOSER; |
26 | *array = hwc_pref_formats; |
27 | |
28 | #if MALI_DISPLAY_VERSION == 500 |
29 | (*array)[GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_RGB_888_AFBC] = DEFAULT_WEIGHT_MOST_PREFERRED + 10; |
30 | #elif MALI_DISPLAY_VERSION == 550 |
31 | (*array)[GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_RGBA_8888_AFBC_SPLITBLK] = DEFAULT_WEIGHT_MOST_PREFERRED + 10; |
32 | (*array)[GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_BGRA_8888_AFBC_SPLITBLK] = DEFAULT_WEIGHT_MOST_PREFERRED + 10; |
33 | (*array)[GRALLOC_ARM_FORMAT_INTERNAL_INDEXED_RGB_888_AFBC_SPLITBLK] = DEFAULT_WEIGHT_MOST_PREFERRED + 10; |
34 | #endif |
35 | } |
36 |