Project

General

Profile

Feature #1794

Feature #1539: Graphics acceleration

Feature #1491: Hardware-specific graphics acceleration

Use free hardware composer for smdk4412 devices

Added by Wolfgang Wiedmeyer over 1 year ago. Updated 1 day ago.

Status:
New
Priority:
Normal
Category:
Graphics
Target version:
Start date:
04/24/2017
Due date:
% Done:

0%

Resolution:
Device:

Description

Javi Ferrer developed a free hardware composer for Exynos 4. It is part of NamelessRom:
https://github.com/NamelessRom/android_hardware_samsung/commit/90ce74afc13c8265673bc90bedeb8bc8a17f5497
https://github.com/NamelessRom/android_hardware_samsung/commit/999f31969533a8042726489e957b3dc3c927851a
https://github.com/NamelessRom/android_hardware_samsung/commit/a133ba7dd102fa3d2db3141f35fedd13b88afd14
Other Gralloc-related commits might be needed as well.

The implementation depends on a change in the smdk4412 kernel:
https://github.com/NamelessRom/android_kernel_samsung_smdk4412/commit/f1c6163ac1896e5d92b77a45d882d0564f060206

Furthermore, the NamelessRom smdk4412 kernel was rebased on the Note 2 kernel sources. This rebase was not done for the LineageOS kernel and thus is not included in the Replicant kernel. It needs to be investigated if the required changes can be backported, at least for the Samsung video drivers in drivers/video/samsung.

The free hardware composer is also not yet part of LineageOS. Development on their part can be tracked on their Gerrit, e.g.:
https://review.lineageos.org/#/c/167147/

Replicant 6.0 currently does not make use of FIMG, Replicant 4.2 has some code in skia:
https://github.com/CyanogenMod/android_external_skia/commit/647876b665f2cf011e75adc6ff2238d467c47635

A newer skia commit to make use of FIMG2D:
https://review.lineageos.org/#/c/61162/

Integrating these hardware composer changes could make it possible to use the integrated 2D graphics unit (FIMG2D) for compositing which could improve graphics speed significantly on Replicant. It should work at least on the Galaxy S 3 and Note 2, but it should be possible to make it work for the Galaxy S 2 and Note, too.

History

#1 Updated by Joonas Kylmälä 5 days ago

  • Assignee set to Joonas Kylmälä

I'm researching whether drm_hwcomposer works on smdk4412 devices. Now I'm stuck for a while because there is no generic gralloc module that could be used with software renderers.

#2 Updated by Joonas Kylmälä 5 days ago

I'm trying to make now the default gralloc (https://android.googlesource.com/platform/hardware/libhardware/+/master/modules/gralloc/) conform to the gralloc_handle_t struct defined here: https://cgit.freedesktop.org/mesa/drm/tree/android/gralloc_handle.h. The gralloc_handle_t struct is expected by the drm_hwcomposer module's generic buffer importer code.

If that doesn't work out I could still try modifying the gbm_gralloc or minigbm modules.

#3 Updated by Joonas Kylmälä 1 day ago

So I got the drm_hwcomposer to be friends with the default gralloc but the DRM subsystem doesn't like ashmem allocated buffer handles so it didn't work out :/ I'm not quite sure about this but it feels like to me that the DRM subsystem expects a buffer handle that is actually pointing to some memory location in a DRM device like gpu0 or fb0 because when I tried to make a "dumb buffer" to the ashmem file descriptor with "drmIoctl(fd, DRM_IOCTL_MODE_CREATE_DUMB, &creq);" it said that it was not a permitted operation, i.e. there is no DRM_IOCTL_MODE_CREATE_DUMB on the "ashmem device".

Also available in: Atom PDF