Merge "sdm: Fix memory leak in connector modes"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
8603d732c6
@@ -407,8 +407,7 @@ struct DRMConnectorInfo {
|
|||||||
uint32_t mmWidth;
|
uint32_t mmWidth;
|
||||||
uint32_t mmHeight;
|
uint32_t mmHeight;
|
||||||
uint32_t type;
|
uint32_t type;
|
||||||
uint32_t num_modes;
|
std::vector<drmModeModeInfo> modes;
|
||||||
drmModeModeInfo *modes;
|
|
||||||
DRMTopology topology;
|
DRMTopology topology;
|
||||||
std::string panel_name;
|
std::string panel_name;
|
||||||
DRMPanelMode panel_mode;
|
DRMPanelMode panel_mode;
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ DisplayError HWTVDRM::Init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisplayError HWTVDRM::GetNumDisplayAttributes(uint32_t *count) {
|
DisplayError HWTVDRM::GetNumDisplayAttributes(uint32_t *count) {
|
||||||
*count = connector_info_.num_modes;
|
*count = UINT32(connector_info_.modes.size());
|
||||||
if (*count <= 0) {
|
if (*count <= 0) {
|
||||||
return kErrorHardware;
|
return kErrorHardware;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ DisplayError HWTVDRM::GetActiveConfig(uint32_t *active_config_index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DisplayError HWTVDRM::SetDisplayAttributes(uint32_t index) {
|
DisplayError HWTVDRM::SetDisplayAttributes(uint32_t index) {
|
||||||
if (index >= connector_info_.num_modes) {
|
if (index >= connector_info_.modes.size()) {
|
||||||
return kErrorNotSupported;
|
return kErrorNotSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,7 +162,7 @@ DisplayError HWTVDRM::GetConfigIndex(char *mode, uint32_t *index) {
|
|||||||
format = UINT32(stoi(str4.substr(str4.find(':') + 1)));
|
format = UINT32(stoi(str4.substr(str4.find(':') + 1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t idex = 0; idex < connector_info_.num_modes; idex ++) {
|
for (size_t idex = 0; idex < connector_info_.modes.size(); idex ++) {
|
||||||
if ((height == connector_info_.modes[idex].vdisplay) &&
|
if ((height == connector_info_.modes[idex].vdisplay) &&
|
||||||
(width == connector_info_.modes[idex].hdisplay) &&
|
(width == connector_info_.modes[idex].hdisplay) &&
|
||||||
(fps == connector_info_.modes[idex].vrefresh)) {
|
(fps == connector_info_.modes[idex].vrefresh)) {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ void HWVirtualDRM::InitializeConfigs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HWVirtualDRM::DumpConfigs() {
|
void HWVirtualDRM::DumpConfigs() {
|
||||||
for (uint32_t i = 0; i < (uint32_t)connector_info_.num_modes; i++) {
|
for (uint32_t i = 0; i < (uint32_t)connector_info_.modes.size(); i++) {
|
||||||
DLOGI(
|
DLOGI(
|
||||||
"Name: %s\tvref: %d\thdisp: %d\t hsync_s: %d\thsync_e:%d\thtotal: %d\t"
|
"Name: %s\tvref: %d\thdisp: %d\t hsync_s: %d\thsync_e:%d\thtotal: %d\t"
|
||||||
"vdisp: %d\tvsync_s: %d\tvsync_e: %d\tvtotal: %d\n",
|
"vdisp: %d\tvsync_s: %d\tvsync_e: %d\tvtotal: %d\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user