[Freedreno] [GSoC-15] Enabling Freedreno on Android

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 16 11:29:58 PDT 2015


On 16/03/15 16:11, Rob Clark wrote:
> On Mon, Mar 16, 2015 at 11:27 AM, Varad Gautam <varadgautam at gmail.com> wrote:
>> Hi Rob,
>>
>> I'm gradually coming up to speed with the current state of things, and
>> have some more questions about adding Freedreno support to Android.
>>
>> Since the qcom DRI patches are in, I will look for a suitable LCD to add
>> support for. As I understand, I would need to extend drm_gralloc [1] to
>> provide freedreno, similar to nouveau and radeon. I can use the
>> kernel-msm [2] tree with x86's mesa and drm to build android. Is ifc6410
>> the intended target?
> 
> +Emil who has done some work on android build system for libdrm/mesa/etc..
> note that we were talking on #dri-devel of the idea of pulling
> drm_gralloc into mesa git tree, which might be the better long term
> plan (assuming it can be made to work w/ the build system..  Emil
> knows the issues there better than I do)
> 
Rob already wrote the freedreno code for drm_gralloc, and it's part of
the android-x86 tree - see commit c46b2ee2cac [1]

Despite how well/fast we get with integrating drm_gralloc within mesa I
would recommend working with the android-x86's drm_gralloc as a base.

> If you have access to an ifc6410 board, that would probably be a
> pretty good way to start.. on that device, the primary display is HDMI
> (which is already well supported in drm/msm), and we can use something
> very close to a mainline kernel[1].
> 
> Obviously in the long run, it would be nice to get this working on
> some phones/tablets.. which would require backporting the upstream drm
> + DSI code, and writing panel drivers for the specific LCD panel in
> whichever phone/tablet.. but starting on ifc6410 could allow for some
> of that to happen in parallel, depending on exactly how much work is
> needed to get drm_gralloc working.
> 
> 
>> I am confused by the presence of freedreno in kitkat-x86 [3] - can it
>> build with freedreno already? I am digging into Android's build system,
>> kernel and graphics stack and will come up with a set of TODOs soon.
> 
> so drm.git is libdrm.. so I think they just inherit the freedreno
> directory from upstream libdrm[2]
> 
Rob is correct here - android drm.git = calls upstream libdrm.
Android-x86 has a couple of unrelated patches on top of upstream, but
I'm planning to address/upstream them soon.

> 
> I guess if android-x86 is already working with kitkat, that is a good
> sign..  although if simply getting freedreno working on android
> somehow works out to be too easy, there are various related tasks that
> could be interesting to consider as well:
> 
People have been using kitkat-x86 on the vmware, nouveau, radeon r600
i915, i965 drivers. The experience (amount of bugs) varies but things
normally just work.

>   1) hwcompositor support to use drm/kms planes to composite layers
> using the display controller instead of gpu..  there has been work
> happening on the kernel side (the new atomic[3] support).  The msm
> drm/kms driver already supports atomic, so this seems like a pretty
> logical next-step once the basics work
The current intel/hwcomposer [2] implements API 1.0 (not sure if it's
complete or not) and uses drm_gralloc + eglSwapBuffers. Afaict the code
is generic and should apply for others - freedreno, nouveau...

I would strongly suggest that as a preparation (although I'll let Rob be
the judge)
 - checkout android-x86/kitkat-x86
 - rebase their mesa kitkat-x86 branch on top of upstream 10.4 [3], and
add it to the build.
 - get the kernel Rob mentioned, and integrate it into the build (manifest)
 - grep through the code for "nouveaufb" and "inteldrmfb". Check the
"offending" commits and prep similar patch(es) for freedreno. It should
be trivial 5 line patch. Iirc there are initscripts (+ other?) which do
funny things depending on the framebuffer. Don't forget to update your
manifest :)
 - set BOARD_GPU_DRIVERS=freedreno and leave it build a complete image.
Note it will take quite some time.
 - If it builds try booting it up :)

With the above information at hand I believe you'll be OK with setting
up a plan/proposal. How much you'll focus on the kernel,
gralloc/hwcomposer or mesa depends on what you'll uncover :-)

Last but not least setting up an Android build is going to be a pain. If
you're unsure of anything or you might be getting stuck just ask.
There are too many things for me to go through in a single email :P

Cheers,
Emil

[1]
http://git.android-x86.org/?p=platform/hardware/drm_gralloc.git;a=commit;h=c46b2ee2cace20f67b0c5e1121e1973a7678fd60

[2]
http://git.android-x86.org/?p=platform/hardware/intel/hwcomposer.git;a=shortlog;h=refs/heads/kitkat-x86

[3] http://cgit.freedesktop.org/mesa/mesa/log/?h=10.4


More information about the Freedreno mailing list