libadfhwc: add adf_set_active_config_hwc2 support

Add the necessary set mode support to enable HWC2's set_active_config

Test: run gtests located in frameworks/native/services/surfaceflinger/tests/hwc2
Change-Id: I686dce91a2d8fe86db13c66d22f81960c2f8e8f2
This commit is contained in:
Marissa Wall 2016-06-02 12:20:51 -07:00
parent 9dcd750d81
commit b4f0041421
2 changed files with 16 additions and 0 deletions

View File

@ -217,6 +217,20 @@ int adf_getDisplayAttributes_hwc2(struct adf_hwc_helper *dev, int disp,
return 0;
}
int adf_set_active_config_hwc2(struct adf_hwc_helper *dev, int disp,
uint32_t config)
{
if ((size_t)disp >= dev->intf_fds.size())
return -EINVAL;
if (config >= dev->display_configs.size())
return -EINVAL;
struct drm_mode_modeinfo mode = dev->display_configs[config];
return adf_interface_set_mode(dev->intf_fds[disp], &mode);
}
static void handle_adf_event(struct adf_hwc_helper *dev, int disp)
{
adf_event *event;

View File

@ -132,6 +132,8 @@ int adf_getDisplayAttributes(struct adf_hwc_helper *dev, int disp,
*/
int adf_getDisplayAttributes_hwc2(struct adf_hwc_helper *dev, int disp,
uint32_t config, const uint32_t *attributes, int32_t *values);
int adf_set_active_config_hwc2(struct adf_hwc_helper *dev, int disp,
uint32_t config);
__END_DECLS