Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [PATCH 1/3] drm: Plumb modifiers through plane init
Date: Wed, 10 May 2017 12:33:15 -0700	[thread overview]
Message-ID: <20170510193314.GA2585@mail.bwidawsk.net> (raw)
In-Reply-To: <20170510172452.GC7759@e110455-lin.cambridge.arm.com>

On 17-05-10 18:24:52, Liviu Dudau wrote:
>On Wed, May 10, 2017 at 09:34:40AM -0700, Ben Widawsky wrote:
>> On 17-05-03 18:30:07, Liviu Dudau wrote:
>> > On Wed, May 03, 2017 at 06:45:05PM +0200, Daniel Vetter wrote:
>> > > On Wed, May 03, 2017 at 03:52:23PM +0100, Liviu Dudau wrote:
>> > > > On Wed, May 03, 2017 at 03:14:56PM +0100, Daniel Stone wrote:
>> > > > > On 3 May 2017 at 15:07, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
>> > > > > > On Wed, May 03, 2017 at 02:45:26PM +0100, Daniel Stone wrote:
>> > > > > >> It does deserve a much better commit message than what it has, but as
>> > > > > >> he is on holiday for the rest of the week, I can answer. Currently, we
>> > > > > >> advertise which formats each plane is capable of displaying. In order
>> > > > > >> for userspace to be able to allocate tiled/compressed buffers for
>> > > > > >> scanout, we want userspace to be able to discover which modifiers each
>> > > > > >> plane supports as well.
>> > > > > >
>> > > > > > I get the overall goal. We need/want something similar for Mali DP and AFBC buffers.
>> > > > > > What I don't understand is the current aproach (but I've found from Brian that somehow
>> > > > > > I've missed the long discussion(s) around the subject). I was hoping to learn
>> > > > > > from the commit message why he thinks the introduction of this code is the right
>> > > > > > way of doing it. And the IRC logs seem to imply that he is mostly doing something
>> > > > > > that others have agreed upon and he doesn't really care about the approach as long
>> > > > > > as it ticks the "supported by intel driver" box.
>> > > > >
>> > > > > Or, with another interpretation, he thinks the various approaches of
>> > > > > doing it are all equally good. He took guidance from a couple of
>> > > > > userspace developers (Weston, ChromeOS), a Freedreno developer and
>> > > > > also I believe an AFBC developer, to end up where he is now, which he
>> > > > > still thinks is fine. In doing so, he's been through several
>> > > > > iterations, always modifying the driver to suit. I think that's a
>> > > > > pretty good way to do development of new uABI, if you ask me. (And
>> > > > > again, I have trouble reading your last sentence as anything other
>> > > > > than hostile.)
>> > > >
>> > > > I am getting the message. You think I am too strong here, so I'm going to back off.
>> > > > Also look forward to see the next version where he takes into account the technical
>> > > > comments that I have sent.
>> > >
>> > > Just to make it really clear: Google has an implementation for AFBC using
>> > > exactly this scheme for cros. The only reasons it's not floating around
>> > > here in upstream is that one of the critical pieces is missing (*hint*,
>> > > *hint* you really want an open mail driver ...).
>> >
>> > <tongue_in_cheek>
>> > Don't know about open _mail_ drivers but there are plenty of open mail apps that one can use
>> > </tongue_in_cheek>
>> >
>> > Joke aside, the Mali GPU *kernel* driver *is* open source. Just not in the mainline and
>> > not enough for what you want. But I'm not the right person to fix all that.
>> >
>> > And GPU is not the only IP capable of producing AFBC data, so there might be another driver
>> > in the making that will be open source.
>> >
>> > Best regards,
>> > Liviu
>> >
>> > > But besides that, it works
>> > > perfectly fine for arm render compression format too.
>> > > -Daniel
>> > > --
>> > > Daniel Vetter
>> > > Software Engineer, Intel Corporation
>> > > http://blog.ffwll.ch
>> >
>> > --
>>
>> So are we good with patch 1, sorry if I missed any real valid changes I need to
>> make, but can we please capture that here.
>
>Sure,
>

Thanks. Reordered your comments a bit...

>- documentation needs to use the actual macro name: DRM_FORMAT_MOD_INVALID

Okay. It originally wasn't this way because it forces the sentence to be two
lines, but I've changed it.

>- some extraneous empty lines could be trimmed

I think I got them all..

