Received: by 10.213.65.68 with SMTP id h4csp2119469imn; Sun, 8 Apr 2018 20:11:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx495G8+NiP8TCKR4s/5L99o68Aerp9g358ykfnw9UBGGSOzZ2sqLvIpk6rx8uoiyJKwk7kyg X-Received: by 10.98.150.198 with SMTP id s67mr27950619pfk.191.1523243383086; Sun, 08 Apr 2018 20:09:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243383; cv=none; d=google.com; s=arc-20160816; b=m6lLNgzQZuULZI6Fj+YVmiA7By6qkDL21++TCDbhrdBDS0LbaL01D8ZexVDo7pov6N PzHj8Zjb5QkNNRzdzo5N3oqpOSfS4ESTabcnWyY4w3Vxd2cCeKg3XpQe8fzHmu3M9Jz+ M/N1cOYrZ6wvSitPpnW2yj2ULnK17uwlpR/eM6dR+PJ5FcE9F84n6w5L6tUfu2tazBGG lLzU/jN6mnV6HsCbUXNKgyX8PX8lQ+tp42n7YfpgLHMra6TeOILcgzSw/g3je+VXpAbU 6VPDSQerN/0+uL954TXDKxHlemoMdHbO5fD5UMPu/lCgVwFolPRuSkFKkACO+20MQPAQ 1ZUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=M2QFESJYqXfLycSucEkqwfK2PgMByK5bSswqGb0kVfc=; b=WyqRq06MWAME8icO9ae/UC9taPPIKqeiY7WlMn99uRXOdVy3PffWtgAX/DygSFhCpB SFYeQJbdRwfxeO5ojEL2B+bitZO2MmrUDqf6OnUWG/PIMoBK/9H1797FwJ0keyJVB81Z xvAnjsge2F+e8HTaSwZAicBLZxQKTM0+mwmKXiYW9QQY0ZfUUuTlkAhXM7qMyhsZY6bB 0t1poz8FDNjI/2UpPuuOp6YOzNEHc29HzjWkGfo+37wIECmMtAuKFWbkQ9vQvrjezx9v 6gyXbLm4vK7Is+AB1VPOppZ5Kqz/u5vnTuGcZ1xCYLXnbOFO5NJeRcQRUrYIYlHwG86V jc0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PbMAFcLo; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12-v6si13752563plb.342.2018.04.08.20.09.06; Sun, 08 Apr 2018 20:09:43 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=PbMAFcLo; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932871AbeDICUn (ORCPT + 99 others); Sun, 8 Apr 2018 22:20:43 -0400 Received: from mail-sn1nam02on0106.outbound.protection.outlook.com ([104.47.36.106]:7529 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755114AbeDIA3o (ORCPT ); Sun, 8 Apr 2018 20:29:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=M2QFESJYqXfLycSucEkqwfK2PgMByK5bSswqGb0kVfc=; b=PbMAFcLoB9acFXmJxBdGuwLKyumvGUgvo5XD6FVmp7zgUEWdetr/O6L8TEf/ZF4rwCqws27Iub7P8yUtpBViv9icTFaPIlP7iDnZppy6B+T5LJxp2F5hwb21DGesHR6jP8sH3HRSluH07kdoEm8uWVUTN1a5cGNCDAoTvW4nax8= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:29:40 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:29:40 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Boris Brezillon , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 116/293] drm/vc4: Send a VBLANK event when disabling a CRTC Thread-Topic: [PATCH AUTOSEL for 4.9 116/293] drm/vc4: Send a VBLANK event when disabling a CRTC Thread-Index: AQHTz5kcrErY13EWR0Kp3z5SXO7QBQ== Date: Mon, 9 Apr 2018 00:24:23 +0000 Message-ID: <20180409002239.163177-116-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1032;7:3FqcsgL5Kub6aclT23L7uDCotS4PprL/1QND3Es8IftxTvnFrpgoJ8fONT/CZzETcu1F+6pd0IBV5aKqDD0BNNWXVv5vjiKh5undSXKaSjPtoxpuqpCZlvrYav6zpP4ETk4aPnGFBJknuvzDIl7nF/ega9D4KGZBA3nH2yP8CYn8E/QDRSPQSvgnkeZS4Om1ys3JFIo1quHVH1MQwn+n4mrCHxQrmBXsLbSj2X2/NDGeg7bQllBkdCFYlYY8zEeB;20:iqGHx9fQQxuYsBS6th5GCIb3lHcm3HBGg2vyjUgtrmauhdf0UzRY+3jMwBs8Sn6TBPHeO2T0Cf2uWKwxc/U6+/iCoFkirhGhuCYTumHQIR7eMfKOhHyQRnrBaK5LKVwap41k1B8TzcsyTrgpFZ5HdpqPCNy46Nh6Dz7F2bOaovU= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 727b4189-2a34-4c3f-14d5-08d59db0fbc3 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1032; x-ms-traffictypediagnostic: DM5PR2101MB1032: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(58145275503218); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1032;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1032; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(346002)(396003)(39860400002)(376002)(366004)(189003)(199004)(5660300001)(76176011)(99286004)(10090500001)(2900100001)(105586002)(305945005)(7736002)(107886003)(2501003)(5250100002)(14454004)(53936002)(4326008)(8936002)(68736007)(25786009)(86612001)(3846002)(66066001)(1076002)(486006)(316002)(72206003)(22452003)(106356001)(186003)(97736004)(6436002)(6116002)(476003)(2616005)(478600001)(6486002)(10290500003)(2906002)(110136005)(54906003)(6512007)(81156014)(81166006)(8676002)(36756003)(966005)(11346002)(3660700001)(446003)(6666003)(86362001)(26005)(6306002)(102836004)(575784001)(3280700002)(6506007)(59450400001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1032;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kDlly8yCWIjnbAkIgv7ntA+p2W6LsneHOJslyeCFyGaVIfMVbKL+bqpfaCulDp5Bd5BL5EglHW8RPZc/LnjYQzO++7UkyHaIF+od0wBLffwOLvQ3c3l9i5ytZ1NasKyjNGqz03oI9O0ZKkFPaB4AuDdzp4kBM3ZQB6KjTydq0I3QIar7ODeNFOtGv8O130CVGWlJ76rkqNefqvRDOjcbNMKWhGyfs5JsF9rPTIQWHCi03iSX38jb9vNn85NbnNc4zMldEYTRUsN6sbUhjSu1L0T421rdfhD+l81XBlvL9pK+9KDN/gV9gvgN5CPuPJZebhNjjaXQ0JbJrkc/jrxYlsBIPzxxcGG70xR0Nu5HxA1em+RjePeGRjeZOfzd62zFshoWBKWufBuyH9RvnGVIyW/umYN+yr3O6n3ZTAKB57Y= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 727b4189-2a34-4c3f-14d5-08d59db0fbc3 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:23.9094 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1032 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Boris Brezillon [ Upstream commit edeb729f7929d1372ab426a7f56fd0b337ba5751 ] VBLANK events are missed when the CRTC is being disabled because the driver does not wait till the end of the frame before stopping the HVS and PV blocks. In this case, we should explicitly issue a VBLANK event if there's one waiting. Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Link: http://patchwork.freedesktop.org/patch/msgid/1497601833-24588-1-git-s= end-email-boris.brezillon@free-electrons.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_crtc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.= c index c7e6c9839c9a..474b9372fea6 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -522,6 +522,19 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) & (SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) !=3D SCALER_DISPSTATX_EMPTY); + + /* + * Make sure we issue a vblank event after disabling the CRTC if + * someone was waiting it. + */ + if (crtc->state->event) { + unsigned long flags; + + spin_lock_irqsave(&dev->event_lock, flags); + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event =3D NULL; + spin_unlock_irqrestore(&dev->event_lock, flags); + } } =20 static void vc4_crtc_enable(struct drm_crtc *crtc) --=20 2.15.1