All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Intel GFX <intel-gfx@lists.freedesktop.org>,
	Ben Widawsky <ben@bwidawsk.net>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 1/3] drm: Add new DRM_IOCTL_MODE_GETPLANE2
Date: Thu, 12 Jan 2017 20:11:28 +0200	[thread overview]
Message-ID: <20170112181128.GB31595@intel.com> (raw)
In-Reply-To: <CAPj87rN5Dre4S5giyEQWak9YC-oU=RkyFGTnGA10ubPjoX55Dw@mail.gmail.com>

On Thu, Jan 12, 2017 at 05:50:15PM +0000, Daniel Stone wrote:
> Hi,
> 
> On 12 January 2017 at 17:45, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Thu, Jan 12, 2017 at 05:04:46PM +0000, Daniel Stone wrote:
> >> Implicit is clever but horrible. AFAICT, the only way to do it
> >> properly would be to have a nested forwards loop walk when you first
> >> hit a modifier, searching for further occurrences of that modifier to
> >> collect the complete set of formats that modifier applies to.
> >
> > Not sure for what that is the "only way". In fact I can't right now
> > think of any operation that would require an extra loop necessarily.
> > For some things you might just want to look for a specific
> > format+modifier combo, for that it doesn't matter how many blocks there
> > are.
> 
> Right, that just needs a local variable to act as a counter.
> 
> > And if you want to transform the reply into some less convoluted
> > form, well then you'd just need some modifier+dynamic format list thing,
> > or if you want to keep to bitmasks you'd either need a bitmask that can
> > grow when running out of bits or just make it big enough to handle a
> > sufficiently large worst case number of bits.
> >
> > Dunno, maybe I just lack imagination. Then again, I'm not even sure if
> > we're talking about userspace of kernel code here, which might explain
> > my general confusion :)
> 
> I'm talking about userspace, where I want to have:
> struct drm_plane {
>     struct {
>         uint32_t format;
>         uint64_t modifiers[];
>     } formats[];
> }

Flipping formats[] vs. modifiers[] here would seem like it should make
this easier with the proposed kernel API. And if the kernel will also
uarantee that multiple instances of the same modifier must be returned
contiguously, then it should be even easier.

Oh and flipping formats[] and modifiers[] should also save a quite a
bit of space since each format takes twice as much space as each
modifier. But I suppose that might come at a runtime cost if you have
to look for a specific format in each modifier's format list instead
of having to look at just the modifier list of a specific format. So
I suppose not flipping might be better after all, which I guess would
complicate populating the infromation somewhat.

Anyways, that's all a bit unrelated to the matter at hand, so I'll stop
now and just state that I don't mind having an explicit offset if
people really want it.

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-01-12 18:11 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12  0:51 [PATCH 0/3] GET_PLANE2 w/ i915 implementation Ben Widawsky
2017-01-12  0:51 ` [PATCH 1/3] drm: Add new DRM_IOCTL_MODE_GETPLANE2 Ben Widawsky
2017-01-12  1:43   ` [Intel-gfx] " Rob Clark
2017-01-12  9:38     ` Ville Syrjälä
2017-01-12 14:56       ` Rob Clark
2017-01-12 17:04         ` Daniel Stone
2017-01-12 17:45           ` Ville Syrjälä
2017-01-12 17:50             ` Daniel Stone
2017-01-12 18:11               ` Ville Syrjälä [this message]
2017-01-12 19:27                 ` Daniel Stone
2017-01-13  9:37                   ` [Intel-gfx] " Ville Syrjälä
2017-01-13  9:45                     ` Daniel Stone
2017-01-12 10:23   ` [Intel-gfx] " Ville Syrjälä
2023-11-24 15:08     ` Andy Shevchenko
2017-01-25  5:20   ` [PATCH 1/3] [v2] " Ben Widawsky
2017-01-25 15:28     ` Ville Syrjälä
2017-01-26 23:34     ` [PATCH 1/3] [v3] " Ben Widawsky
2017-01-12  0:51 ` [PATCH 2/3] drm/i915: Add format modifiers for Intel Ben Widawsky
2017-01-12 10:51   ` Ville Syrjälä
2017-01-12 18:00     ` Ben Widawsky
2017-01-12 18:32       ` Ville Syrjälä
2017-01-12 18:56         ` Ben Widawsky
2017-01-13  9:35           ` Ville Syrjälä
2017-01-12  0:51 ` [PATCH 3/3] drm/i915: Add support for GET_PLANE2 CCS modifiers Ben Widawsky
2017-01-12  1:01 ` ✗ Fi.CI.BAT: failure for GET_PLANE2 w/ i915 implementation Patchwork
2017-01-12  1:23   ` Ben Widawsky
2017-01-25  6:32 ` ✗ Fi.CI.BAT: failure for GET_PLANE2 w/ i915 implementation (rev2) Patchwork
2017-01-27  1:02 ` ✗ Fi.CI.BAT: failure for GET_PLANE2 w/ i915 implementation (rev3) Patchwork

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=20170112181128.GB31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=ben@bwidawsk.net \
    --cc=daniel@fooishbar.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.