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 <IDisplayDevice.h> 18 #include <common/base/Drm.h> 19 #include <DrmConfig.h> 20 21 22 namespace android { 23 namespace intel { 24 getDrmPath()25const char* DrmConfig::getDrmPath() 26 { 27 return "/dev/card0"; 28 } 29 getDrmConnector(int device)30uint32_t DrmConfig::getDrmConnector(int device) 31 { 32 if (device == IDisplayDevice::DEVICE_PRIMARY) 33 return DRM_MODE_CONNECTOR_MIPI; 34 else if (device == IDisplayDevice::DEVICE_EXTERNAL) 35 return DRM_MODE_CONNECTOR_DVID; 36 return DRM_MODE_CONNECTOR_Unknown; 37 } 38 getDrmEncoder(int device)39uint32_t DrmConfig::getDrmEncoder(int device) 40 { 41 if (device == IDisplayDevice::DEVICE_PRIMARY) 42 return DRM_MODE_ENCODER_MIPI; 43 else if (device == IDisplayDevice::DEVICE_EXTERNAL) 44 return DRM_MODE_ENCODER_TMDS; 45 return DRM_MODE_ENCODER_NONE; 46 } 47 getFrameBufferFormat()48uint32_t DrmConfig::getFrameBufferFormat() 49 { 50 return HAL_PIXEL_FORMAT_RGBX_8888; 51 } 52 getFrameBufferDepth()53uint32_t DrmConfig::getFrameBufferDepth() 54 { 55 return 24; 56 } 57 getFrameBufferBpp()58uint32_t DrmConfig::getFrameBufferBpp() 59 { 60 return 32; 61 } 62 getUeventEnvelope()63const char* DrmConfig::getUeventEnvelope() 64 { 65 return "change@/devices/pci0000:00/0000:00:02.0/drm/card0"; 66 } 67 getHotplugString()68const char* DrmConfig::getHotplugString() 69 { 70 return "HOTPLUG=1"; 71 } 72 getRepeatedFrameString()73const char* DrmConfig::getRepeatedFrameString() 74 { 75 return "REPEATED_FRAME"; 76 } 77 78 } // namespace intel 79 } // namespace android 80