summaryrefslogtreecommitdiff
path: root/hwc2/FixedSizeModeMgr.h (plain)
blob: 683a367752fb203f982d486acd2a53e315834601
1/*
2 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
3 *
4 * This source code is subject to the terms and conditions defined in the
5 * file 'LICENSE' which is part of this source code package.
6 *
7 * Description:
8 */
9
10#ifndef FIXED_SIZE_MODE_MGR_H
11#define FIXED_SIZE_MODE_MGR_H
12
13#include "HwcModeMgr.h"
14
15/*
16 * FixedSizeModeMgr:
17 * This class designed for TV or reference box.
18 * The display size is fixed (the framebuffer size).
19 * But the refresh rate, dpi will update when display changed.
20 * For example:user choosed a new display mode in setting.
21 */
22class FixedSizeModeMgr : public HwcModeMgr {
23public:
24 FixedSizeModeMgr();
25 ~FixedSizeModeMgr();
26
27 hwc_modes_policy_t getPolicyType();
28 const char * getName();
29
30 void setFramebufferSize(uint32_t w, uint32_t h);
31 void setDisplayResources(
32 std::shared_ptr<HwDisplayCrtc> & crtc,
33 std::shared_ptr<HwDisplayConnector> & connector);
34 int32_t update();
35 bool needCallHotPlug(){return true;};
36 int32_t getDisplayMode(drm_mode_info_t & mode);
37
38 int32_t getDisplayConfigs(
39 uint32_t * outNumConfigs, uint32_t * outConfigs);
40 int32_t getDisplayAttribute(
41 uint32_t config, int32_t attribute, int32_t* outValue, int32_t caller);
42 int32_t getActiveConfig(uint32_t * outConfig, int32_t caller);
43 int32_t setActiveConfig(uint32_t config);
44 void resetTags(){};
45 void dump(String8 & dumpstr);
46
47protected:
48 std::shared_ptr<HwDisplayConnector> mConnector;
49 std::shared_ptr<HwDisplayCrtc> mCrtc;
50
51 std::map<uint32_t, drm_mode_info_t> mModes;
52 drm_mode_info_t mCurMode;
53
54 uint32_t mFbWidth;
55 uint32_t mFbHeight;
56
57};
58
59#endif/*FIXED_SIZE_MODE_MGR_H*/
60