Upstreaming DAL

Jerome Glisse j.glisse at gmail.com
Thu Mar 24 15:23:19 UTC 2016


On Wed, Mar 23, 2016 at 01:27:21PM -0400, Alex Deucher wrote:
> Our goal is to transition to our new DAL display stack.  It is the
> path we are validating internally for both the open and hybrid stacks
> and will be the only display stack we support going forward with new
> asics.  When we initially released the patches, there were some rough
> edges and quite a few things were pointed out that need to be fixed.
> Some are relatively easy to fix, others will take time.  Our goal is
> to make those changes.  We'd like to target 4.7 for upstreaming DAL.
> To that end, I think it would be easier to review and track our
> progress if I maintained a public DAL branch and send out patches
> against that branch rather than respinning giant squashed patches
> every time we fix something.  It's much harder to track what progress
> has been made.  DAL is currently at ~400 patches.  We previously tried
> to squash that down into a bunch of larger commits, but I'm not sure
> that is particularly easy to review.  I'm also not sure it's worth
> spamming the list with 400 patches.  I've posted our current DAL tree
> here for review:
> https://cgit.freedesktop.org/~agd5f/linux/log/?h=drm-next-4.7-wip-dal
> I can certainly send out the patches if that is preferred.  We will be
> sending out all new patches to the list as the further clean up tasks
> and new features are implemented.
> 
> Our goal is to fix the following items in time for 4.7.  Additional
> fixes and re-factoring will continue as we work to address all of the
> comments and concerns.

So the dal code is kind of revulsing, for two reasons. The first one as
to do with the overall state of the code. It is full of dead code, unuse
struct, unuse enum, unuse union, ... I pushed a branch on fdo which just
barely scratch the surface at removing dead stuff (see dal branch at
https://cgit.freedesktop.org/~glisse/linux/log/?h=dal). It is also poorly
commented, not even per file top comments giving information about what
each file is about, like a brief overlook.

If i focus on the patchset and not on the final result then things are
even worse. First a mega patch that adds all bunch of files instead of
splitting things up in digestible chunk. Second you have several files
that are added, then remove in latter patch, and some are added again
latter with other name. Well this can be fix too, by redoing the patchset.


But the second reason is far more troubling and so fundamental that DAL
should just never be consider for merging, not even in STAGING. It is
about the whole design of it. DAL is like a full replacement of DRM
modesetting code all wrap into several layers of abstraction. Seriously
DAL is abstraction on top of abstraction on top of abstraction (grep for
->base.base.base). It is just wrong. Like Dave said, it is so obviously
wrong that you have to poke hole into your abstraction layer for hardware
specific code. So you have hw specific code that call abstraction layer
that endup just calling the function above the one you were looking at.
The whole layer on top of layer become a maze in which you get lost.

This is not how you do thing. If the DRM abstraction are not good enough
then fix them working with others. Hardware is not fundamentaly different,
it is not like their are specific brand of display for specific brand of
GPU. This is a whole industry that rely on standardization. The DRM core
modesetting have grown over the years to adapt not only to new userspace
requirement (atomic) but also to new display technology like DP and MST.

So if you feel core DRM modesetting abstractions does not allow for a
specific feature then propose change there, in the core DRM modesetting
abstraction. Also DAL seems to implement quite a few things that should
be move as drm helpers function (whole infoframes stuff feels that way).
This is a linux device driver, we share things and improve on each others.

New modesetting code for amdgpu should not be about shoehorn an existing
design behind an abstraction layer to interface with core modesetting. It
should be about implementing core modesetting API (atomic being the flavor
of the day). All this with only small abstraction inside device driver to
leverage architectural similarities accross different GPU generation. But
it should not be a monster of several thousand lines of code with dozens
and dozens of functions callback struct.

I do not see why existing modesetting design (modulo the fact that we need
to implement atomic modesetting) does not allow you to implement any of the
features you listed (freesync, sync timing accross different display, power
features, 6 displays, ...). None of the abstraction are needed to implement
any of this. If i am mistaken, take one thing and explain in details why !
What would be the roadblocks with the existing code.


To sum up DAL is not only in an unreviewable state (code mess, patch mess)
but it is fundamently wrong. I would not feel confortable having to fix
thing inside it and i would forever be fearful of breaking things due to
abstraction card castle effect (also known as jenga principle).

Regards,
Jérôme


More information about the dri-devel mailing list