summaryrefslogtreecommitdiffstats
path: root/minui/graphics_drm.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* minui: Add support for multiple connectorsWeizhung Ding2022-01-251-69/+120
| | | | | | | | Add support for multiple connectors. Bug: 194732653 Test: charging animation can be displayed on different connectors Change-Id: If9b9eac25ce6e4c582aeb7c52e94ca266f623438
* use create_dumb.size as size of bufferKelvin Zhang2021-05-171-2/+12
| | | | | | | | | | | | | | | According to `man drm-memory` , "The size field contains the absolute size in bytes of the buffer. This can normally also be computed with (height * pitch + width) * bpp / 4". Which suggests that we should use the .size field to allocate buffer. Test: th Test: go to recovery, make sure contents are properly displayed. BYPASS_INCLUSIVE_LANGUAGE_REASON=commit message referenced "man", which is a linux command for lookup manual pages. Change-Id: I512be6b7d493ef1783f2b7f746e279bc1dfe65f2
* minui: add ARGB_8888 formatAdrian Salido2019-12-131-0/+4
| | | | | | | | | | | | | | | | | | | | Minui currently really only supports composing in 2 different formats (see gr_color()) with ALPHA always as MSB. However, some devices interpret PixelFormat as either Big Endian (i.e. ARGB has alpha at MSB) or Little Endian (i.e. BGRA has alpha at MSB). This change attempts to give multiple options to specify the same format depending on device interpretation, while keeping just 2 different composition formats supported by minui. * ARGB + BGRA: Pixels have (A)lpha at MSB and (B)lue at LSB * RGBX + ABGR: Pixels have (A)lpha at MSB and (R)ed at LSB With this in mind, limiting the use of png_set_bgr() to happen only for (ARGB/BGRA) combination while leaving (RGBX/ABGR) unchanged. Bug: 143480444 Test: Boot device with TARGET_RECOVERY_PIXEL_FORMAT := <<all>> Change-Id: Ia0f94ccbc564b8def7c9416483712ff1abbbf49a
* Use O_CLOEXEC at a few places.Tao Bao2019-03-011-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
* minui: Remove the default and copy ctors for GRSurface.Tao Bao2018-11-011-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
* minui: Cleanup GRSurfaceDrm and MinuiBackendDrm.Tao Bao2018-10-241-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
* minui: Move GRSurface into a class.Tao Bao2018-10-231-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
* Fix the DRM_FORMAT match with corresponding PixelFormattangrobin2018-08-071-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
* minui: Use runtime properties instead of build time vars.Tao Bao2018-08-021-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
* minui/drm: wait for page flip completionJeremy Compostella2018-07-031-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>
* minui: Handle the failures from the drm backend in gr_initTianjie Xu2018-06-061-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
* minui: Move graphics_{adf,drm,fbdev} into classes.Tao Bao2017-02-111-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
* minui: Clean up graphics_drm.cpp.Tao Bao2017-02-071-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
* minui: Export minui/minui.h.Tao Bao2017-01-171-2/+1
| | | | | | | For libminui static and shared libraries. Test: build Change-Id: Ib30dc5e2ef4a3c8b3ca3a0cec68cb65e229a0c16
* Add drm support to minuiStéphane Marchesin2015-07-021-0/+476
Bug: 22231636 Change-Id: I103c8e906b7dd9862b7bb89d8642268e9a3006b4 Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>