All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Pekka Paalanen <ppaalanen@gmail.com>
Cc: Simon Ser <contact@emersion.fr>,
	Keith Packard <keithp@keithp.com>, nd <nd@arm.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>
Subject: Re: Expose more EDID fields to userspace
Date: Wed, 16 Jan 2019 21:11:12 +0200	[thread overview]
Message-ID: <20190116191112.GU20097@intel.com> (raw)
In-Reply-To: <20190116203526.42f66108@ferris.localdomain>

On Wed, Jan 16, 2019 at 08:35:26PM +0200, Pekka Paalanen wrote:
> On Mon, 7 Jan 2019 17:07:09 +0000
> Brian Starkey <Brian.Starkey@arm.com> wrote:
> 
> > On Mon, Jan 07, 2019 at 07:57:54AM -0800, Keith Packard wrote:
> > > Daniel Vetter <daniel@ffwll.ch> writes:
> > >   
> > > > Best to pull in some other compositor people and get them to agree. From a
> > > > kernel pov I'm fine with whatever userspace preferes.  
> > > 
> > > Hrm. It would be good to have everyone using the same interpretation of
> > > EDID data; in particular, where the kernel has quirks that change the
> > > interpretation, user space should be consistent with that.
> > > 
> > > Unless we expose all of the EDID data, then user space may still have to
> > > parse EDID. If the kernel has EDID quirks, it might be good to to make
> > > those affect the "raw" EDID data visible to use space so that values the
> > > kernel supplies separately are consistent with values extracted from the
> > > "raw" EDID data.  
> > 
> > If the quirks can be re-encoded back into an EDID representation, then
> > this sounds like a fairly good approach to me.
> > 
> > > 
> > > Doing this in the kernel does make it harder to quickly supply fixes for
> > > a specific user space application. This will probably lead to
> > > kludge-arounds in user space that could depend on kernel
> > > version. Perhaps these EDID capabilities in the kernel should be
> > > versioned separately?
> > > 
> > > I see good benefits from having user space able to see how the kernel is
> > > interpreting EDID so that it can adapt as appropriate, but we should be
> > > cautious about moving functionality into the kernel that would be more
> > > easily maintained up in user space.
> > >   
> > 
> > I agree. It seems likely that whatever happens (some) userspace is
> > still going to implement (some) EDID parsing functionality, so it's
> > hard to reason about what belongs where. Shared code in userspace
> > (libdrm?) may well be better than exposing it from the kernel.
> > 
> > If it is exposed by the kernel, then it's still non-obvious to me
> > how the kernel exposes that information/interpretation. Adding
> > a property for every potentially-useful field really doesn't scale
> > well, and what fields are useful isn't obvious - e.g. serial string vs
> > serial no., as mentioned by Simon.
> > 
> > Uma's recent series: "Add HDR Metadata Parsing and handling in DRM
> > layer"[1] is a good example of more stuff which userspace would want to
> > parse out of the EDID (supported display colorimetry and transfer
> > functions).
> > 
> > It would be nice to avoid duplicating all the CEA extension parsing
> > code, but the EDID/CEA data structure is extensible by design. So the
> > kernel API would need to be similarly extensible, or we'll just
> > balloon loads of properties... and then the kernel API would likely
> > just end up just looking similar to the CEA block anyway.
> > 
> > Cheers,
> > -Brian
> > 
> > [1] https://lists.freedesktop.org/archives/dri-devel/2018-December/200154.html
> 
> I would agree with an effort to establish a userspace EDID parsing
> library in any case. As mentioned above, there will probably be too
> much to expose via kernel UABI, or it will become just another
> encoded format that again should have a shared parser library in
> userspace.
> 
> Would it be possible to architect the library so that it would be
> shared with the kernel? Maybe the quirks database could be shared
> with the kernel as well? That way both kernel and userspace would
> more or less agree on the parsing details.

IIRC long ago I did manage to build drm_edid.c in userspace.
My idea was to potentially fuzz it without oopsing the kernel.
But I didn't get beyond just making it build before getting
distracted by something shinier.

Taking that further would involve pulling the edid parser into
a userspace helper entirely. Unfortunately that would open up
the big can of "how do we parse the edid during boot?" worms.
But I do kinda like the idea of not having the kernel parse
untrusted input directly.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-01-16 19:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-23  9:16 Expose more EDID fields to userspace Simon Ser
2018-12-24 10:23 ` Daniel Vetter
2018-12-31 12:57   ` Simon Ser
2019-01-07 10:02     ` Daniel Vetter
2019-01-07 15:57       ` Keith Packard
2019-01-07 17:07         ` Brian Starkey
2019-01-16 18:35           ` Pekka Paalanen
2019-01-16 19:11             ` Ville Syrjälä [this message]
2019-01-16 19:40             ` Adam Jackson
2019-01-16 20:32               ` Keith Packard
2019-01-17  9:28                 ` Daniel Vetter
2019-01-17 19:45                   ` Keith Packard
2019-01-17 19:59             ` Alex Deucher
2019-01-17 20:33               ` Daniel Vetter
2019-01-17 21:23           ` Stéphane Marchesin
2019-01-17 21:36             ` Keith Packard

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=20190116191112.GU20097@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=nd@arm.com \
    --cc=ppaalanen@gmail.com \
    /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.