Skip to content

Commit

Permalink
sdm: Implement GetFirstDisplayInterfaceType API
Browse files Browse the repository at this point in the history
CRs-Fixed: 3306578
Change-Id: I4f194001ec0e02d3a07af346b4e3a606681fbc26
  • Loading branch information
Chirag Khurana authored and Gerrit - the friendly Code Review server committed Feb 13, 2023
1 parent 2d1e431 commit 900472f
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions sdm/libs/dal/hw_info_drm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/*
* Changes from Qualcomm Innovation Center are provided under the following license:
*
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted (subject to the limitations in the
Expand Down Expand Up @@ -893,8 +893,24 @@ void HWInfoDRM::GetSDMFormat(uint32_t drm_format, uint64_t drm_format_modifier,
}

DisplayError HWInfoDRM::GetFirstDisplayInterfaceType(HWDisplayInterfaceInfo *hw_disp_info) {
hw_disp_info->type = kBuiltIn;
hw_disp_info->is_connected = true;
HWDisplaysInfo hw_displays_info = {};

DisplayError error = GetDisplaysStatus(&hw_displays_info);
if (error != kErrorNone) {
DLOGE("Failed to get connected display list. Error = %d", error);
return error;
}

for (auto &iter : hw_displays_info) {
auto &info = iter.second;
if (info.is_primary) {
hw_disp_info->type = info.display_type;
hw_disp_info->is_connected = info.is_connected;
DLOGI("Primary display: %d-%d, connected: %s", info.display_id,
info.display_type, info.is_connected ? "true" : "false");
break;
}
}

return kErrorNone;
}
Expand Down

0 comments on commit 900472f

Please sign in to comment.