summaryrefslogtreecommitdiffstats
path: root/adf
diff options
context:
space:
mode:
authorMarissa Wall <marissaw@google.com>2016-06-02 12:20:51 -0700
committerMarissa Wall <marissaw@google.com>2017-03-02 17:40:09 +0000
commitb4f00414215183e41eb701e53289bfe0d4db0e8d (patch)
treefa24da3330e823390c76fe1a092e07987bc3c0fb /adf
parent9dcd750d8139b93272c9a49533b3bbde138ab6aa (diff)
downloadsystem_core-b4f00414215183e41eb701e53289bfe0d4db0e8d.tar.gz
system_core-b4f00414215183e41eb701e53289bfe0d4db0e8d.tar.bz2
system_core-b4f00414215183e41eb701e53289bfe0d4db0e8d.zip
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
Diffstat (limited to 'adf')
-rw-r--r--adf/libadfhwc/adfhwc.cpp14
-rw-r--r--adf/libadfhwc/include/adfhwc/adfhwc.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/adf/libadfhwc/adfhwc.cpp b/adf/libadfhwc/adfhwc.cpp
index df2300ee4..902425e32 100644
--- a/adf/libadfhwc/adfhwc.cpp
+++ b/adf/libadfhwc/adfhwc.cpp
@@ -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;
diff --git a/adf/libadfhwc/include/adfhwc/adfhwc.h b/adf/libadfhwc/include/adfhwc/adfhwc.h
index bd8e7d479..4f7092507 100644
--- a/adf/libadfhwc/include/adfhwc/adfhwc.h
+++ b/adf/libadfhwc/include/adfhwc/adfhwc.h
@@ -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