Received: by 10.213.65.68 with SMTP id h4csp2117988imn; Sun, 8 Apr 2018 20:09:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx49yAQL09HPUkA4WVJfZ9jEB8qU6IVCqAN5eeHp5si4G7yifw15xszFcoqObiz7omtDLRTd2 X-Received: by 10.99.110.198 with SMTP id j189mr23562429pgc.71.1523243352443; Sun, 08 Apr 2018 20:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243352; cv=none; d=google.com; s=arc-20160816; b=szWZKcoLp9fhAeozkPJdLfVN7PsnZRzpmBjbKvTSAYjBcVf0UoixgjjpkxH92f68a6 +G/NOn4OBpGrR3fduHAf0PzooONQ9mztQhXJCk8q7scsMArqILNgMMSxmOdpH21tMC7L qEZCsZQZem26VShdEljMDnpOFQhpfZvhExq1jUmOtUb+1Auk7wGNVYK1Svk0YuYDKQRP UBWfOydylbcGJp+Y7cLtjFokg5BoU5iKrVaBF+YmiN4zu9PuUgA+R0Gnk8Ljp+bwK8bI P4yabjDcByYy1sy/orP0oS290A6jSKqbq/FjPOCSM/7vOg3mkOA4+GGCPRtjm8Zm4Z5z uk3Q== 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=8G4RNJBCSenTmw8Gquzf04hRGUt1fWipzQwt6O31ZHc=; b=b7aVoF21snp/4l2sPyMobC3zDdjb4ABmV1SribwPOaKme2c5IyYjY/gi2m/g92oDGF VuGdKTPd0nXLQv5Q5MRz+L/BFZoLlnw6DOmDmJyGNtGj9bUDDTSGn8WEcRIyenq4oAkq hZYPAKleJw9ZCI2J48AnNrqElA9PzsQKLLhF4zC/easR7NGzuCFh0R8XalLjwlNXAlKt uKj/0hbhnGCakH1IlKgM2lngfQFw4zDQUXL7FZ0Ei9QeV5Dpt2Xs72Y+o45/Fj7r7h5R /1chP+aDNx0IsglA/+td9fP8P5SKLD8prRdBttgF6iC+p8E9xbPFNyCpcwoIjIiB7vX8 VPWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=U6KiTguM; 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 t21si11934593pfe.353.2018.04.08.20.08.36; Sun, 08 Apr 2018 20:09:12 -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=U6KiTguM; 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 S932667AbeDIAgs (ORCPT + 98 others); Sun, 8 Apr 2018 20:36:48 -0400 Received: from mail-sn1nam02on0107.outbound.protection.outlook.com ([104.47.36.107]:45025 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756161AbeDIAgp (ORCPT ); Sun, 8 Apr 2018 20:36:45 -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=8G4RNJBCSenTmw8Gquzf04hRGUt1fWipzQwt6O31ZHc=; b=U6KiTguMLlw7imKdVFSXyvLdnZmvOmRzwYMRqzVJ+SmPcghNwYi6cUt0K3tbab9LkiZonPCqpU/jZfVasO8BQlBU0Fz9kjY/yCGEImXev7cn6t6yJjuqfWPAmsa/hckl0k9UH9pUXn77rbqlamZ7P15t0m+sv/pBF2J5v88FcXs= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0885.namprd21.prod.outlook.com (52.132.132.154) 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:36:44 +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:36:44 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Boris Brezillon , Sasha Levin Subject: [PATCH AUTOSEL for 4.4 061/162] drm/vc4: Send a VBLANK event when disabling a CRTC Thread-Topic: [PATCH AUTOSEL for 4.4 061/162] drm/vc4: Send a VBLANK event when disabling a CRTC Thread-Index: AQHTz5mtFkXmrgc+5UOGiqZKKnXo/Q== Date: Mon, 9 Apr 2018 00:28:26 +0000 Message-ID: <20180409002738.163941-61-alexander.levin@microsoft.com> References: <20180409002738.163941-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002738.163941-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;DM5PR2101MB0885;7:vBTXX17Elw0f3D83qqcUgcAjUdA1eqvGr2O93wYCipCdNMyZlIOU6t9UNjw9j1IdPovbmvn6wQVoy9dVpGakn6cfpnbA90Bd1jvN1im1buBs8nn141iCIQkqlclkFkkE/LNZGuNYb3FP1aRGRESboCtwzuJtlew+nXG75jQfqAnxzjBdUbPxfpK1gUMayoUuv5n3y9dxJrCTJX3MYf1sLMpCW1sEEhHoGGN/p52dSTQ+pA/mHnduJQCI/QmJowVS;20:xLZfC1T6Lb8dnYnP/1RDkd9HwsIRaxeaVn7dtyM89HiOXXZS9Jp4NLCYLKfYucVW6n98l2G8uhaXnXiep13xSTHJguT+/jcE0hgATe6jLHaiD2o0Fiki+Vdbl2SKWBm65xA9JMlZvG19QN7zCw7Sp6WJeSjNx4Qo8+uSGXCWL5A= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 6d8cd029-3a0f-4808-1484-08d59db1f821 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0885; x-ms-traffictypediagnostic: DM5PR2101MB0885: 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)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0885;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0885; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(396003)(376002)(39860400002)(366004)(346002)(199004)(189003)(66066001)(575784001)(3846002)(6116002)(59450400001)(86362001)(305945005)(10290500003)(6436002)(5250100002)(3280700002)(10090500001)(3660700001)(966005)(6506007)(2501003)(107886003)(446003)(53936002)(11346002)(2616005)(26005)(76176011)(7736002)(478600001)(476003)(81156014)(25786009)(8676002)(81166006)(186003)(8936002)(4326008)(97736004)(102836004)(99286004)(14454004)(6306002)(36756003)(6512007)(316002)(2906002)(22452003)(68736007)(54906003)(110136005)(486006)(6486002)(6666003)(5660300001)(2900100001)(1076002)(72206003)(86612001)(105586002)(106356001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0885;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: QqfWZUnjBN7PP3TPFfMYRkzaMjoiU/XdwCcy/+15gP4ZHvKQ4xOqGdx+lbrnU4vXWsnk3j3HFFn8DLXa8DiUSWujch8AAp+cdW1/Hdk2bP+eWuoUyqpIjIKz71Oqg3bfLiCC+Z85XMZkZlkxD6cCirakaXYEE21kgUNXyezm/duxOPOBaex08sffJ3ccT3q399BADiQ+syGWQZdjlftwfq2wZbmWiuKScM9dZX+yA/PilG5qXejPKR6787YzK86M8un2PHijeOd8rWYmnOO9LkgJ1uHm2szo6ZvvIXVIHezS3Ufvud85U6+BhtIvi9tWLfWAQgAIDtz5bLOxWitdP9zEdJQD5V2+CleA6OM5o8q3Pwxmnwld9sblJ4hz5KdHDpp326UaG6LU1ubUlsQMfNzOo4cUzgBQ0lfvApiFo3g= 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: 6d8cd029-3a0f-4808-1484-08d59db1f821 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:28:26.8800 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0885 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 265064c62d49..6987723c23ed 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -290,6 +290,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