From patchwork Sat Apr 1 22:58:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 9658327 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6F48860349 for ; Sat, 1 Apr 2017 23:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A30A28516 for ; Sat, 1 Apr 2017 23:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EEC428552; Sat, 1 Apr 2017 23:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A7C3828516 for ; Sat, 1 Apr 2017 23:21:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D28546E1B1; Sat, 1 Apr 2017 23:21:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 42D426E16E; Sat, 1 Apr 2017 22:59:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 1E2253F20602; Sat, 1 Apr 2017 15:58:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rI6OagfVLI9t; Sat, 1 Apr 2017 15:58:58 -0700 (PDT) Received: from hiro.keithp.com (hiro.keithp.com [10.0.0.36]) by elaine.keithp.com (Postfix) with ESMTPSA id 03E893F20126; Sat, 1 Apr 2017 15:58:58 -0700 (PDT) Received: by hiro.keithp.com (Postfix, from userid 1001) id 7CE89740DE7; Sat, 1 Apr 2017 15:58:58 -0700 (PDT) From: keithp@keithp.com ("Keith Packard") To: dri-devel@lists.freedesktop.org, xorg-devel@lists.freedesktop.org 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 X-Mailman-Approved-At: Sat, 01 Apr 2017 23:20:59 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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