From patchwork Thu Dec 7 03:01:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gurchetan Singh X-Patchwork-Id: 10097581 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 14030602BF for ; Thu, 7 Dec 2017 03:03:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 024152A0CF for ; Thu, 7 Dec 2017 03:03:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9E8F2A0EB; Thu, 7 Dec 2017 03:03:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5BE6C2A0CF for ; Thu, 7 Dec 2017 03:03:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA71F8933C; Thu, 7 Dec 2017 03:02:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 57E706E144 for ; Thu, 7 Dec 2017 03:02:03 +0000 (UTC) Received: by mail-it0-x241.google.com with SMTP id z6so11378886iti.4 for ; Wed, 06 Dec 2017 19:02:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=ONKhPoamHouIK9PbT0SYry8jHfkmUWUxDUlLf4JrLu0=; b=nB0+Ftb6DParPLUNt6MjVcJjGsRgylm8oE2JjtLwL3Uoyu11tNPZ+BbhFxeizu+7ON TSovr6EK9ZJOvShpJPwnArkowhYWXuehi7crXEGeVOTSDuWnjZt2ZWVcxEihC8o4gGEi fpmhgnOXmdy6VOSAYGag8hyG81DvvvXYmILo8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ONKhPoamHouIK9PbT0SYry8jHfkmUWUxDUlLf4JrLu0=; b=h+BlQO7g9tnJBMuqcwshw7rzXyfAegIz2tnke7ObcKnDCxQUwv7NcrJoZj/JBOT7Xj ilLOGgoRveDl+scwJFFrzI9OKwWl4JER82Xj/FWJip0ktu31dbjy67O1DXLjbVO8tsjx YOl09tyqCpajFiQXXfjpEJGuuFER25ZImSGcaBpQyOuqXi0izsP+PMlzMXOkyPSFF3Hc X1DX+Z5zeA8G3tA+CekhlV0kwYWXWTDCTIlyMXF5Mq1ZAOBZuSEua3greEPea4GQEBY/ 0yP1+uGspJ0RK7BGv2nR/fr2QpymWbav58jWMojWUzSxGso4RZ6gV3hvzZYd+c2/RQTq qrpw== X-Gm-Message-State: AKGB3mIEWnv/DCKG1zio5BLlKjtIHn8YGQV3F8Xl59glB3Uc8pI/i938 /8mhKF8oZTeuO7saHOELdz282jeE9hU= X-Google-Smtp-Source: AGs4zMYJ1c5waGaQhLe1uP/yBOUykoc46mqWezaNkeWtcgia2Gutmm0w742LA6q/q2BeQi9sRDNAfA== X-Received: by 10.36.101.140 with SMTP id u134mr24760973itb.108.1512615722356; Wed, 06 Dec 2017 19:02:02 -0800 (PST) Received: from gurchetansingh0.mtv.corp.google.com ([2620:0:1000:1600:7073:55d4:f7c8:dd60]) by smtp.gmail.com with ESMTPSA id j204sm2281800itj.16.2017.12.06.19.02.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Dec 2017 19:02:01 -0800 (PST) From: Gurchetan Singh To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: clean up internally created framebuffer on CRTC disable Date: Wed, 6 Dec 2017 19:01:59 -0800 Message-Id: <20171207030159.3007-1-gurchetansingh@chromium.org> X-Mailer: git-send-email 2.13.5 Cc: Gurchetan Singh , laurent.pinchart@ideasonboard.com, daniel.vetter@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP When a CRTC is disabled and we used an internally created framebuffer, this patch disables the cursor plane and drops the reference that was introduced when we called drm_internal_framebuffer_create. Signed-off-by: Gurchetan Singh --- drivers/gpu/drm/drm_crtc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index f0556e654116..d732cca4879f 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -101,12 +101,19 @@ EXPORT_SYMBOL(drm_crtc_from_index); */ int drm_crtc_force_disable(struct drm_crtc *crtc) { + struct drm_framebuffer *fb; struct drm_mode_set set = { .crtc = crtc, }; WARN_ON(drm_drv_uses_atomic_modeset(crtc->dev)); + if (crtc->cursor && crtc->cursor->fb && crtc->cursor->fb->internal) { + fb = crtc->cursor->fb; + drm_plane_force_disable(crtc->cursor); + drm_framebuffer_unreference(fb); + } + return drm_mode_set_config_internal(&set); } EXPORT_SYMBOL(drm_crtc_force_disable);