From patchwork Tue Mar 15 07:29:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Hellstrom X-Patchwork-Id: 8585931 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC36AC0553 for ; Tue, 15 Mar 2016 07:52:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D5C8C20165 for ; Tue, 15 Mar 2016 07:52:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 22F2C2025B for ; Tue, 15 Mar 2016 07:52:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B2EC6E6C4; Tue, 15 Mar 2016 07:52:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx6.bahnhof.se (mx6.bahnhof.se [213.80.101.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77F5B6E6C8 for ; Tue, 15 Mar 2016 07:52:03 +0000 (UTC) Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx6-reinject (Postfix) with ESMTP id 1255543140; Tue, 15 Mar 2016 08:30:21 +0100 (CET) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF2) X-Spam-Score: -0.561 X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from mf2.bahnhof.se ([127.0.0.1]) by localhost (mf2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yfcn5FV5DBd0; Tue, 15 Mar 2016 08:30:20 +0100 (CET) Received: from mail.shipmail.org (h-5-150-198-217.na.cust.bahnhof.se [5.150.198.217]) by mf2.bahnhof.se (Postfix) with ESMTP id 98BB9940243; Tue, 15 Mar 2016 08:30:20 +0100 (CET) Received: from mail.shipmail.org (lin0.kontor.shipmail.org [127.0.0.1]) by mail.shipmail.org (Postfix) with ESMTP id 539BF33807C; Tue, 15 Mar 2016 08:30:20 +0100 (CET) Received: from lin0.kontor.shipmail.org [127.0.0.1] by BitDefender SMTP Proxy on lin0.kontor.shipmail.org [127.0.0.1] for lin0.kontor.shipmail.org [127.0.0.1]; Tue, 15 Mar 2016 08:30:20 +0100 (CET) Received: from linvm2.localdomain (lin0.kontor.shipmail.org [127.0.0.1]) by mail.shipmail.org (Postfix) with ESMTP id 1DE96338081; Tue, 15 Mar 2016 08:30:20 +0100 (CET) From: Thomas Hellstrom To: dri-devel@lists.freedesktop.org Subject: [PATCH 08/14] drm/vmwgfx: Add connector properties to switch between explicit and implicit placement Date: Tue, 15 Mar 2016 08:29:58 +0100 Message-Id: <1458027004-3180-8-git-send-email-thellstrom@vmware.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1458027004-3180-1-git-send-email-thellstrom@vmware.com> References: <1458027004-3180-1-git-send-email-thellstrom@vmware.com> X-BitDefender-Scanner: Mail not scanned due to license constraints Cc: Thomas Hellstrom 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-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Thomas Hellstrom Reviewed-by: Sinclair Yeh --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 30 ++++++++++++++++++++++++++++++ drivers/gpu/drm/vmwgfx/vmwgfx_kms.h | 3 ++- drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c | 7 +++++++ drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c | 7 +++++++ drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c | 8 +++++++- 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h index 13970fe..98cf4ff 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h @@ -409,6 +409,7 @@ struct vmw_private { struct vmw_legacy_display *ldu_priv; struct vmw_overlay *overlay_priv; struct drm_property *hotplug_mode_update_property; + struct drm_property *implicit_placement_property; unsigned num_implicit; struct vmw_framebuffer *implicit_fb; diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c index 6726294..0e2340f 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c @@ -1622,6 +1622,12 @@ int vmw_du_connector_set_property(struct drm_connector *connector, struct drm_property *property, uint64_t val) { + struct vmw_display_unit *du = vmw_connector_to_du(connector); + struct vmw_private *dev_priv = vmw_priv(connector->dev); + + if (property == dev_priv->implicit_placement_property) + du->is_implicit = val; + return 0; } @@ -2219,3 +2225,27 @@ void vmw_kms_update_implicit_fb(struct vmw_private *dev_priv, dev_priv->implicit_fb = vfb; } + +/** + * vmw_kms_create_implicit_placement_proparty - Set up the implicit placement + * property. + * + * @dev_priv: Pointer to a device private struct. + * @immutable: Whether the property is immutable. + * + * Sets up the implicit placement property unless it's already set up. + */ +void +vmw_kms_create_implicit_placement_property(struct vmw_private *dev_priv, + bool immutable) +{ + if (dev_priv->implicit_placement_property) + return; + + dev_priv->implicit_placement_property = + drm_property_create_range(dev_priv->dev, + immutable ? + DRM_MODE_PROP_IMMUTABLE : 0, + "implicit_placement", 0, 1); + +} diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h index 0b5c9ab..aa21aff 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h @@ -264,7 +264,8 @@ bool vmw_kms_crtc_flippable(struct vmw_private *dev_priv, struct drm_crtc *crtc); void vmw_kms_update_implicit_fb(struct vmw_private *dev_priv, struct drm_crtc *crtc); - +void vmw_kms_create_implicit_placement_property(struct vmw_private *dev_priv, + bool immutable); /* diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c index 8fb17b8..13b1047 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c @@ -383,6 +383,11 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit) dev->mode_config.suggested_x_property, 0); drm_object_attach_property(&connector->base, dev->mode_config.suggested_y_property, 0); + if (dev_priv->implicit_placement_property) + drm_object_attach_property + (&connector->base, + dev_priv->implicit_placement_property, + 1); return 0; } @@ -418,6 +423,8 @@ int vmw_kms_ldu_init_display(struct vmw_private *dev_priv) if (ret != 0) goto err_vblank_cleanup; + vmw_kms_create_implicit_placement_property(dev_priv, true); + if (dev_priv->capabilities & SVGA_CAP_MULTIMON) for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i) vmw_ldu_init(dev_priv, i); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c index 1390cff..7ca13ec 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c @@ -541,6 +541,11 @@ static int vmw_sou_init(struct vmw_private *dev_priv, unsigned unit) dev->mode_config.suggested_x_property, 0); drm_object_attach_property(&connector->base, dev->mode_config.suggested_y_property, 0); + if (dev_priv->implicit_placement_property) + drm_object_attach_property + (&connector->base, + dev_priv->implicit_placement_property, + sou->base.is_implicit); return 0; } @@ -568,6 +573,8 @@ int vmw_kms_sou_init_display(struct vmw_private *dev_priv) if (unlikely(ret != 0)) goto err_vblank_cleanup; + vmw_kms_create_implicit_placement_property(dev_priv, false); + for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i) vmw_sou_init(dev_priv, i); diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c index f02bb70..1cd88d1 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c @@ -1134,7 +1134,11 @@ static int vmw_stdu_init(struct vmw_private *dev_priv, unsigned unit) dev->mode_config.suggested_x_property, 0); drm_object_attach_property(&connector->base, dev->mode_config.suggested_y_property, 0); - + if (dev_priv->implicit_placement_property) + drm_object_attach_property + (&connector->base, + dev_priv->implicit_placement_property, + stdu->base.is_implicit); return 0; } @@ -1199,6 +1203,8 @@ int vmw_kms_stdu_init_display(struct vmw_private *dev_priv) dev_priv->active_display_unit = vmw_du_screen_target; + vmw_kms_create_implicit_placement_property(dev_priv, false); + for (i = 0; i < VMWGFX_NUM_DISPLAY_UNITS; ++i) { ret = vmw_stdu_init(dev_priv, i);