summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-07-24drm_hwcomposer: Add feature to search for KMS DRI cardHEADmasterMatvii Zorin2-2/+30
Most modern SOCs have separate IP cores for GPU and Display Unit (KMS). Also, there is no warranty that the KMS card will always have /dev/dri/card0 path and GPU - /dev/dri/card1, but drm_hwcomposer should open only KMS device. The order can depend on many factors. For example: on the rpi4 board, it was observed that enabling the WIFI kernel module swapping the card order. Therefore searching for the KMS card is the only efficient solution. The IsKMSDev function returns true when the file descriptor on the path is successfully opened, the drmlib function is returned resources and the target device has at least one CTRC, connector, and encoder. Also, the patch enables finding KMS devices in the case of the absence of the system property specification. Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com> Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com> Change-Id: I8874a50188207833389fadd4815b42a80bf69240
2020-07-03drm_hwcomposer: Implement *DisplayBrightness* stubsAndrii Chepurnyi2-0/+22
Implement *DisplayBrightness* stub to be able boot Android 11 using android.hardware.graphics.composer@2.3-service. This change caused by error during boot: failed to get hwcomposer2 function 61 61 is equal to SetDisplayBrightness. GetDisplayBrightnessSupport is a companion of it. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: Idacb32abdcf7ac399ef989f24ab7a360248466f9
2020-07-03drm_hwcomposer: Implement SetColorModeWithIntent stubAndrii Chepurnyi2-0/+15
Fix VTS test GraphicsComposerHidlTest.SetColorMode_2_2BadParameter. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: Ia8ae6c0d7cb2a6bf09c205a04963ed359c5126a3
2020-07-03drm_hwcomposer: Implement GetRenderIntents stubAndrii Chepurnyi2-0/+31
Fix VTS test GraphicsComposerHidlTest.GetRenderIntentsBadDisplay. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I5ceec735b5684581178070e75d96f5961b774f5f
2020-07-03drm_hwcomposer: Fix ValidateDisplay() when lowest z-order is nonzeroLiviu Dudau1-2/+7
ValidateDisplay()'s algorithm for achieving minimal GPU load assumes that the lowest z-order is zero and that layers have sequential z-orders. CalcPixOps() and MarkValidated() are also written with the same assumption. However, there is no such guarantee provided by SurfaceFlinger and VTS tests like PRESENT_DISPLAY_NO_LAYER_STATE_CHANGES fail as they only have one layer with z-order of 10. Normalise the mapping between layers and z-order so that the algorithm works as intended. Signed-off-by: Liviu Dudau <liviu.dudau@arm.com> Fixes commit b7b81cfba252 ("drm_hwcomposer: Choose client layer range to achieve minimal GPU load") Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I71b76b9d151bf506ad6026f5b1f9de6b6c0dc7c1
2020-07-01drm_hwcomposer: Run test commit only when it actually neededMatvii Zorin1-1/+3
Composition testing is expensive. We do not need to spend CPU time when: * All layers are marked as a client. The patch skips CommitFrame function called by the ValidateDisplay method in this case. Signed-off-by: Matvii Zorin <matvii.zorin@globallogic.com>
2020-06-26drm_hwcomposer: Fix invalid buffer_handle_t pointerPaul Howgego1-6/+0
In Android 11, at boot time, I see the following sequence of calls from SurfaceFlinger that trigger this: // Composition type for layer is saved in DRM HWC Layer validated_type_ validateDisplay() // Layer composition type saved in DRM HWC Layer sf_type_ acceptDisplayChanges() // Composition type in Layer sf_type_ is now "client" so DRM HWC doesn't // update the Layer buffer pointer setLayerBuffer() // DRM HWC Layer sf_type_ is now changed back to "device" setLayerCompositionType() // DRM HWC iterates through the layers and finds that Layer composition // type in sf_type_ is "device" so thinks it is fine to calls // importBuffer() but this Layer now has an invalid pointer as the // setLayerBuffer() was ignored. validateDisplay() Thus this patch, changes the logic to always update the buffer_handle_t pointer in setLayerBuffer regardless of composition type rather than keeping the invalid buffer_handle_t in the Layer obect. The composition type may be changed back to device composition by setLayerCompositionType at which point the Layer object needs to have saved the buffer_handle_t. Not sure how we could reproduce the same sequence of calls on another Android version. Signed-off-by: Paul Howgego <paul.howgego@arm.com> [jstultz: Reword and add context from merge request to the commit message] Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I88a11ee2fee742d6154a482455a8532a95e681d3
2020-06-26drm_hwcomposer: Propagate PLATFORM_SDK_VERSION to cflagsAndrii Chepurnyi1-0/+6
PLATFORM_SDK_VERSION is needed for already present code (GetDisplayIdentificationData/GetDisplayCapabilities), which implements some of the android.hardware.graphics.composer@2.3 API. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Change-Id: I1a5019e9d8ae327db41f55cee0ba3636f913928f
2020-04-14drm_hwcomposer: Fix GetDisplayIdentificationDataAndrii Chepurnyi1-3/+6
Fix GetDisplayIdentificationData, introduced by commit: b3d817815fad. Edid data should be copied instead of assign. Signed-off-by: Andrii Chepurnyi <andrii_chepurnyi@epam.com>
2020-02-21drm_hwcomposer: Relax failure when no EDID property is foundJohn Stultz1-2/+1
Crosvm doesn't implement EDID virtio cmd, so when commit b3d817815fad ("drm_hwcomposer: Add GetDisplayCapabilities and getDisplayIdentificationData") landed, it broke crosvm targets using --gpu_mode=drm_virgl This patch tries to ease that restriction, so a lack of EDID isn't considered fatal. Change-Id: I8ce899fc71d2b1187d364918328473ef1890d52d Signed-off-by: John Stultz <john.stultz@linaro.org>
2020-02-20drm_hwcomposer: Improve error messages.Peter Collingbourne2-3/+3
- Don't negate errno before passing to strerror, at least on bionic this results in "Unknown error -x" instead of the actual error. - Fix another error message to print strerror(errno) instead of the returned fd which will always be -1. - Fix another error message to call strerror for consistency. Signed-off-by: Peter Collingbourne <pcc@google.com>
2020-02-19drm_hwcomposer: Add statistics on flattening to dump messageRoman Kovalivskyi4-11/+55
We need some way to verify that current composition is not failed to compose, but instead sent to flatten on GPU. Dump message shows current flattening state. It also displays how often do compositor switches into flattening. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-02-19drm_hwcomposer: Add fallback to client for layers flatteningRoman Kovalivskyi4-43/+140
Google recommends to delegate composition to GLES instead of HWC when screen isn't updating to conserve power, as stated on page https://source.android.com/devices/graphics/implement-hwc. Current implementation of hwcomposer has flattening of layers if after some time there were no updates of frames, but it uses writeback connector. Not every device has a support of writeback feature, so some sort of fallback should be provided. It is possible to fallback to client composition in case if writeback isn't available. This is used to reduce power consumption since squashing layers into a single layer on GPU and then using that buffer is more efficient than loading drm device. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-02-19drm_hwcomposer: Add property that allows disabling of hardware scalingRoman Stratiienko4-1/+26
Set `hwc.drm.scale_with_gpu` property to 1 in case composer hardware do not have scaling support. That will force layers that require scaling to be merged by GPU, and allow other layers to be merged by DRM. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2020-02-11drm_hwcomposer: Try to fix build with older Android Pie releasesJohn Stultz2-1/+6
Try to fix build regressions for P that were introduced with commit b3d81781 ("drm_hwcomposer: Add GetDisplayCapabilities and getDisplayIdentificationData") as noted in issue #30 https://gitlab.freedesktop.org/drm-hwcomposer/drm-hwcomposer/issues/30 Change-Id: I4bfeb952cff19d4c3511ead69df1186d3a04cc87 Signed-off-by: John Stultz <john.stultz@linaro.org>
2020-02-10drm_hwcomposer: Extract more BO data by Imagination importer v2Roman Stratiienko1-0/+2
Fields bo->hal_format and bo->pixel_stride should be set to pass validation by Mapper HAL v2.1 and v3.0. Otherwise UI is missing and the following message appears in the logcat: ``` 2576 E GraphicBufferMapper: validateBufferSize(0xe663b3637400) failed: 7 2576 E hwc-drm-utils: Failed to import buffer handle err: 7 2576 E hwc-drm-two: Failed to import layer, ret=7 ``` Fixes: e3ed48d728aa ("drm_hwcomposer: Add Imagination platform support") Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2020-02-04drm_hwcomposer: Revert "drm_hwcomposer: Extract more BO data by Imagination ↵John Stultz1-9/+2
importer" This reverts commit b2f2baeb9db0d0f4cbc0cac3184058d3fce85ea6. I'm trying to utilize a policy of lighter reviews w/ quick reverts when there are issues to keep things moving. So with that in mind I'm reverting "Extract more BO data by Imagination importer" since its breaking the build in AOSP. See: https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1225155/-1..1#message-828f83ed7fa89b3bdfff7b0b5b1dd7364c822892 https://android-review.googlesource.com/c/platform/external/drm_hwcomposer/+/1225916 This breakage is due to the importer code being tightly tied to the gralloc private handle definitions, which is a common problem as the gralloc and drm_hwcomposers are separately maintained. The beagle_x15 gralloc is apparently older, and doesn't have the newly utilized fields. So for now, revert this to stay in sync w/ AOSP. I'm happy to re-apply as soon as a fix is in place which adds some sort of versioning checks so hopefully drm_hwc can work with different versions of the gralloc code. Once users of the old gralloc code are updated, we can remove such version checks if needed. Change-Id: Ie72561061ea12cb58d3ba9616a62d05f4ffe78b0 Signed-off-by: John Stultz <john.stultz@linaro.org>
2020-01-24drm_hwcomposer: Extract more BO data by Imagination importerRoman Stratiienko1-2/+9
Fields bo->hal_format and bo->pixel_stride should be set to pass validation by Mapper HAL v2.1 and v3.0. Otherwise UI is missing and the following message appears in the logcat: ``` 2576 E GraphicBufferMapper: validateBufferSize(0xe663b3637400) failed: 7 2576 E hwc-drm-utils: Failed to import buffer handle err: 7 2576 E hwc-drm-two: Failed to import layer, ret=7 ``` Also copy suballocs data for future usage. Fixes: e3ed48d728aa ("drm_hwcomposer: Add Imagination platform support") Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2020-01-16drm_hwcomposer: Remove redundant hotplug callRoman Kovalivskyi1-3/+0
Initial hotplug state is reported back during callback registration, but during VTS tests we've noticed error that is caused by calling hotplug with same display twice. HandleInitialHotplugState calls hotplug function for each connected display, so it covers HWC_DISPLAY_PRIMARY too, therefore first call should be removed, as it is redundant and causes minor error. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-01-16drm_hwcomposer: Add check to vsync routine to avoid crash on callbackRoman Kovalivskyi2-5/+21
Vsync could be disabled during routine being running and this could potentially lead to crash on callback invocation. Crash happens if VSyncControl(false) was called when Routine has cached callback and unlocked mutex but haven't callback yet. At this point we can't be sure that callback is still valid so invoking it is incorrect behaviour. Second check if vsync is enabled drastically shortens window when we could go into invalid state, from the whole vblank invocation to several machine instructions between check and invocation. Please note that we can't check against cached value in this case, therefore operations on this flag should be atomic instead. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2020-01-04drm_hwcomposer: Add GetDisplayCapabilities and getDisplayIdentificationDataLowry Li (Arm Technology China)4-0/+63
Implement GetDisplayCapabilities() to get a list of supported capabilities. The drm core doesn't support layer CTM property yet and CRTC not having the CTM property member neither. So for this patch, we just return 0 for now. It can fix the segment fault while booting the Android on HWC2.3, caused by lack of this API. Implement getDisplayIdentificationData() to get the EDID blob data along with the size and port. Add edid property in DrmConnector. Signed-off-by: Lowry Li (Arm Technology China) <lowry.li@arm.com>
2019-12-19drm_hwcomposer: Extract ConvertBoInfo() from ImportBuffer() methodRoman Stratiienko12-138/+88
To check either BO could be imported on validation stage, we need to get more information regarding buffer (format, size, etc.) This extraction also allows us to make ImportBuffer() and CanImport() methods generic for all platforms. In case BO can't be imported due to already existant checks in ImportBuffer(), validator only marks single layer to be elaborated by GPU instead of whole composition. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-12-17drm_hwcomposer: Choose client layer range to achieve minimal GPU loadRoman Stratiienko2-16/+66
1. Allow CLIENT layer at any position. 2. Check all possible layer combination and choose most efficient based on total pixel operations value. Use case 1 - Layer count is greater than available planes Table shows difference before and after this commit for 4 or 2 planes cases: ``` z_order layer size pixels before(4) after(4) before(2) after(2) - 0 Wallpaper 1960x1080 2MiP CLIENT DEVICE CLIENT DEVICE 1 Launcher 1960x1080 2MiP CLIENT DEVICE CLIENT CLIENT 2 Status bar 1960x80 0.15MiP DEVICE DEVICE CLIENT CLIENT 3 Nav. bar 1960x80 0.15MiP DEVICE CLIENT CLIENT CLIENT 4 Cursor 24x24 576P DEVICE CLIENT DEVICE CLIENT Total pixels merged by CLIENT (GPU) 4MiP -> 0.15MiP 4.3MiP -> 2.3MiP ``` Use case 2 - Unsupported layer type in the middle (Dim layer, etc): Table shows difference before and after this commit for 4 or 2 planes cases: ``` z_order layer size pixels before(4) after(4) before(2) after(2) - 0 App 1960x1080 2MiP CLIENT DEVICE CLIENT DEVICE 1 Status bar 1960x80 0.15MiP CLIENT DEVICE CLIENT CLIENT 2 Nav. bar 1960x80 0.15MiP CLIENT DEVICE CLIENT CLIENT 3 Dim layer 1960x1080 2MiP CLIENT CLIENT CLIENT CLIENT 4 Dialog 1000x500 0.5MiP DEVICE CLIENT DEVICE CLIENT Total pixels merged by CLIENT (GPU) 4.3MiP -> 2.5MiP 4.3MiP -> 2.8MiP ``` Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-12-16drm_hwcomposer: Add simplistic SetColorTransform implementationRoman Kovalivskyi2-4/+28
VTS tests for SET_COLOR_TRANSFORM fails for now since SetColorTransform is marked as unsupported function. this commit tries to address this issue. We can't make complete implementation of those features for our platform for now, so we'd just save arguments for future use and force client composition if any color transformation is requested. This is perfectly acceptable way to pass VTS testcase for SET_COLOR_TRANSFORM. Commit da5839cf9258 ("drm_hwcomposer: Add support for GetColorModes & SetCursorPosition") implements GetColorModes and SetCursorPosition simply by adding fields that store this values for future uses. Therefore we assume that it is okay to use this approach to at least support interface part. Please note that if transform hint is identity then no transformation should be applied. If hint is arbitrary matrix then given matrix should be applier after composition, though for now we'd just force client composition instead. This behavior is required by HAL interface as stated in hardware/interfaces/graphics/composer/2.1/IComposerClient.hal, line 738 from repository https://android.googlesource.com/platform/hardware/interfaces, tag android-10.0.0_r14 Please note that color transform matrix argument is an array that has 16 elements by contract, as it is 4x4 matrix. This is why MATRIX_SIZE has such value. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-12-16drm_hwcomposer: Add simplistic SetLayerColor implementationRoman Kovalivskyi2-2/+5
VTS tests for SET_LAYER_COLOR fails for now since SetLayerColor is unsupported function. Tis commit tries to address this issue. We can't fully implement it for now, therefore simplistic implementation that just saves argument for future uses and satisfies the interface could be used instead, for now. Commit da5839cf9258 ("drm_hwcomposer: Add support for GetColorModes & SetCursorPosition") implements GetColorModes and SetCursorPosition in the same fashion, simply by adding fields that store this values for future uses, therefore we assume that it is okay to use this approach here too. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-12-09drm_hwcomposer: Add refcount for GEM handleVincent Donnefort6-7/+46
The linux kernel doesn't provide reference counting for the handle returned by FD_TO_HANDLE ioctl. It means that if the same Gralloc buffer is imported twice, the first GEM_CLOSE will destroy the handle even if it is still in use by another import. Remedy this issue by doing the reference counting directly in the DRM generic platform support: ImportHandle() will increase the reference, while ReleaseHandle() will decrease and close it, if necessary. Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
2019-12-04drm_hwcomposer: Introduce dumpsys metricsRoman Stratiienko2-5/+95
To make optimal performance/power consumption ratio we want to use composing by dedicated hardware to merge as much as possible composition cases. We are going to continuously optimize and improve drm_hwcomposer HAL, that makes high demand on formal validation process. Introduce "pixel operation" definition. It should be in direct ratio with power consumption, but currently it roughly calculated as sum of pixels merged by each layer. In some future we should apply some average gains depending of operation type to calculate pixops more precisely. (e.g. scaling should take more pixops than blending, and blending should take more that copying, etc.). Using pixops could be very helpful when drm_hwc HAL have a choice which layer sets to merge by GPU, making possible minimal energy model based planning. Create statistics of the following events: 1. Total frames count 2. Total pixel operations 3. Pixel operations validated to use GPU (CLIENT) 4. Calculate composer efficiency: DEVICE/TOTAL operations ratio 5. Failed atomic validation commits count 6. Failed atomic presenting commits count Usage: - $ adb shell dumpsys SurfaceFlinger Statistics will be shown at the end of the dump in 2 forms: 1. Since system launched 2. Since last dumpsys command called Using statistics for the regression slope monitoring example: 1. Boot the board without the change 2. Use touch or keyboard (avoid using of mouse pointer) to do some predefined actions (open application, start video, etc.) 3. Save the metrics 4. Boot the board with the change 5. Do exactly the same actions as in (2) 6. Save the metrics 7. Use metrics before and after change to indicate regression slope Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-12-03drm_hwcomposer: Fix returned fence in PresentDisplayMatteo Franchin4-21/+18
DrmHwcTwo::HwcDisplay::PresentDisplay was always returning -1 as the present fence. This commits ensures the fence fd is correctly retrieved after doing the commit-frame operation. It also updates outdated logic that caused PresentDisplay to return the retire fence rather than the present fence. DrmHwcTwo::HwcDisplay::AddFenceToPresentFence is also changed so that it assumes it is given ownership of the file descriptor it receives as argument. This function was indeed called consistently with this behaviour, which meant the dup led to leakage of file descriptors. With the changes above this patch fixes a failure in the CTS test dEQP-VK.wsi.android.display_timing.fifo.display_timing (for example running Android 10 on HiKey960). The test failed with the error "Unexpectedly received invalid timestamp." reported multiple times in the logcat output. Change-Id: If662e5239895b8b0e2ea31fd99747855f901a427 Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
2019-11-28drm_hwcomposer: Add safe guard for unknown connector typeRoman Kovalivskyi1-3/+8
There is potential possibility that new connector type will be added into DRM and it won't be handled by drm_hwcomposer immediately so it's better to be safe and report error via logcat than crash with out-of-bounds. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-11-28drm_hwcomposer: Fix compilation issues with Android 9Roman Kovalivskyi1-5/+6
It appears that class template argument deduction is unavailable on all target platform compilers, therefore it would be better to come back to explicit template parameters. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-11-27drm_hwcomposer: Fix missing definition build error on P and earlierRoman Stratiienko6-5/+6
DRM_FORMAT_INVALID was introduced after libdrm-2.4.94, and does not exists in Android-P and earlier. Fixes: f63726cabf3f ("drm_hwcomposer: avoid using signed errno on uint32 type") Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-11-21drm_hwcomposer: Add property hwc.drm.primary_display_orderRoman Kovalivskyi1-11/+98
There are cases when primary display lookup order should be overriden. This could be achieved with adding system property hwc.drm.primary_display_order. Example of primary_display_order property usage: hwc.drm.primary_display_order=HDMI-A-2,HDMI-A-1,... This means that first priority goes to HDMI-A-2 connector, then HDMI-A-1 connector, then everything else. Internal connectors have higher priority than any other connectors not mentioned in property. Connected connector with highest priority would be selected as a primary display. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-11-21drm_hwcomposer: Add DrmConnector::name functionRoman Kovalivskyi2-0/+20
Connectors usually are referred by names, but libdrm stores type and id only as a numbers so for more convenience conversion function from integerst to string should be added. Signed-off-by: Roman Kovalivskyi <roman.kovalivskyi@globallogic.com>
2019-11-21drm_hwcomposer: Apply same logic for 'CURSOR' layers as for 'DEVICE'Roman Stratiienko2-1/+8
Cursor usually is most top layer. Since it validates as CLIENT, it causes remain layers to be validated as CLIENT, resulting performance dropping. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-11-21drm_hwcomposer: Fix mixed layer compositionRoman Stratiienko1-39/+20
Fix cases when mixed layer composition require non-device layer in the middle: ''' Layer z_order - SF type - validated type before - validated type fixed 0 - DEVICE - CLIENT - CLIENT 1 - DEVICE - DEVICE - CLIENT 2 - DEVICE - DEVICE - CLIENT 3 - SOLIDCOLOR - CLIENT - CLIENT 4 - DEVICE - DEVICE - DEVICE ''' In such composition SF will merge layers 0 and 3 and hwcomposer will merge <SF>,1,2,4 that results incorrect merging order. Issue was observed on the rcar3 (imagination importer), db845c and allwinner H3 (Generic importer) platforms. Reproduces with compositions that requires 'cursor' or 'dim' layers. How to reproduce: 1. Connect USB mouse when on home screen, you should see mouse cursor under icons (Tested with Launcher3QuickStep desktop) 2. Go to Settings -> WIFI -> Connect to the AP, then you should see password dialog under AP list. Solution: 1. Mark intermediate layers as CLIENT to ensure CLIENT section is in range from bottom layer to most top CLIENT layer. 2. Use this layer composition to validate if DRM can handle it. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-11-11drm_hwcomposer: Add Imagination platform supportRoman Stratiienko3-0/+112
External Android.bp file should be created in order to build this module: ``` cc_library_shared { name: "hwcomposer.drm_imagination", defaults: ["hwcomposer.drm_defaults"], srcs: [":drm_hwcomposer_platformimagination"], whole_static_libs: ["drm_hwcomposer"], shared_libs: ["libion"], include_dirs: [ "path/to/imgtec/include/files", ], } ``` libion is needed to make ion.h header visible `linux/ion.h`. Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-11-06drm_hwcomposer: avoid using signed errno on uint32 typeRoman Stratiienko3-7/+9
DrmGenericImporter::ConvertHalFormatToDrm() should not return negative values. - Use DRM_FORMAT_INVALID instead of -EINVAL - Check DrmGenericImporter::ConvertHalFormatToDrm() result value in DrmGenericImporter::ImportBuffer() Signed-off-by: Roman Stratiienko <roman.stratiienko@globallogic.com>
2019-10-22drm_hwcomposer: HWC2: Handle bad layer_handleVincent Donnefort2-4/+13
HWC2 can issue a command with an incorrect layer handle. Making sure a such error is caught with the expected HWC2 error code BadLayer This can be verified with the VTS test: * GraphicsComposerHidlTest.DestroyLayerBadLayerError Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
2019-10-22drm_hwcomposer: HWC2: Handle bad display_handleVincent Donnefort1-6/+18
HWC2 can issue a command with an incorrect display handle. Making sure a such error is caught with the right HWC2 error code BadDisplay. This can be verified with the VTS tests: * GraphicsComposerHidlTest.DestroyLayerBadDisplay * GraphicsComposerHidlTest.CreateLayerBadDisplay * GraphicsComposerHidlTest.GetActiveConfigBadDisplay Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
2019-10-22drm_hwcomposer: HWC2: Align SetColorMode Error with Android VTSVincent Donnefort1-1/+1
Android VTS tests expect to get BadParameter error for an unknown color mode. Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
2019-10-22drm_hwcomposer: HWC2: Align SetPowerMode Errors with Android VTSVincent Donnefort1-1/+4
Android VTS tests expect to get Unsupported error for Doze and DozeSuspend modes and BadParameter for the rest. Signed-off-by: Vincent Donnefort <vincent.donnefort@arm.com>
2019-10-10drm_hwcomposer: platformmeson: fix AFBC 32x8 feature supportNeil Armstrong1-5/+6
Since MALI_GRALLOC_INTFMT_AFBC_BASIC is mandatory even to enable 32x8 block size, do not OR 32x8 and 16x16 overwise the final modifier will be invalid. Change-Id: Ifa20a29e9c012b8ce0ec598d76e26514a61b52c8 Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-07-11drm_hwcomposer: add LCD panel supportMykhailo Sopiha1-1/+2
This commit adds support for LCD panel as internal connector. Change-Id: Iccb96526ee11bc4a9b53fc8dcd9ba0ea218d41b6 Signed-off-by: Mykhailo Sopiha <mykhailo.sopiha@linaro.org>
2019-07-11drm_hwcomposer: add non hwfb import filterMykhailo Sopiha2-1/+14
This patch adds non hwfb filter to generic drm importer with additional property "hwc.drm.exclude_non_hwfb_imports". By default this is set to false, and no logic changes are happening. On setting this option to 1 the filter is being activated on Init() function. Change-Id: I7a718a66cb6214c051335a4589d60b5833e5c545 Signed-off-by: Mykhailo Sopiha <mykhailo.sopiha@linaro.org>
2019-06-21drm_hwcomposer: pre-filter modes provided to HWC2Neil Armstrong1-17/+59
Currently LocalDisplayAdapter in AOSP filters out similar modes based on their currently limited supported attributes: width/height/refresh. This leads to a situation where important modes are discarded, like the preferred mode and/or the active mode, leading SurfaceFlinger to select an unwanted and potentially invalid mode in the list provided by drm-hwcomposer to HWC2. Let's pre-filter the modes provided to HWC2 by : - systematically adding the preferred mode - systematically adding the current active mode, if different from preferred mode - keeping the interlaced modes filtering-out if no other non-interlace modes with same widthXheight exists (for HD-Ready 1080i TVs or CVBS) - discarding modes if a similar mode with same widthXheight@refresh was already selected for HWC2 This mimics the behavior of LocalDisplayAdapter filtering algorithm, but keeps the important modes from the DRM Point Of View and drops the duplicate modes while keeping the mode ordering from DRM in account. This local filtering should ultimately go out when HWC2 can actually handle mode Attributes to describe Preferred mode, Interlaced, 3D... and LocalDisplayAdapter uses these Attributes for filtering duplicate modes. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Tested-by: John Stultz <john.stultz@linaro.org>
2019-06-11drm_hwcomposer: Organize files into subdirsSean Paul46-24/+32
This is way overdue Signed-off-by: Sean Paul <seanpaul@chromium.org> Change-Id: I1bcbd8fdb0bb03feafd76bc41f6f11c03cdf9c25
2019-06-11drm_hwcomposer: Add platformmeson for Amlogic SoC supportNeil Armstrong3-0/+191
This specific platform handler is dedicated for the Amlogic SoC, and more precisely for the Amlogic G12A family. OpenGL/Mali allocation is done via a slightly modified ARM Gralloc module, thus needing a custom platform handler to handle the custom private_handle_t structure. This platformmeson is based on platformhisi without the AFBC YUV management (not handled by the Amlogic SoCs). Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Change-Id: I1a1d20b0a84b0e17aa3417c8e9633712f258523d
2019-06-11drm_hwcomposer: Drop modes with DRM_MODE_FLAG_INTERLACE to HWC2Neil Armstrong1-8/+25
HWC2 has currently no support for interlaced modes, and will conflict with non-interlaced modes for now. Drop them in DrmHwcTwo::HwcDisplay::GetDisplayConfigs(), correctly handling the two phase calls to GetDisplayConfigs() giving a valid num_configs without the interlaced modes. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2019-06-07drm_hwcomposer: clean Importer inherited classesMykhailo Sopiha6-64/+8
Move some common logic from Importer class implementations into DrmGenericImporter class: - reused generic constructors and destructors for derived classes - formed common Init() logic for all derived classes - removed unused gralloc_ and drm_ variables from derived classes - made drm_ protected for base class to be reused in derived Signed-off-by: Mykhailo Sopiha <mykhailo.sopiha@linaro.org>
2019-06-04drm_hwcomposer: recalculate vrefresh from clock + resolutionNeil Armstrong1-2/+2
For DMT modes and HDMI modes with 1000/1001 variations, the kernel reports the vrefresh in integer, rounded up, thus 59.94Hz or 23.97Hz are reported as 60Hz and 24Hz to userspace. To solve this, recalculate the vrefresh from clock + resolution. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>