From patchwork Mon Mar 27 22:17:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinclair Yeh X-Patchwork-Id: 9647597 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 700B5601D7 for ; Mon, 27 Mar 2017 22:18:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 609CB25D9E for ; Mon, 27 Mar 2017 22:18:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52BB527D0E; Mon, 27 Mar 2017 22:18:36 +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 D13A425D9E for ; Mon, 27 Mar 2017 22:18:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AE586E37D; Mon, 27 Mar 2017 22:18:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EX13-EDG-OU-001.vmware.com (ex13-edg-ou-001.vmware.com [208.91.0.189]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1FB146E37D for ; Mon, 27 Mar 2017 22:18:34 +0000 (UTC) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Mon, 27 Mar 2017 15:17:20 -0700 Received: from vmware.com (unknown [10.16.254.220]) by sc9-mailhost3.vmware.com (Postfix) with SMTP id 88C2F4043F; Mon, 27 Mar 2017 15:18:27 -0700 (PDT) Received: by vmware.com (sSMTP sendmail emulation); Mon, 27 Mar 2017 15:18:25 -0700 From: Sinclair Yeh To: Subject: [PATCH 2/9] drm/vmwgfx: Skipping fbdev fb pinning for ldu Date: Mon, 27 Mar 2017 15:17:52 -0700 Message-ID: <1490653079-45042-3-git-send-email-syeh@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490653079-45042-1-git-send-email-syeh@vmware.com> References: <1490653079-45042-1-git-send-email-syeh@vmware.com> MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-001.vmware.com: syeh@vmware.com does not designate permitted sender hosts) Cc: thellstrom@vmware.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 Pinning fbdev's FB at the start of VRAM prevents X from pinning its FB. Since for ldu, the fb would be pinned anyway during a mode set, just skip pinning it in fbdev. This is not the best solution, but since ldu is not used much anymore, it seems like a reasonable workaround. Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c index 7d3d5e3..09e120d 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -451,13 +451,15 @@ static int vmw_fb_kms_detach(struct vmw_fb_par *par, } if (par->vmw_bo && detach_bo) { + struct vmw_private *vmw_priv = par->vmw_priv; + if (par->bo_ptr) { ttm_bo_kunmap(&par->map); par->bo_ptr = NULL; } if (unref_bo) vmw_dmabuf_unreference(&par->vmw_bo); - else + else if (vmw_priv->active_display_unit != vmw_du_legacy) vmw_dmabuf_unpin(par->vmw_priv, par->vmw_bo, false); } @@ -585,18 +587,25 @@ static int vmw_fb_set_par(struct fb_info *info) /* * Pin before mapping. Since we don't know in what placement - * to pin, call into KMS to do it for us. + * to pin, call into KMS to do it for us. LDU doesn't require + * additional pinning because set_config() would've pinned + * it already */ - ret = vfb->pin(vfb); - if (ret) { - DRM_ERROR("Could not pin the fbdev framebuffer.\n"); - goto out_unlock; + if (vmw_priv->active_display_unit != vmw_du_legacy) { + ret = vfb->pin(vfb); + if (ret) { + DRM_ERROR("Could not pin the fbdev " + "framebuffer.\n"); + goto out_unlock; + } } ret = ttm_bo_kmap(&par->vmw_bo->base, 0, par->vmw_bo->base.num_pages, &par->map); if (ret) { - vfb->unpin(vfb); + if (vmw_priv->active_display_unit != vmw_du_legacy) + vfb->unpin(vfb); + DRM_ERROR("Could not map the fbdev framebuffer.\n"); goto out_unlock; }