Received: by 10.213.65.68 with SMTP id h4csp37733imn; Mon, 19 Mar 2018 18:46:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELuAFW966OYidkia7Blb9hXBsBUuJFhGtF4O+Ym3eQlyT//T4fdfcywJzDhhHk+IKmfXxu/i X-Received: by 2002:a17:902:1665:: with SMTP id g92-v6mr14214742plg.195.1521510386142; Mon, 19 Mar 2018 18:46:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510386; cv=none; d=google.com; s=arc-20160816; b=JqoKoFEqmrob10uez/3J58umrFdpXafLDdz66V4NiAZ2cYq7oGWDJyNajdBHndEdCr BTT0FnJlFMLJ/f3Wctu079lQdRlVB+e7hcSAet5zzHz/W0D8a1TWrlP0p+gvjTck0hrL lYdUKj6L6L3vjPqccDLmrlhA1ztlrgDWRCCZHhe5suZ1fyGP+1MRwQflVSKbh++meKvK Tod7vtZOGVTzlosVJPb0fBVRutuJD8dnyniLfx8KYc/FNQuLXtmyQNmOQHaa+N3Efe5N t+zc3yBr2NqBPpKyz1O9cgrgbwso84avLQ9d3bGP9XfgHkAFKd56pYOO2olXReLOsVhH FMeA== 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=bf/+yzQMKUJ2xkNq3lgrF3ASVTK8uUIS6H/l84lZv80=; b=R2q6ARb2MprjdQoZRlX+RkeSldKfy/o7vL2DRnDBbRQDoJfPxm9z2NyGZhPb1kZGYn encLO8lXVREN1lNrjmeBqAUZXjfSzXSXhfdHnmHWP4wi85D7W4QYl0mNTWf2p6t+JCTI /4rkffLsNfsYp1TGOLt15W1LT2wEEsiziHVYcNsbcwwMNbhajuEBnj7gPpatWowv5lKz Lb2WAJFJk/X2HhTbkxv5PKhkMxClsvrTj7MJpJuWal7EDCw4n4LaekIU4RIJrDvveCv5 vi7x8pSvGzDzNdyKkaZGnH/CzuL1qLhklGV8rCxanGmz7E0fHozFtcW5gZjetp7oZyw2 rSgw== 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 v13si445629pfm.83.2018.03.19.18.46.12; Mon, 19 Mar 2018 18:46:26 -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 S936010AbeCST1P (ORCPT + 99 others); Mon, 19 Mar 2018 15:27:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49838 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969618AbeCSSYM (ORCPT ); Mon, 19 Mar 2018 14:24:12 -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 77656F72; Mon, 19 Mar 2018 18:24:11 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Laurent Pinchart , Sasha Levin Subject: [PATCH 4.9 104/241] drm: rcar-du: Handle event when disabling CRTCs Date: Mon, 19 Mar 2018 19:06:09 +0100 Message-Id: <20180319180755.502874239@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: Laurent Pinchart [ Upstream commit 6dd47cfd03a058d08b8caffb06194aa0eb109cf1 ] The driver currently handles vblank events only when updating planes on a CRTC. The atomic update API however allows requesting an event when disabling a CRTC. This currently leads to event objects being leaked in the kernel and to events not being sent out. Fix it. Signed-off-by: Laurent Pinchart Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -512,6 +512,13 @@ static void rcar_du_crtc_disable(struct rcar_du_crtc_stop(rcrtc); rcar_du_crtc_put(rcrtc); + spin_lock_irq(&crtc->dev->event_lock); + if (crtc->state->event) { + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event = NULL; + } + spin_unlock_irq(&crtc->dev->event_lock); + rcrtc->outputs = 0; }