blob: 377265f00f897f5187908c044903fafe1ffba778 [file] [log] [blame]
Naseer Ahmed29a26812012-06-14 00:56:20 -07001/*
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 Shahe012f7a2012-08-18 15:11:57 -070020#include "mdp_version.h"
Naseer Ahmed29a26812012-06-14 00:56:20 -070021
22namespace ovutils = overlay::utils;
23
24namespace overlay {
25
Naseer Ahmedf48aef62012-07-20 09:05:53 -070026int IRotatorHw::getRotatorHwType() {
Saurabh Shahe012f7a2012-08-18 15:11:57 -070027 int mdpVersion = qdutils::MDPVersion::getInstance().getMDPVersion();
28 if (mdpVersion == qdutils::MDSS_V5)
29 return TYPE_MDSS;
Naseer Ahmedf48aef62012-07-20 09:05:53 -070030 return TYPE_MDP;
Naseer Ahmed29a26812012-06-14 00:56:20 -070031}
32
Naseer Ahmedf48aef62012-07-20 09:05:53 -070033bool 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 Ahmed29a26812012-06-14 00:56:20 -070043 }
Naseer Ahmedf48aef62012-07-20 09:05:53 -070044 return ret;
Naseer Ahmed29a26812012-06-14 00:56:20 -070045}
46
Naseer Ahmed29a26812012-06-14 00:56:20 -070047}