aboutsummaryrefslogtreecommitdiff
path: root/drm
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2021-11-28 08:46:30 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2021-12-20 21:09:22 +0800
commitcdee4f2b3d561e457b95a94dd69ffca2d8e27385 (patch)
tree378849aa3012461635e90fb6f253f08ebcb190d7 /drm
parent720f65224fb0ceaaee8581c4db1e55a79669c494 (diff)
downloaddrm_hwcomposer-cdee4f2b3d561e457b95a94dd69ffca2d8e27385.tar.gz
drm_hwcomposer: support more connector types
according to the drm_connector_enum_list defined in the kernel file drivers/gpu/drm/drm_connector.c Otherwise for the new connector type, the connector name will be "None" to be printed in the logcat, like this: 12-13 05:38:06.263 383 383 I hwc-backend: Backend 'generic' for 'None' and driver 'omapdrm' was successfully set with this change, it will be fixed with the connector type like this: 12-13 06:01:57.672 342 342 I hwc-backend: Backend 'generic' for 'DPI-1' and driver 'omapdrm' was successfully set Also updated the internal() and external() functions to make the newly added SPI and USB are valid types Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'drm')
-rw-r--r--drm/DrmConnector.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/drm/DrmConnector.cpp b/drm/DrmConnector.cpp
index 5b3c697..32b6d24 100644
--- a/drm/DrmConnector.cpp
+++ b/drm/DrmConnector.cpp
@@ -28,9 +28,17 @@
#include "DrmDevice.h"
#include "utils/log.h"
+#ifndef DRM_MODE_CONNECTOR_SPI
+#define DRM_MODE_CONNECTOR_SPI 19
+#endif
+
+#ifndef DRM_MODE_CONNECTOR_USB
+#define DRM_MODE_CONNECTOR_USB 20
+#endif
+
namespace android {
-constexpr size_t kTypesCount = 17;
+constexpr size_t kTypesCount = 21;
DrmConnector::DrmConnector(DrmDevice *drm, drmModeConnectorPtr c,
DrmEncoder *current_encoder,
@@ -120,14 +128,15 @@ void DrmConnector::set_display(int display) {
bool DrmConnector::internal() const {
return type_ == DRM_MODE_CONNECTOR_LVDS || type_ == DRM_MODE_CONNECTOR_eDP ||
type_ == DRM_MODE_CONNECTOR_DSI ||
- type_ == DRM_MODE_CONNECTOR_VIRTUAL || type_ == DRM_MODE_CONNECTOR_DPI;
+ type_ == DRM_MODE_CONNECTOR_VIRTUAL ||
+ type_ == DRM_MODE_CONNECTOR_DPI || type_ == DRM_MODE_CONNECTOR_SPI;
}
bool DrmConnector::external() const {
return type_ == DRM_MODE_CONNECTOR_HDMIA ||
type_ == DRM_MODE_CONNECTOR_DisplayPort ||
type_ == DRM_MODE_CONNECTOR_DVID || type_ == DRM_MODE_CONNECTOR_DVII ||
- type_ == DRM_MODE_CONNECTOR_VGA;
+ type_ == DRM_MODE_CONNECTOR_VGA || type_ == DRM_MODE_CONNECTOR_USB;
}
bool DrmConnector::writeback() const {
@@ -144,9 +153,10 @@ bool DrmConnector::valid_type() const {
std::string DrmConnector::name() const {
constexpr std::array<const char *, kTypesCount> kNames =
- {"None", "VGA", "DVI-I", "DVI-D", "DVI-A", "Composite",
- "SVIDEO", "LVDS", "Component", "DIN", "DP", "HDMI-A",
- "HDMI-B", "TV", "eDP", "Virtual", "DSI"};
+ {"None", "VGA", "DVI-I", "DVI-D", "DVI-A", "Composite",
+ "SVIDEO", "LVDS", "Component", "DIN", "DP", "HDMI-A",
+ "HDMI-B", "TV", "eDP", "Virtual", "DSI", "DPI",
+ "Writeback", "SPI", "USB"};
if (type_ < kTypesCount) {
std::ostringstream name_buf;