All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "\"Keith Packard\"" <keithp@keithp.com>
Cc: xorg-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: Proposal for RandR version 1.6, Leases and EDID-based output grabs
Date: Sun, 2 Apr 2017 17:43:02 +0200	[thread overview]
Message-ID: <20170402154302.zd7nmqf7vtcvgssu@phenom.ffwll.local> (raw)
In-Reply-To: <86fuhrka4t.fsf@hiro.keithp.com>

On Sat, Apr 01, 2017 at 03:58:58PM -0700, "Keith Packard" wrote:
> 
> As a part of the DRM leasing work, we need a way to have the X server
> create a lease and pass it back to an X client. Here's a proposal for
> the RandR specification changes necessary for that. The basic plan is
> pretty simple:
> 
>  1. Expose the ability to create a lease for a set of CRTCs and
>     OUTPUTs. The X server will have to pick a suitable encoder as that's
>     not visible via RandR.

On that, I think we could just unconditionally hand leases all encoders.
Encoders turned out to be a bit an uapi mistake. Neither setcrtc nor
atomic use it, the kernel always selects the right encoder for you. It's
only exposed to give userspace some hints wrt routing (and it's pretty bad
at describing modern restrictions, which often means you get a 1:1
encoder/connector mapping). Unconditionally exposing all encoders for all
lessees would fix all these troubles.

Note that there's also no properties on encoders, those only exist on
crtc, connector and planes.

Kinda more a comment on the kernel side than for xrandr.
-Daniel

