Received: by 10.213.65.68 with SMTP id h4csp1766605imn; Mon, 19 Mar 2018 12:40:41 -0700 (PDT) X-Google-Smtp-Source: AG47ELuevjaSpff3jDadbNo19rUr/pR69eeNjZ5UOwuWU+8/XtXsOhp8jir1H9UEDX0vvLL13eDS X-Received: by 10.98.58.75 with SMTP id h72mr5338317pfa.209.1521488441135; Mon, 19 Mar 2018 12:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488441; cv=none; d=google.com; s=arc-20160816; b=BmmiyGcTHInyvfs0JMb9F5A7I0vMMl9wFtwumFzf0IHFNbAgqQ5S2Dv4o2Zbcn8o/h DNr0K4bE7QCnx4cYXr1d6hQ9UzMTIP8vsPpxi/DlnhHw+gwl3dv1ETGd3/e1/4Oz4hXp A3uHQtvddnUV+p+Zf1d6NShDVSWH5VccUqXvNDezUoD+DpJ/pVI46k30/t2uQAlCIzry tEK1zf9CCWCFHHqI/ei88az/1vtVjnzbh4GNaBveqmYKZUTNfiVXvRmjFOu3SR2/xMuU fa+6F4729s1Km4PkSbNJZK7fLFCsCd5T/GwwM2WiRyRiGAtiV8DZApwz17L/4rS8gXAx RMpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=FrzeiqxSWQJ7WlUlRKYLULpn6C2j/NOZYywNrXHqGPY=; b=OFE/6qI9ZwaGWvGxHjmS3uR5oygHUZq7PhsvNTAIlridpjGlQ2BQr0FuyVLT8KdH+E HIvNRTCclcxJNB/exRT3YiEaMfSkMACAGyYzXYwjue5dj2G/+p7Krm4lk/qj8G4A51Zg lnXFT1X7TJEOwymT2P6uyE36zjJDRGGvo2TTXqyf5pHZRKjODV5yDXTuXAQtZ8zsNeZP oLdTji9ceLpJ7vAzC/1hXZrG2aBi2VKTbTq+qhbP/B81/WFcUkcmBrVu0yjBBjI3Y14W NHf95U+cqdSL/H3tYIIpt2DjCDy0TFoTYCZtnjOiX4Xd1waypBYJFsSPD0q9h+r4iDYP SpPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2-v6si482220plm.476.2018.03.19.12.40.26; Mon, 19 Mar 2018 12:40:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031183AbeCSSWB (ORCPT + 99 others); Mon, 19 Mar 2018 14:22:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48284 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969602AbeCSSVt (ORCPT ); Mon, 19 Mar 2018 14:21:49 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AB2071284; Mon, 19 Mar 2018 18:21:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sinclair Yeh , Thomas Hellstrom , Sasha Levin Subject: [PATCH 4.9 088/241] drm/vmwgfx: Fixes to vmwgfx_fb Date: Mon, 19 Mar 2018 19:05:53 +0100 Message-Id: <20180319180754.849858133@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sinclair Yeh [ Upstream commit aa74f0687cfe998e59b20d6454f45e8aa4403c45 ] 1. When unsetting a mode, num_connector should be set to zero 2. The pixel_format field needs to be initialized as newer DRM internal functions checks this field 3. Take the drm_modeset_lock_all() because vmw_fb_kms_detach() can change current mode Signed-off-by: Sinclair Yeh Reviewed-by: Thomas Hellstrom Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vmwgfx/vmwgfx_fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fb.c @@ -433,7 +433,7 @@ static int vmw_fb_kms_detach(struct vmw_ set.y = 0; set.mode = NULL; set.fb = NULL; - set.num_connectors = 1; + set.num_connectors = 0; set.connectors = &par->con; ret = drm_mode_set_config_internal(&set); if (ret) { @@ -821,7 +821,9 @@ int vmw_fb_off(struct vmw_private *vmw_p flush_delayed_work(&par->local_work); mutex_lock(&par->bo_mutex); + drm_modeset_lock_all(vmw_priv->dev); (void) vmw_fb_kms_detach(par, true, false); + drm_modeset_unlock_all(vmw_priv->dev); mutex_unlock(&par->bo_mutex); return 0;