Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
Arun Kumar K.R | 6c85f05 | 2014-01-21 21:47:41 -0800 | [diff] [blame] | 3 | * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 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 FB_PRIV_H |
| 19 | #define FB_PRIV_H |
| 20 | #include <linux/fb.h> |
Naseer Ahmed | 32aa90f | 2012-10-01 18:45:13 -0400 | [diff] [blame] | 21 | #include <linux/msm_mdp.h> |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 22 | |
| 23 | #define NUM_FRAMEBUFFERS_MIN 2 |
Naseer Ahmed | 00fd6a5 | 2012-07-03 21:23:12 -0700 | [diff] [blame] | 24 | #define NUM_FRAMEBUFFERS_MAX 3 |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 25 | |
| 26 | #define NO_SURFACEFLINGER_SWAPINTERVAL |
| 27 | #define COLOR_FORMAT(x) (x & 0xFFF) // Max range for colorFormats is 0 - FFF |
| 28 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 29 | struct private_handle_t; |
| 30 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 31 | enum { |
| 32 | // flag to indicate we'll post this buffer |
| 33 | PRIV_USAGE_LOCKED_FOR_POST = 0x80000000, |
| 34 | PRIV_MIN_SWAP_INTERVAL = 0, |
| 35 | PRIV_MAX_SWAP_INTERVAL = 1, |
| 36 | }; |
| 37 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 38 | struct private_module_t { |
| 39 | gralloc_module_t base; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 40 | struct private_handle_t* framebuffer; |
| 41 | uint32_t fbFormat; |
| 42 | uint32_t flags; |
| 43 | uint32_t numBuffers; |
Saurabh Shah | 8f0ea6f | 2014-05-19 16:48:53 -0700 | [diff] [blame] | 44 | uint32_t bufferMask; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 45 | pthread_mutex_t lock; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 46 | struct fb_var_screeninfo info; |
| 47 | struct fb_fix_screeninfo finfo; |
| 48 | float xdpi; |
| 49 | float ydpi; |
| 50 | float fps; |
| 51 | uint32_t swapInterval; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 52 | }; |
| 53 | |
| 54 | |
| 55 | |
| 56 | #endif /* FB_PRIV_H */ |