Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * Copyright (c) 2012, Code Aurora Forum. All rights reserved. |
| 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> |
| 21 | |
| 22 | #define NUM_FRAMEBUFFERS_MIN 2 |
Naseer Ahmed | 00fd6a5 | 2012-07-03 21:23:12 -0700 | [diff] [blame] | 23 | #define NUM_FRAMEBUFFERS_MAX 3 |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 24 | |
| 25 | #define NO_SURFACEFLINGER_SWAPINTERVAL |
| 26 | #define COLOR_FORMAT(x) (x & 0xFFF) // Max range for colorFormats is 0 - FFF |
| 27 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 28 | enum hdmi_mirroring_state { |
| 29 | HDMI_NO_MIRRORING, |
| 30 | HDMI_UI_MIRRORING, |
| 31 | }; |
| 32 | |
| 33 | struct private_handle_t; |
| 34 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 35 | enum { |
| 36 | // flag to indicate we'll post this buffer |
| 37 | PRIV_USAGE_LOCKED_FOR_POST = 0x80000000, |
| 38 | PRIV_MIN_SWAP_INTERVAL = 0, |
| 39 | PRIV_MAX_SWAP_INTERVAL = 1, |
| 40 | }; |
| 41 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 42 | struct private_module_t { |
| 43 | gralloc_module_t base; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 44 | struct private_handle_t* framebuffer; |
| 45 | uint32_t fbFormat; |
| 46 | uint32_t flags; |
| 47 | uint32_t numBuffers; |
| 48 | uint32_t bufferMask; |
| 49 | pthread_mutex_t lock; |
Naseer Ahmed | 8831816 | 2012-07-13 07:16:20 -0700 | [diff] [blame^] | 50 | private_handle_t *currentBuffer; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 51 | struct fb_var_screeninfo info; |
| 52 | struct fb_fix_screeninfo finfo; |
| 53 | float xdpi; |
| 54 | float ydpi; |
| 55 | float fps; |
| 56 | uint32_t swapInterval; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 57 | #if defined(__cplusplus) && defined(HDMI_DUAL_DISPLAY) |
| 58 | int orientation; |
| 59 | int videoOverlay; // VIDEO_OVERLAY - 2D or 3D |
| 60 | int secureVideoOverlay; // VideoOverlay is secure |
| 61 | uint32_t currentOffset; |
| 62 | int enableHDMIOutput; // holds the type of external display |
| 63 | bool trueMirrorSupport; |
| 64 | bool exitHDMIUILoop; |
| 65 | float actionsafeWidthRatio; |
| 66 | float actionsafeHeightRatio; |
| 67 | bool hdmiStateChanged; |
| 68 | hdmi_mirroring_state hdmiMirroringState; |
| 69 | pthread_mutex_t overlayLock; |
| 70 | pthread_cond_t overlayPost; |
| 71 | #endif |
| 72 | }; |
| 73 | |
| 74 | |
| 75 | |
| 76 | #endif /* FB_PRIV_H */ |