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) 2010-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 | #include "overlayRotator.h" |
| 19 | #include "overlayUtils.h" |
Saurabh Shah | e012f7a | 2012-08-18 15:11:57 -0700 | [diff] [blame^] | 20 | #include "mdp_version.h" |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 21 | |
| 22 | namespace ovutils = overlay::utils; |
| 23 | |
| 24 | namespace overlay { |
| 25 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 26 | int IRotatorHw::getRotatorHwType() { |
Saurabh Shah | e012f7a | 2012-08-18 15:11:57 -0700 | [diff] [blame^] | 27 | int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion(); |
| 28 | if (mdpVersion == qdutils::MDSS_V5) |
| 29 | return TYPE_MDSS; |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 30 | return TYPE_MDP; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 33 | bool RotMem::close() { |
| 34 | bool ret = true; |
| 35 | for(uint32_t i=0; i < RotMem::MAX_ROT_MEM; ++i) { |
| 36 | // skip current, and if valid, close |
| 37 | if(m[i].valid()) { |
| 38 | if(m[i].close() == false) { |
| 39 | ALOGE("%s error in closing rot mem %d", __FUNCTION__, i); |
| 40 | ret = false; |
| 41 | } |
| 42 | } |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 43 | } |
Naseer Ahmed | f48aef6 | 2012-07-20 09:05:53 -0700 | [diff] [blame] | 44 | return ret; |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 45 | } |
| 46 | |
Naseer Ahmed | 29a2681 | 2012-06-14 00:56:20 -0700 | [diff] [blame] | 47 | } |