mbox series

[RFC,0/5] drm_hwcomposer: Changes to support HiKey/HiKey960

Message ID 1515564345-1339-1-git-send-email-john.stultz@linaro.org
Headers show
Series drm_hwcomposer: Changes to support HiKey/HiKey960 | expand

Message

John Stultz Jan. 10, 2018, 6:05 a.m. UTC
This patchset is an inital RFC I wanted to send out to get some
early review and feedback.

I've been working to enable the drm_hwcomposer for HiKey and
HiKey960 boards in AOSP, and this patchset contains the required
changes to the drm_hwcomposer code to get things working.

I'm really quite naive when it comes to graphics, and I'm sure I
don't fully understand the drm_hwcomposer code, so forgive me if
I've done anything terribly stupid here.

There are a few terrible hacks involved, which I'd really love
to get any guidance on how things should be properly done here.

The first is I'm using Rob's patch to force use of single plane,
without which I don't get anything on the screen.

The second is that after getting the drm_hwcomposer running, I
was seeing tons of tearing, which was exactly the behavior I'm
making this effort to avoid. So I have another hack patch that
removes some checks that fail which keep us from doing fence
handling properly. Again, any tips for what deeper issues need
to be addressed would be helpful!

Finally, the third hack isn't in this patchset, but in the
kernel, where with the drm_hwcomposer, on initialization, we
would hit the case where it was trying to enable vsync while the
crtc is off.  So I worked around that here:
https://git.linaro.org/people/john.stultz/android-dev.git/commit/?h=dev/hikey-hwcomposer-deps&id=30aa3e944e5c87fd4f61333a123d365e99825e3a

For that last issue, I'm not sure if this is due to some quirk
w/ the drm_hwcomposer initialization, or some other quirk of the
kirin drm driver,  but in development of this, I've also worked
with an older drm based hwc implementations which didn't trigger
this issue.

Anyway, outside of those hacks I'm sure there can be further
improvement as well, so I wanted to get it out for some initial
review.

If anyone wants to try the code out on either a HiKey or
HiKey960, you will need this patchset on top of the
freedesktop/master branch of drm_hwcomposer. You'll also need
the freedesktop/master branch of libdrm. You'll need the
following patches to the device/linaro/hikey project: 
https://github.com/johnstultz-work/android_device_linaro_hikey/commits/drm_hwc

And you'll need to replace the kernel Image-dtb with one built
from the following tree:
https://git.linaro.org/people/john.stultz/android-dev.git/log/?h=dev/hikey-hwcomposer-deps

Any thoughts or feedback will be very much appreciated!

Many thanks to Rob Herring and Matt Szczesiak for help to get
this working so far!

Thanks so much for your time!
-john

Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>

John Stultz (3):
  drm_hwcomposer: glworker: Add build time options for certain shader
    feature names
  drm_hwcomposer: Add platformhisi buffer importer for hikey and
    hikey960
  drm_hwcomposer: HACK: Fix tearing on hikey/hikey960

Rob Herring (2):
  drm_hwcomposer: provide a common gralloc handle definition
  drm_hwcomposer: HACK: force single plane

 Android.mk               |  13 ++-
 drmdisplaycompositor.cpp |   9 ++-
 drmhwctwo.cpp            |   4 +-
 glworker.cpp             |  15 +++-
 gralloc_drm_handle.h     |  87 +++++++++++++++++++++
 platformhisi.cpp         | 200 +++++++++++++++++++++++++++++++++++++++++++++++
 platformhisi.h           |  50 ++++++++++++
 7 files changed, 368 insertions(+), 10 deletions(-)
 create mode 100644 gralloc_drm_handle.h
 create mode 100644 platformhisi.cpp
 create mode 100644 platformhisi.h

-- 
2.7.4