From mboxrd@z Thu Jan 1 00:00:00 1970 From: keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org ("Keith Packard") Subject: Proposal for RandR version 1.6, Leases and EDID-based output grabs Date: Sat, 01 Apr 2017 15:58:58 -0700 Message-ID: <86fuhrka4t.fsf@hiro.keithp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1495403949==" Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: xorg-devel-bounces-go0+a7rfsptAfugRpC6u6w@public.gmane.org Sender: "xorg-devel" To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, xorg-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org List-Id: dri-devel@lists.freedesktop.org --===============1495403949== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. 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 =2D-- a/randrproto.txt +++ b/randrproto.txt @@ -1,6 +1,6 @@ The X Resize, Rotate and Reflect Extension =2D Version 1.5.0 =2D 2015-03-14 + Version 1.6.0 + 2017-04-01 =20 Jim Gettys Jim.Gettys-VXdhtT5mjnY@public.gmane.org @@ -9,9 +9,7 @@ Hewlett Packard Company =20 Keith Packard =2D keith.packard-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org =2D Open Source Technology Center =2D Intel Corporation + keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org =20 1. Introduction =20 @@ -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. =20 +1.6. Introduction to version 1.6 of the extension + +Version 1.6 adds resource leasing. + + =E2=80=A2 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'. + + =E2=80=A2 An 'Output Grab' matches a set of EDID Manufacturer ID and prod= uct + 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 =20 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. =20 +OutputGrab + A value for an OUTPUTGRAB argument does not name a defined + OUTPUTGRAB + =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7= =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7 =20 5. Protocol Types @@ -419,6 +439,23 @@ MONITORINFO { name: ATOM =20 =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7= =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7 =20 +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). + + =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7= =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7 + 6. Extension Initialization =20 The name of this extension is "RANDR". @@ -1666,6 +1703,67 @@ dynamic changes in the display environment. window of the screen. =20 =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7= =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7 + +7.6. Extension Requests added in version 1.6 of the extension. + +=E2=94=8C=E2=94=80=E2=94=80=E2=94=80 + RRCreateLease + window : WINDOW + crtcs: LISTofCRTC + outputs: LISTofOUTPUT + =E2=96=B6 + nfd: CARD8 + lease: FD +=E2=94=94=E2=94=80=E2=94=80=E2=94=80 + 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: + + =E2=80=A2 Crtcs are reported as having no 'possible-outputs' and all + other values reported as if the crtc were disabled. + + =E2=80=A2 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. + +=E2=94=8C=E2=94=80=E2=94=80=E2=94=80 + RRCreateOutputGrab + window : WINDOW + outputgrab: OUTPUTGRAB + matches: LISTofEDIDMATCH +=E2=94=94=E2=94=80=E2=94=80=E2=94=80 + 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. + +=E2=94=8C=E2=94=80=E2=94=80=E2=94=80 + RRDestroyOutputGrab + outputgrab: OUTPUTGRAB +=E2=94=94=E2=94=80=E2=94=80=E2=94=80 + Errors: OutputGrab + + Destroys the named OUTPUTGRAB. + + =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7= =E2=9D=A7=E2=9D=A7=E2=9D=A7=E2=9D=A7 8. Extension Events =20 Clients MAY select for ConfigureNotify on the root window to be =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAljgMLIACgkQ2yIaaQAA ABFk/BAAjlrACeBK7rANaRnwW5u1Gqj71gfQPh8OzIVH3Kf2y5LsnEm1zvnGUY2L 3jgS+04RInsRbxPw7SRktDeStBGSMWb417p4f6OCSZpyHqBjtBjafOdTBJ5mIbHh Z2ui7SOVjRpTsl4/WcvaEv6IU6oFUXtBLbn0zsw8rrO7j2EQaeHmJ1kMa4yo2WSa 0XzlmYSLffodetnAWaLKoewt7KDE/1RRdmtrNzuTsPKVa0w7QjN3dYuAZfD3UDBd WOonCWhSs71Ty06vszzO87GGdgPfbalBT05H0inuZjDbPZTHr4LJoVzo8FvAqaZJ UqR1tTS+MyBfyPLDlRRIqxBw5DELeAYcdsN68m+xOOXUCiqrzxdTtjaa2OwfCech 5C0mAXu/6wRytLc+mKIHlG4WDXaQKZCXDH4K8Z33DsNP23EaVtUndRpDXIN0R1cu sHDM8a3sHt/DCLwOOcGtse3Y4AYibjQgezEBXU9IwmCxnVEy/XuOW9LAJxrzUyBo yt/PB1Z5Ua1EoPDZLSAHrkc7Ayh4fUXydZN3LKzE8zVteN6crm81JaP8XMUfXyJL 3y4lCcXfohmFo/Af4sdT+yotlUXY0V+/kzIeKDODpOWVOFSNPc2/XUYSw/vinNmR MogSRDnHnq7puqUrqb2kcvg4IWqjE54qQGK9o/dxds64ebhAiaU= =C2iM -----END PGP SIGNATURE----- --=-=-=-- --===============1495403949== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KeG9yZy1kZXZl bEBsaXN0cy54Lm9yZzogWC5PcmcgZGV2ZWxvcG1lbnQKQXJjaGl2ZXM6IGh0dHA6Ly9saXN0cy54 Lm9yZy9hcmNoaXZlcy94b3JnLWRldmVsCkluZm86IGh0dHBzOi8vbGlzdHMueC5vcmcvbWFpbG1h bi9saXN0aW5mby94b3JnLWRldmVs --===============1495403949==--