summaryrefslogtreecommitdiffstats
path: root/minui/graphics_drm.cpp (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-01Use O_CLOEXEC at a few places.Tao Bao1-1/+1
Found these FDs unintentionally propagated into forked processes (e.g. updater) during my local debugging. Use O_CLOEXEC to avoid that. Test: Dump open FDs in updater process. Test: Sideload a package on taimen (which uses framebuffer). Test: Run graphics test on taimen. Change-Id: I1fb65dd4a103c47d28b15973def9e9359c251ca3
2018-11-01minui: Remove the default and copy ctors for GRSurface.Tao Bao1-7/+3
As well as all the derived classes. Instances must be created with Create(). A default copy ctor would mess up the ownership of the mapped or allocated buffer in these classes, so that has been explicitly removed. Test: mmma -j bootable/recovery Test: Run recovery_unit_test on marlin. Test: `Run graphics test` on blueline. Change-Id: I69ce001a9ec9e3ac851edb6ec4d3fa11f4aaea08
2018-10-24minui: Cleanup GRSurfaceDrm and MinuiBackendDrm.Tao Bao1-114/+85
This CL adds a dtor to GRSurfaceDrm that handles the resource deallocation. It also manages MinuiBackendDrm::GRSurfaceDrms with smart pointers. Test: Build and boot into recovery on blueline. `Run graphics test`. Change-Id: Iff7bbdddbc0b5ab16483d00870794fca9f832bd5
2018-10-23minui: Move GRSurface into a class.Tao Bao1-7/+6
This CL adds GRSurface::Create() and dtor for managing the allocated memory in GRSurface class. It also adds GRSurface::data() that hides the underlying implementation, with both of const and non-const overloads. This allows `const GRSurface&` to be more useful - previously it only ensured a const member variable of `data`, instead of a read-only buffer it points to. It also marks the parameters in gr_texticon() and gr_blit() as const, as they're incoming source that shouldn't be altered. It corrects the type of gr_draw, which is the sink to be painted on (an earlier attempt was made in [1], but didn't get the full picture correctly). [1] https://android-review.googlesource.com/c/platform/bootable/recovery/+/704757/ Test: mmma -j bootable/recovery Test: recovery_unit_test on marlin Test: Run graphics test on marlin (fbdev). Test: Run graphics test on blueline (drm). Change-Id: I7904df084cd6c08fa04a9da97d01b4b1a6e3a20c
2018-08-07Fix the DRM_FORMAT match with corresponding PixelFormattangrobin1-3/+7
The DRM_FORMAT settings in DrmCreateSurface should match with the correct PixelFormat Bug: 112245291 Test: build and flash boot image to device. Change-Id: I3ee0de38256d1109cd5174b666e2f47dceb637e6
2018-08-02minui: Use runtime properties instead of build time vars.Tao Bao1-9/+10
This CL removes the use of the following build time macros, and uses the runtime property values instead. - TARGET_RECOVERY_PIXEL_FORMAT - TARGET_RECOVERY_OVERSCAN_PERCENT - TARGET_RECOVERY_DEFAULT_ROTATION Bug: 110380063 Test: Set up taimen with `TARGET_RECOVERY_DEFAULT_ROTATION := ROTATION_LEFT`. Build and check recovery UI. Test: Set up taimen with `TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888`. Build and check recovery UI. Change-Id: I4439556a03fde4805a18011ef72eff1373f31d47
2018-07-03minui/drm: wait for page flip completionJeremy Compostella1-1/+38
If two consecutive call are made to drmModePageFlip, the second call may fail with -EBUSY because the first flip is not completed yet. This patch adds a wait for completion mechanism based on drmHandleEvent. Change-Id: Ied13ebefc7523003431b1b307bae70d1a70cb24b Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com> Signed-off-by: Benoit Fradin <benoit.fradin@intel.com>
2018-06-06minui: Handle the failures from the drm backend in gr_initTianjie Xu1-6/+11
In a charger mode manual test, we encounter failures from the MinuiBackendDrm when calling DrmEnableCrtc and Flip. To make the minui more robust, we should fall back to another backend if drm's SetCrtc fails. And check the value of gr_draw before dereferencing. Bug: 80249440 Test: boot to recovery Change-Id: Ibd1ca1fb1115fe1132684586c54eccd8fb4c3ad9
2017-02-11minui: Move graphics_{adf,drm,fbdev} into classes.Tao Bao1-75/+49
This CL defines minui_backend as an interface, and expresses the three backends (adf, drm and fbdev) as subclasses to the interface. Test: 'Run graphics test' on N9, Pixel C and N5X. Change-Id: I0e23951c7b2e2ff918957a8d9fc8b0085b6e5952
2017-02-07minui: Clean up graphics_drm.cpp.Tao Bao1-351/+297
Remove unneeded header includes. Switch a few memset() to '= {}' style. Otherwise mostly cosmetic changes like reformatting. Test: 'Run graphics test' on ryu (which is a DRM device). Change-Id: I4b0ab2dc0da69a690f09e4f0674b8377de662962
2017-01-17minui: Export minui/minui.h.Tao Bao1-2/+1
For libminui static and shared libraries. Test: build Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
2015-07-02Add drm support to minuiStéphane Marchesin1-0/+476
Bug: 22231636 Change-Id: I103c8e906b7dd9862b7bb89d8642268e9a3006b4 Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>