From patchwork Fri Apr 7 16:48:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9669933 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 69A7660364 for ; Fri, 7 Apr 2017 16:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BFFB2818B for ; Fri, 7 Apr 2017 16:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F734285EE; Fri, 7 Apr 2017 16:48:26 +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 DB7632818B for ; Fri, 7 Apr 2017 16:48:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 693486EC4B; Fri, 7 Apr 2017 16:48:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 698D26EC4B for ; Fri, 7 Apr 2017 16:48:24 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id x75so2335292wma.1 for ; Fri, 07 Apr 2017 09:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=Lw9DrL51BqGLvF0gdbls0Jqrf46UePdzzs+Rluj8CCY=; b=APFnCXp6bjpgUJHd+GUDLt5PAJFTJHNsO3IVKPmzydvVE60tWqo9oN4+K2lnB4MvN1 BT4eMbJ/bfIRkZ/+Bil2odUUwJYv5qdZpRV8N3ml5b5gaNvzRSbhVXpaBRCrac1U6Jtj sb476sLdJGFUHU7qBVwqhUpu8rFo8LSnrqrvI= 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=Lw9DrL51BqGLvF0gdbls0Jqrf46UePdzzs+Rluj8CCY=; b=k/jO46PI4WqcdvuV5x41qi/XdVqFPjhSpn+r37BNK+MWAI1RIxOYLtWhYWYwKrqy5K 8d+7L1044xf5e04bTUsT5ncdLkXV4qolhVfJzkOcNcD+2Sr787LDNG8LnL+aQqITE3PD sPhYUkfmKuYHv+gttxgk0Nr7FuPoAuwQY40PuNwsIAu1bcru6YZeBKghZ4MtKWvKVaRw xOYyInFdguXrUx+slSUq8zbOpRKLnbDCiEBB+hhKl0RDNaCpVSVWMMYX7/bTNUp8XW2W iSH0sV1MfmEAWxYQna6W2XuDZEHKNyzFDZ/TUY9hlinbD2chMrJTCPOZoX80clPc3rzT yixg== X-Gm-Message-State: AN3rC/7zrRboq9tZaMNx/mWLBuLQfZuBje0KZiaZ2zSRqH05yS+8jqjZhhwT7rAi1cDW0g== X-Received: by 10.28.151.81 with SMTP id z78mr249426wmd.95.1491583702966; Fri, 07 Apr 2017 09:48:22 -0700 (PDT) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id l14sm6644504wre.23.2017.04.07.09.48.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Apr 2017 09:48:22 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 7 Apr 2017 18:48:17 +0200 Message-Id: <20170407164817.28272-1-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 Cc: Tony Lindgren , Daniel Vetter , DRI Development , David Airlie , Daniel Vetter , Harry Wentland Subject: [Intel-gfx] [PATCH] drm: Only take cursor locks when the cursor plane exists X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP I thought I've fixed this, but maybe not. Anyway, clearly broken, and easy fix. Cc: Tony Lindgren Reported-by: Tony Lindgren Fixes: b95ff0319a82 ("drm: Remove drm_modeset_(un)lock_crtc") Cc: Harry Wentland Cc: Maarten Lankhorst Cc: Daniel Vetter Cc: Jani Nikula Cc: Sean Paul Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter Tested-by: Tony Lindgren Reviewed-by: Daniel Stone --- drivers/gpu/drm/drm_plane.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index 838ca742a28b..fedd4d60d9cd 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -720,15 +720,15 @@ static int drm_mode_cursor_common(struct drm_device *dev, ret = drm_modeset_lock(&crtc->mutex, &ctx); if (ret) goto out; - ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx); - if (ret) - goto out; - /* * If this crtc has a universal cursor plane, call that plane's update * handler rather than using legacy cursor handlers. */ if (crtc->cursor) { + ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx); + if (ret) + goto out; + ret = drm_mode_cursor_universal(crtc, req, file_priv, &ctx); goto out; }