>  2. Provide a way to hide some monitors from other clients using EDID
>     manufacturer ids and product codes. Outputs with EDID properties
>     matching the grab will report 'disconnected' to all clients other
>     than the grabbing client. This way, the desktop environment never
>     knows that an HMD has been plugged in, so there's no transient
>     flicker of desktop being presented to it.
> 
> I wanted to make it possible for the X server to set the mode on the
> leased outputs, but I'm not sure how -- I don't want to display the X
> screen on them, and there's no other frame buffer I can name over the
> wire. For now, that means the leasing client will need to set a mode
> itself. If that fails, it can go whack the X configuration over RandR
> and try again, which is all the X server would do anyways.
> 
> Comments are welcome; I'll go try to write the code in the next few
> days; it all looks pretty easy at this point.
> 
> diff --git a/randrproto.txt b/randrproto.txt
> index 74b7c36..8dded63 100644
> --- a/randrproto.txt
> +++ b/randrproto.txt
> @@ -1,6 +1,6 @@
>  	       The X Resize, Rotate and Reflect Extension
> -			     Version 1.5.0
> -			       2015-03-14
> +			     Version 1.6.0
> +			       2017-04-01
>  
>  			      Jim Gettys
>  			   Jim.Gettys@hp.com
> @@ -9,9 +9,7 @@
>  			Hewlett Packard Company
>  
>  			     Keith Packard
> -			keith.packard@intel.com
> -		     Open Source Technology Center
> -			   Intel Corporation
> +			  keithp@keithp.com
>  
>  1. Introduction
>  
> @@ -186,6 +184,24 @@ consider as single viewable areas.
>  Xinerama's information now comes from the Monitors instead of directly
>  from the CRTCs. The Monitor marked as Primary will be listed first.
>  
> +1.6. Introduction to version 1.6 of the extension
> +
> +Version 1.6 adds resource leasing.
> +
> + • A 'Lease' is a collection of crtcs and outputs which are made
> +   available to a client for direct access via kernel KMS and DRM
> +   APIs. This is done by passing a suitable file descriptor back to
> +   the client which has access to those resources. While leased, those
> +   resources aren't used by the X server.
> +
> +Version 1.6 adds EDID-based output 'grabbing'.
> +
> + • An 'Output Grab' matches a set of EDID Manufacturer ID and product
> +   codes. For outputs with matching EDID values, the connected status
> +   of the output is only visible to the grabbing client. Other clients
> +   will see the output as disconnected. Attempts to configure the
> +   grabbed output by other clients will fail.
> +
>  1.99 Acknowledgments
>  
>  Our thanks to the contributors to the design found on the xpert mailing
> @@ -273,6 +289,10 @@ Mode
>  Provider
>  	A value for a PROVIDER argument does not name a defined PROVIDER.
>  
> +OutputGrab
> +	A value for an OUTPUTGRAB argument does not name a defined
> +	OUTPUTGRAB
> +
>  			      ❧❧❧❧❧❧❧❧❧❧❧
>  
>  5. Protocol Types
> @@ -419,6 +439,23 @@ MONITORINFO { name: ATOM
>  
>  			      ❧❧❧❧❧❧❧❧❧❧❧
>  
> +5.7. Protocol Types added in version 1.6 of the extension
> +
> +OUTPUTGRAB { XID }
> +
> +EDIDMATCH { id: CARD16
> +	     code-min: CARD16
> +	     code-max: CARD16 }
> +
> +	These values come from the EDID specification. 'id' is the
> +	Manufacturer ID value which is bytes 8 and 9 in the EDID
> +	packet, stored in big endian order (MSB first). 'code-min' and
> +	'code-max' define a closed-interval of Manufacturer product
> +	codes, which is byte 10 and 11 of the EDID packet, stored in
> +	little endian order (LSB first).
> +
> +			      ❧❧❧❧❧❧❧❧❧❧❧
> +
>  6. Extension Initialization
>  
>  The name of this extension is "RANDR".
> @@ -1666,6 +1703,67 @@ dynamic changes in the display environment.
>  	window of the screen.
>  
>  			      ❧❧❧❧❧❧❧❧❧❧❧
> +
> +7.6. Extension Requests added in version 1.6 of the extension.
> +
> +┌───
> +    RRCreateLease
> +	window : WINDOW
> +	crtcs: LISTofCRTC
> +	outputs: LISTofOUTPUT
> +     ▶
> +	nfd: CARD8
> +	lease: FD
> +└───
> +	Errors: Window, Access, Value, CRTC, Output
> +
> +	Creates a new Lease for the specified crtcs and outputs from
> +	the screen defined by 'window'. Returns a KMS/DRM file
> +	descriptor which can control the leased objects directly
> +	through the kernel. While leased, all resources will appear to
> +	be 'useless' to clients other than the leasing client as
> +	follows:
> +
> +	• Crtcs are reported as having no 'possible-outputs' and all
> +	  other values reported as if the crtc were disabled.
> +
> +	• Outputs are reported as having no crtcs they can be
> +	  connected to, no clones they can share a crtc with, will
> +	  report a connection status of Disconnected, and will show
> +	  the current crtc as Disabled.
> +
> +	The lease remains in effect until the file descriptor is
> +	closed, even if the client holding the lease disconnects from
> +	the X server.
> +
> +	Returns an Access error if any of the named resources are in
> +	use or already leased to another client.
> +
> +	Returns a Match error if any of the named resources are in use
> +	by the X server.
> +
> +┌───
> +    RRCreateOutputGrab
> +	window : WINDOW
> +	outputgrab: OUTPUTGRAB
> +	matches: LISTofEDIDMATCH
> +└───
> +	Errors: Window, Access, Value, CRTC, Output
> +
> +	Creates an Output Grab with the specified ID on the screen
> +	associated with 'window'. Any output containing an EDID
> +	property matching the grab will appear to be disconnected to
> +	all clients other than the grabbing client.
> +
> +┌───
> +    RRDestroyOutputGrab
> +	outputgrab: OUTPUTGRAB
> +└───
> +	Errors: OutputGrab
> +
> +	Destroys the named OUTPUTGRAB.
> +
> +			      ❧❧❧❧❧❧❧❧❧❧❧
>  8. Extension Events
>  
>  Clients MAY select for ConfigureNotify on the root window to be
> 
> 
> -- 
> -keith



> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-04-02 15:43 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-01 22:58 Proposal for RandR version 1.6, Leases and EDID-based output grabs "Keith Packard"
2017-04-02 15:43 ` Daniel Vetter [this message]
     [not found]   ` <20170402154302.zd7nmqf7vtcvgssu-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-04-02 19:58     ` Keith Packard
2017-04-03  7:45       ` Daniel Vetter
     [not found]         ` <20170403074528.c7vwoi3mg7yeojdr-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-04-03 16:41           ` Keith Packard
2017-04-03 22:07             ` Daniel Vetter
     [not found]               ` <20170403220749.5ujhdzuy6dnikwry-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-04-03 22:50                 ` Keith Packard
2017-04-04  7:02                   ` Daniel Vetter
     [not found]                     ` <20170404070242.rphtgg4yopek2sf7-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-04-04 15:53                       ` Keith Packard
2017-04-04 15:59                         ` Daniel Vetter
     [not found]                           ` <20170404155923.wllkgop2fyj7wydt-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2017-04-04 16:48                             ` Keith Packard
     [not found]                               ` <864ly4glvd.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-04-10 17:47                                 ` Mario Kleiner
2017-04-10 18:11                                   ` Keith Packard
2017-04-10 20:05                                     ` Mario Kleiner
     [not found]                                       ` <d6040e25-326c-90dd-bc47-d88e6823e9a3-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-10 21:16                                         ` Keith Packard
2017-04-10 18:45                       ` Alex Deucher
2017-04-10 19:39                         ` Keith Packard
2017-04-07  0:17 ` Michel Dänzer
     [not found]   ` <4caa78af-7dc8-fbcf-d2ca-285d4554f5c9-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-04-07  3:02     ` Keith Packard
     [not found]       ` <86zifsyl6o.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-04-07  7:56         ` Pekka Paalanen
2017-04-09 17:27           ` Keith Packard
2017-04-10 11:35             ` Pekka Paalanen
2017-04-28 22:03               ` Keith Packard
     [not found]                 ` <86lgqkw5p6.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-02  7:39                   ` Pekka Paalanen
2017-05-02 14:45                     ` Keith Packard
     [not found]                       ` <868tmfl3lm.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-03  7:08                         ` Pekka Paalanen
2017-05-04  2:04                           ` Keith Packard
     [not found]                             ` <86tw5174y1.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-04  8:13                               ` Pekka Paalanen
2017-05-04 18:02                                 ` Keith Packard
     [not found]                                   ` <86inlg7b5n.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-05  8:20                                     ` Pekka Paalanen
2017-05-05 14:25                                       ` Keith Packard
2017-05-06 11:34                                         ` Mario Kleiner
     [not found]                                           ` <7f68d9fe-a40f-cfb2-3efd-1149d93bb5cb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-05-06 15:19                                             ` Keith Packard
2017-05-08  7:33                                             ` Pekka Paalanen
2017-05-10  0:29                                             ` Dave Airlie
     [not found]                                         ` <867f1v1iut.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-08 10:47                                           ` Pekka Paalanen
2017-05-08 15:29                                             ` Keith Packard
     [not found]                                               ` <86fugfxt7p.fsf-6d7jPg3SX/+z9DMzp4kqnw@public.gmane.org>
2017-05-09  7:08                                                 ` Pekka Paalanen
2017-04-29  5:52 ` Proposal for RandR version 1.6, Leases [v2] 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=20170402154302.zd7nmqf7vtcvgssu@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=keithp@keithp.com \
    --cc=xorg-devel@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.