Received: by 10.213.65.68 with SMTP id h4csp1791460imn; Mon, 19 Mar 2018 13:22:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELuILNsTGcczftHkas4sEZrvcPQICdC0eKJ2p3Of+bN17cb7szKXXI7nJcqyNxdCZXaKTYg5 X-Received: by 2002:a17:902:4481:: with SMTP id l1-v6mr13890804pld.43.1521490934408; Mon, 19 Mar 2018 13:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521490934; cv=none; d=google.com; s=arc-20160816; b=qsWgIlRKb+xA+4zSvN8lwhVlTbJsJPFHQGVsDpDrfnErYI4GZiNuJrLXq5cmF7qusD 4F+uOwraNS/aYzQKDSpVcrVrzlPXafFNRx0tw6Qbjqn4HcKVRTUGONapcVThKimsaTab +adi+7mEom/l3VS2ffIZkfGWZW2Z1wvQbJJ651UBuABOFT0rYoDo1C7+Mk9Ku8L6aDxx n1K95PR1UBjEFd9L/JWpwwCphraINXMLTEIZpM/trQ/mGHOgxRHk931PZOA0c4joF/e9 4oWwQP0XRNrCDXIYD4qM5GKaGYHBK155x/v9QEW/2EN/Ir96V05mvyz2lv6lUxJKX+9d fjuA== 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=XkRcCYKUI8cx6gLLiY4NkEYxLb6WIKrzVgEmzs/gIC4=; b=YOxcklNNhr1QVG6fPH2XgrjtHgqRAGurAHsrvbFhrlC6W+uOYx3nGot1lBNfTlvqJA u1vGfVPiwYx92wcFSzQiH43cbHXt7SyGjrSutH2mrNHIgd1c13Xo+7JWkZx/mYdIqh1k 11Qd6/smYeXMXYyw3OJlcmFtP4zVMqCW/0EniyzFnn/0GeMus0d0U97dk+qpoWUip2og KYS7wAG+wChGW+1Q27lsEC1luiZBZtlPIsteJ4Xg05xZ469xQyHv5+t3hpPF1UELpBLY j1cfFZKMKpTDxUQ6YLAoMHoO4+CEtt3v9pxWk7PdrL+SL81bHidmTUNk7DIIsAP2ainb PYjQ== 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 l63si18125pfl.72.2018.03.19.13.22.00; Mon, 19 Mar 2018 13:22:14 -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 S1030791AbeCSUUI (ORCPT + 99 others); Mon, 19 Mar 2018 16:20:08 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44480 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935089AbeCSSPJ (ORCPT ); Mon, 19 Mar 2018 14:15:09 -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 C3ABCF97; Mon, 19 Mar 2018 18:15:08 +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.4 043/134] drm/vmwgfx: Fixes to vmwgfx_fb Date: Mon, 19 Mar 2018 19:05:26 +0100 Message-Id: <20180319171855.594348584@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@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.4-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;