android_hardware_qcom_display/libhwcomposer/hwc_external.h
Arun Kumar K.R a72904b1dc hwc: enable vsync for external display
- wait for hdmi vsync when connected to hdmi
- add commit to call PANDISPLAY for updating ext display
- add functions to close fb and reset info

Change-Id: Icdd3620bd9d15240a88a26a3f1bf9c07d58d011b
2012-07-27 08:23:30 -07:00

78 lines
2.1 KiB
C++

/*
* Copyright (C) 2010 The Android Open Source Project
* Copyright (C) 2012, Code Aurora Forum. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef HWC_EXTERNAL_DISPLAY_H
#define HWC_EXTERNAL_DISPLAY_H
#include <fb_priv.h>
struct hwc_context_t;
namespace qhwc {
class ExternalDisplay
{
//Type of external display - OFF, HDMI, WFD
enum external_display_type {
EXT_TYPE_NONE,
EXT_TYPE_HDMI,
EXT_TYPE_WIFI
};
// Mirroring state
enum external_mirroring_state {
EXT_MIRRORING_OFF,
EXT_MIRRORING_ON,
};
public:
ExternalDisplay(hwc_context_t* ctx);
~ExternalDisplay();
int getExternalDisplay() const;
void setExternalDisplay(int connected);
bool commit();
int enableHDMIVsync(int enable);
private:
bool readResolution();
int parseResolution(char* edidStr, int* edidModes);
void setResolution(int ID);
bool openFramebuffer();
bool closeFrameBuffer();
bool writeHPDOption(int userOption) const;
bool isValidMode(int ID);
void handleUEvent(char* str, int len);
int getModeOrder(int mode);
int getBestMode();
void resetInfo();
int mFd;
int mExternalDisplay;
int mCurrentMode;
char mEDIDs[128];
int mEDIDModes[64];
int mModeCount;
hwc_context_t *mHwcContext;
fb_var_screeninfo mVInfo;
};
}; //qhwc
// ---------------------------------------------------------------------------
#endif //HWC_EXTERNAL_DISPLAY_H