From patchwork Tue Dec 20 10:38:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Thayer X-Patchwork-Id: 9482431 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 E08A060821 for ; Wed, 21 Dec 2016 01:29:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3362281AA for ; Wed, 21 Dec 2016 01:29:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C816228343; Wed, 21 Dec 2016 01:29:18 +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, UNPARSEABLE_RELAY,WEIRD_QUOTING 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 42F86281AA for ; Wed, 21 Dec 2016 01:29:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DFCE6EADF; Wed, 21 Dec 2016 01:28:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98CC96ED69 for ; Tue, 20 Dec 2016 10:39:44 +0000 (UTC) Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBKAdZVH025454 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Dec 2016 10:39:36 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uBKAdY56004982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Dec 2016 10:39:34 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id uBKAdVRc004623; Tue, 20 Dec 2016 10:39:32 GMT Received: from michael-Latitude-E6420.fritz.box (/79.214.107.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 20 Dec 2016 02:39:30 -0800 From: Michael Thayer To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: remove immutable flag from suggested X/Y connector properties Date: Tue, 20 Dec 2016 11:38:52 +0100 Message-Id: <20161220103852.30963-1-michael.thayer@oracle.com> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Source-IP: userv0022.oracle.com [156.151.31.74] X-Mailman-Approved-At: Wed, 21 Dec 2016 01:28:43 +0000 Cc: Michael Thayer , kraxel@redhat.com, daniel.vetter@intel.com 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 The suggested X and Y connector properties are intended as a way for drivers for virtual machine GPUs to provide information about the layout of the host system windows (or whatever) corresponding to given guest connectors. The intention is for the guest system to lay out screens in the virtual desktop in a way which reflects the host layout. Sometimes though the guest system chooses not to follow those hints, usually due to user requests. In this case it is useful to be able to pass information back about the actual layout chosen. The immediate use case for this is host-to-guest pointer input mapping. Qemu, VirtualBox and VMWare currently handle this by providing an emulated graphics tablet device to the guest. libinput defaults, as did X.Org before it used libinput, to mapping the position information reported by the device to the smallest rectangle enclosing the screen layout. Knowing that layout lets the hypervisor send the right position information through the input device. Signed-off-by: Michael Thayer --- Follow-up to thread "Passing multi-screen layout to KMS driver". In that thread, Gerd suggested an alternative way of solving the use case, namely emulating one input device per virtual screen, touchscreen-style. My reasons for prefering this approach is that it is relatively uninvasive, and closer to the way things are done now without (in my opinion) being ugly; and that automatic touchscreen input to screen mapping is still not a solved problem. I think that both are valid though. Both approaches require changes to the hypervisor and virtual hardware, and to user-space consumers which would use the interface. I have checked the mutter source and believe that the change required to support the interface as implemented here would be minimal and intend to submit a patch if this change is accepted. I think that the virtual hardware changes are likely to be less invasive with this approach than with the other. This change will though also require small drm driver changes once the virtual hardware has been adjusted; currently to the qxl driver and to the out-of-tree vboxvideo driver. It would certainly be nice to have in virtio-gpu. Regards Michael Documentation/gpu/kms-properties.csv | 4 ++-- drivers/gpu/drm/drm_connector.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/gpu/kms-properties.csv b/Documentation/gpu/kms-properties.csv index 981873a..825238e 100644 --- a/Documentation/gpu/kms-properties.csv +++ b/Documentation/gpu/kms-properties.csv @@ -20,8 +20,8 @@ Owner Module/Drivers,Group,Property Name,Type,Property Values,Object attached,De ,,“overscan”,RANGE,"Min=0, Max=100",Connector,TBD ,,“saturation”,RANGE,"Min=0, Max=100",Connector,TBD ,,“hue”,RANGE,"Min=0, Max=100",Connector,TBD -,Virtual GPU,“suggested X”,RANGE,"Min=0, Max=0xffffffff",Connector,property to suggest an X offset for a connector -,,“suggested Y”,RANGE,"Min=0, Max=0xffffffff",Connector,property to suggest an Y offset for a connector +,Virtual GPU,“suggested X”,RANGE,"Min=0, Max=0xffffffff",Connector,"property to suggest an X offset for a connector to help match positions of host windows and guest screens; can be set by the driver for the host or user-space for the guest" +,,“suggested Y”,RANGE,"Min=0, Max=0xffffffff",Connector,"property to suggest an Y offset for a connector to help match positions of host windows and guest screens; can be set by the driver for the host or user--space for the guest" ,Optional,"""aspect ratio""",ENUM,"{ ""None"", ""4:3"", ""16:9"" }",Connector,TDB i915,Generic,"""Broadcast RGB""",ENUM,"{ ""Automatic"", ""Full"", ""Limited 16:235"" }",Connector,"When this property is set to Limited 16:235 and CTM is set, the hardware will be programmed with the result of the multiplication of CTM by the limited range matrix to ensure the pixels normaly in the range 0..1.0 are remapped to the range 16/255..235/255." ,,“audio”,ENUM,"{ ""force-dvi"", ""off"", ""auto"", ""on"" }",Connector,TBD diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 5a45262..ebb3cee 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c @@ -876,10 +876,10 @@ int drm_mode_create_suggested_offset_properties(struct drm_device *dev) return 0; dev->mode_config.suggested_x_property = - drm_property_create_range(dev, DRM_MODE_PROP_IMMUTABLE, "suggested X", 0, 0xffffffff); + drm_property_create_range(dev, 0, "suggested X", 0, 0xffffffff); dev->mode_config.suggested_y_property = - drm_property_create_range(dev, DRM_MODE_PROP_IMMUTABLE, "suggested Y", 0, 0xffffffff); + drm_property_create_range(dev, 0, "suggested Y", 0, 0xffffffff); if (dev->mode_config.suggested_x_property == NULL || dev->mode_config.suggested_y_property == NULL)