1 /*
2 // Copyright (c) 2014 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16 #include <common/utils/HwcTrace.h>
17 #include <ips/tangier/TngDisplayContext.h>
18 #include <ips/anniedale/AnnPlaneManager.h>
19 #include <platforms/merrifield_plus/PlatfBufferManager.h>
20 #include <DummyDevice.h>
21 #include <IDisplayDevice.h>
22 #include <platforms/merrifield_plus/PlatfPrimaryDevice.h>
23 #include <platforms/merrifield_plus/PlatfExternalDevice.h>
24 #include <platforms/merrifield_plus/PlatfHwcomposer.h>
25
26
27
28 namespace android {
29 namespace intel {
30
PlatfHwcomposer()31 PlatfHwcomposer::PlatfHwcomposer()
32 : Hwcomposer()
33 {
34 CTRACE();
35 }
36
~PlatfHwcomposer()37 PlatfHwcomposer::~PlatfHwcomposer()
38 {
39 CTRACE();
40 }
41
createDisplayPlaneManager()42 DisplayPlaneManager* PlatfHwcomposer::createDisplayPlaneManager()
43 {
44 CTRACE();
45 return (new AnnPlaneManager());
46 }
47
createBufferManager()48 BufferManager* PlatfHwcomposer::createBufferManager()
49 {
50 CTRACE();
51 return (new PlatfBufferManager());
52 }
53
createDisplayDevice(int disp,DisplayPlaneManager & dpm)54 IDisplayDevice* PlatfHwcomposer::createDisplayDevice(int disp,
55 DisplayPlaneManager& dpm)
56 {
57 CTRACE();
58
59 switch (disp) {
60 case IDisplayDevice::DEVICE_PRIMARY:
61 #ifdef INTEL_SUPPORT_HDMI_PRIMARY
62 return new PlatfExternalDevice(*this, dpm);
63 #else
64 return new PlatfPrimaryDevice(*this, dpm);
65 #endif
66
67 case IDisplayDevice::DEVICE_EXTERNAL:
68 #ifdef INTEL_SUPPORT_HDMI_PRIMARY
69 return new DummyDevice((uint32_t)disp, *this);
70 #else
71 return new PlatfExternalDevice(*this, dpm);
72 #endif
73
74 case IDisplayDevice::DEVICE_VIRTUAL:
75 return new DummyDevice((uint32_t)disp, *this);
76
77 default:
78 ELOGTRACE("invalid display device %d", disp);
79 return NULL;
80 }
81 }
82
createDisplayContext()83 IDisplayContext* PlatfHwcomposer::createDisplayContext()
84 {
85 CTRACE();
86 return new TngDisplayContext();
87 }
88
createHwcomposer()89 Hwcomposer* Hwcomposer::createHwcomposer()
90 {
91 CTRACE();
92 return new PlatfHwcomposer();
93 }
94
95 } //namespace intel
96 } //namespace android
97