diff options
author | Jonathan Hamilton <jonathan.hamilton@imgtec.com> | 2016-05-12 19:39:20 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-05-12 19:39:20 +0200 |
commit | 856ba940b75cf4cf0ab81319443d82fef40ada2f (patch) | |
tree | 39b2d5b4b394708e5b38f5797ba94ef81c907896 /minui | |
parent | Merge "updater, minzip: Remove unnecessary O_SYNC flags." am: c7d7eb2225 am: d03ee52eb7 (diff) | |
parent | Merge "Keep ADF device alive for the lifetime of the minui backend" am: 14352497f0 (diff) | |
download | android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar.gz android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar.bz2 android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar.lz android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar.xz android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.tar.zst android_bootable_recovery-856ba940b75cf4cf0ab81319443d82fef40ada2f.zip |
Diffstat (limited to 'minui')
-rw-r--r-- | minui/graphics_adf.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/minui/graphics_adf.cpp b/minui/graphics_adf.cpp index 5d0867f58..a72e40b58 100644 --- a/minui/graphics_adf.cpp +++ b/minui/graphics_adf.cpp @@ -42,6 +42,8 @@ struct adf_pdata { adf_id_t eng_id; __u32 format; + adf_device dev; + unsigned int current_surface; unsigned int n_surfaces; adf_surface_pdata surfaces[2]; @@ -163,21 +165,20 @@ static GRSurface* adf_init(minui_backend *backend) pdata->intf_fd = -1; for (i = 0; i < n_dev_ids && pdata->intf_fd < 0; i++) { - adf_device dev; - int err = adf_device_open(dev_ids[i], O_RDWR, &dev); + int err = adf_device_open(dev_ids[i], O_RDWR, &pdata->dev); if (err < 0) { fprintf(stderr, "opening adf device %u failed: %s\n", dev_ids[i], strerror(-err)); continue; } - err = adf_device_init(pdata, &dev); - if (err < 0) + err = adf_device_init(pdata, &pdata->dev); + if (err < 0) { fprintf(stderr, "initializing adf device %u failed: %s\n", dev_ids[i], strerror(-err)); - - adf_device_close(&dev); + adf_device_close(&pdata->dev); + } } free(dev_ids); @@ -226,6 +227,7 @@ static void adf_exit(minui_backend *backend) adf_pdata *pdata = (adf_pdata *)backend; unsigned int i; + adf_device_close(&pdata->dev); for (i = 0; i < pdata->n_surfaces; i++) adf_surface_destroy(&pdata->surfaces[i]); if (pdata->intf_fd >= 0) |