From patchwork Wed Mar 22 17:35:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jose Abreu X-Patchwork-Id: 9640215 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 CD7B36020B for ; Wed, 22 Mar 2017 22:27:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF5E026E48 for ; Wed, 22 Mar 2017 22:27:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0F7328495; Wed, 22 Mar 2017 22:27:47 +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 3E2CF26E48 for ; Wed, 22 Mar 2017 22:27:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A94A6E9D7; Wed, 22 Mar 2017 22:26:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtprelay.synopsys.com (us01smtprelay-2.synopsys.com [198.182.47.9]) by gabe.freedesktop.org (Postfix) with ESMTPS id A48226E955 for ; Wed, 22 Mar 2017 17:36:24 +0000 (UTC) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 1EAC124E064C for ; Wed, 22 Mar 2017 10:36:24 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 045D85A8; Wed, 22 Mar 2017 10:36:24 -0700 (PDT) Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.97]) by mailhost.synopsys.com (Postfix) with ESMTP id 07BCC58E; Wed, 22 Mar 2017 10:36:22 -0700 (PDT) From: Jose Abreu To: dri-devel@lists.freedesktop.org Subject: [RFC 1/5] drm: Add HDMI 2.0+ features exposing knob Date: Wed, 22 Mar 2017 17:35:57 +0000 Message-Id: <24f51db0ce2b1efede9033153f6479cbca395342.1490203284.git.joabreu@synopsys.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Wed, 22 Mar 2017 22:26:38 +0000 Cc: Jose Abreu , Carlos Palminha 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP We can't expect userspace to have full support for all HDMI 2.0+ features. Instead of expecting/waiting for userspace to support the new features add a knob, much like the stereo knob, so that DRM core will only expose the features when asked too. Signed-off-by: Jose Abreu Cc: Carlos Palminha Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_ioctl.c | 5 +++++ include/drm/drm_file.h | 8 ++++++++ include/uapi/drm/drm.h | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index a7c61c2..2430e2e 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -318,6 +318,11 @@ static int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_ file_priv->atomic = req->value; file_priv->universal_planes = req->value; break; + case DRM_CLIENT_CAP_HDMI2: + if (req->value > 1) + return -EINVAL; + file_priv->hdmi2_allowed = req->value; + break; default: return -EINVAL; } diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h index 5dd27ae..7b97d85 100644 --- a/include/drm/drm_file.h +++ b/include/drm/drm_file.h @@ -192,6 +192,14 @@ struct drm_file { unsigned is_master:1; /** + * @hdmi2_allowed: + * + * True if client understands HDMI 2.0+ features like, for example, + * extended aspect ratios + */ + unsigned hdmi2_allowed:1; + + /** * @master: * * Master this node is currently associated with. Only relevant if diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h index b2c5284..9e25138 100644 --- a/include/uapi/drm/drm.h +++ b/include/uapi/drm/drm.h @@ -678,6 +678,13 @@ struct drm_get_cap { */ #define DRM_CLIENT_CAP_ATOMIC 3 +/** + * DRM_CLIENT_CAP_HDMI2 + * + * If set to 1, the DRM core will expose HDMI 2.0+ features to userspace + */ +#define DRM_CLIENT_CAP_HDMI2 4 + /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */ struct drm_set_client_cap { __u64 capability;