>- drm_universal_plane_init comment about first driver with > 64 formats could do
>  with some verbose explanation on why ("because we encode each format as a bit
>  in the format_modifiers field and we have only reserved 64 bits for that")


>- most (all?) drivers are passing NULL as the format_modifier pointer to
>  drm_universal_plane_init() which makes me wonder if it is not better to have a
>  different function for drivers that want to pass a non-NULL format_modifier.

I can wrap this, that might be the best way and then I wouldn't need to touch
the other drivers. Here is the relevant part of the diff:

I'm fine with that if other people are. It only is the way it is because
Kristian originally did this for GET_PLANE2.

+__printf(9, 10)
+int drm_universal_plane_init_with_modifiers(struct drm_device *dev,
+                                           struct drm_plane *plane,
+                                           uint32_t possible_crtcs,
+                                           const struct drm_plane_funcs *funcs,
+                                           const uint32_t *formats,
+                                           unsigned int format_count,
+                                           const uint64_t *format_modifiers,
+                                           enum drm_plane_type type,
+                                           const char *name, ...);
 __printf(8, 9)
-int drm_universal_plane_init(struct drm_device *dev,
-                            struct drm_plane *plane,
-                            uint32_t possible_crtcs,
-                            const struct drm_plane_funcs *funcs,
-                            const uint32_t *formats,
-                            unsigned int format_count,
-                            enum drm_plane_type type,
-                            const char *name, ...);
+static inline int
+drm_universal_plane_init(struct drm_device *dev,
+                        struct drm_plane *plane,
+                        uint32_t possible_crtcs,
+                        const struct drm_plane_funcs *funcs,
+                        const uint32_t *formats,
+                        unsigned int format_count,
+                        enum drm_plane_type type,
+                        const char *name, ...)
+{
+       va_list ap;
+       int ret;
+
+       va_start(ap, name);
+       ret =  drm_universal_plane_init_with_modifiers(dev, plane,
+                                                      possible_crtcs, funcs,
+                                                      formats, format_count,
+                                                      NULL, type, name, ap);
+       va_end(ap);
+       return ret;
+}
+


>- plane->modifier_count is never used
>- memcpy()-ing the format_modifiers in drm_universal_plane_init doesn't check for
>  NULL even if that is what most drivers pass on when they call the function.
>- format_mod_supported function is not used in 1/3 patch, you can introduce it
>  in the patch that actually uses it
>- drm_plane's formats field doesn't look used either.
>

Regarding the unused fields, they are used in later patches by the
implementation. I specifically split out this so that we can deal with all the
DRM hardware specific driver changes in one [supposed to be] trivial patch.
Generally I agree that introducing fields without using them is not very useful
to reviewers, but I consider this a special case.

I see two primary reasons for this:
1. It made rebase easier (remember, this series is > 6 months old), and as new
   DRM drivers were added, it made a nice simple patch to change.
2. Easy to spot kbuild failures/resolutions.
3. Review should be trivial for all the other hardware people. If they don't
   care about modifiers, they can pretty much ignore the patch entire.

>You can look in the first reply to your 1/3 patch if you want the details.
>
>Best regards,
>Liviu
>
>>
>> --
>> Ben Widawsky, Intel Open Source Technology Center
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
>-- 
>====================
>| I would like to |
>| fix the world,  |
>| but they're not |
>| giving me the   |
> \ source code!  /
>  ---------------
>    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-10 19:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03  5:14 [PATCH 1/3] drm: Plumb modifiers through plane init Ben Widawsky
2017-05-03  5:14 ` [PATCH 2/3] drm: Create a format/modifier blob Ben Widawsky
2017-05-03 11:00   ` Brian Starkey
2017-05-03 11:47     ` Daniel Stone
2017-05-03 12:39       ` Brian Starkey
2017-05-03 12:51   ` Brian Starkey
2017-05-03 13:51     ` [Intel-gfx] " Daniel Stone
2017-05-03 14:03       ` Brian Starkey
2017-05-03 14:07         ` [Intel-gfx] " Daniel Stone
2017-05-03 14:17           ` Brian Starkey
2017-05-03 13:15   ` Liviu Dudau
2017-05-11 17:58     ` Ben Widawsky
2017-05-03 13:32   ` Emil Velikov
2017-05-03 15:08   ` Daniel Vetter
2017-05-16 21:19     ` [Intel-gfx] " Ben Widawsky
2017-05-17 11:31       ` Daniel Vetter
2017-05-17 15:12         ` Daniel Vetter
2017-05-18  0:00         ` Ben Widawsky
2017-05-18  0:38           ` Rob Clark
2017-05-18  0:42             ` [Intel-gfx] " Rob Clark
2017-05-04  9:28   ` Daniel Stone
2017-05-03  5:14 ` [PATCH 3/3] drm/i915: Add format modifiers for Intel Ben Widawsky
2017-05-03  5:30 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm: Plumb modifiers through plane init Patchwork
2017-05-03 10:34 ` [PATCH 1/3] " Liviu Dudau
2017-05-03 13:45   ` [Intel-gfx] " Daniel Stone
2017-05-03 14:07     ` Liviu Dudau
2017-05-03 14:14       ` Daniel Stone
2017-05-03 14:52         ` Liviu Dudau
2017-05-03 16:45           ` Daniel Vetter
2017-05-03 17:30             ` [Intel-gfx] " Liviu Dudau
2017-05-10 16:34               ` Ben Widawsky
2017-05-10 17:24                 ` Liviu Dudau
2017-05-10 19:33                   ` Ben Widawsky [this message]
2017-05-10 20:21                     ` [Intel-gfx] " Liviu Dudau
2017-05-10 16:33     ` Ben Widawsky
2017-05-03 18:28 ` kbuild test robot
2017-05-03 18:48 ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170510193314.GA2585@mail.bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=Liviu.Dudau@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox