From patchwork Tue Jan 3 09:20:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neil Armstrong X-Patchwork-Id: 9494671 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 944C960414 for ; Tue, 3 Jan 2017 09:21:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FC5E20246 for ; Tue, 3 Jan 2017 09:21:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83A0626C9B; Tue, 3 Jan 2017 09:21:12 +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 D762B20246 for ; Tue, 3 Jan 2017 09:21:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CB1E06E0AD; Tue, 3 Jan 2017 09:21:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wj0-x22d.google.com (mail-wj0-x22d.google.com [IPv6:2a00:1450:400c:c01::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 91BC36E0AD for ; Tue, 3 Jan 2017 09:21:01 +0000 (UTC) Received: by mail-wj0-x22d.google.com with SMTP id c11so235327206wjx.3 for ; Tue, 03 Jan 2017 01:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=INcQ07h4j7uycA87cFhiqh7dpuITcv7W+wbHaF7olZk=; b=skrt7PqvLF9kE1j338FStpPHCSehG24fIBxM3u40gBKvbtaH5mK8SwpIoTzFxvact4 ilipuhLzShinvfnO+oh5n6AqIbrmyHBk68N2I3P6zYZelBgS602yptMGdAFCnocrSqgN kf5m8SeJFe6gbSRTufu6XvhG+2VBYXXbUt2WdjOjPTeb0U4sFPz4Cc+Rom6MWz41ay/E X8ah4Ctuc/MZdwfoPkPV1z+pGXX+qrutRstupNl8diPkuI/e4lOLlu+pXaQ3Wsvl2nYG UMiKIM3Y8VmFCT54au7v5/JdkvhOhmTtRl7EFyoOcEdpde8FHB2UzCohwb0l0d5hSv2w Omeg== 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=INcQ07h4j7uycA87cFhiqh7dpuITcv7W+wbHaF7olZk=; b=si3QZUTxRQFgG/lhBMXRpHO/1yEiG+20fLS93/puuy2tyoHqjOYsJOWEdyYU1HJZeN Rj2hVQ7r2+FedrN3wqlCabL+vegmwqcwXeOPcZ2nOlQF5ZF81X+qdwtSFf4adXXLecW0 8h1hjTBHk7LzE0OydjMho/663/XUm+0JyGS1JG+XsnWwRdleSzImjPGD5ZpWxOwBrH5X NolrcXvT5OS+bPI8w1TX4zSuiLBHx+BDIHS7GhXkQX29D65iJsjgVpO8NO1GltY2K22e 9x+qkAIVGVgt0L29Eka2uN85h2Oqa3pDkU0lEl9AfSbjvgTuGNppV67kAZhtkrdqw7Qm c7uA== X-Gm-Message-State: AIkVDXLVXGs8KetLQpRGZY++o0izo1F09buaoXjiEuff7IxMsMhR+/JYuSltiq620jUypfoH X-Received: by 10.194.119.105 with SMTP id kt9mr46002734wjb.159.1483435259703; Tue, 03 Jan 2017 01:20:59 -0800 (PST) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id i15sm91753419wjs.16.2017.01.03.01.20.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jan 2017 01:20:59 -0800 (PST) From: Neil Armstrong To: airlied@linux.ie Subject: [PATCH] drm/meson: Fix plane atomic check when no crtc for the plane Date: Tue, 3 Jan 2017 10:20:54 +0100 Message-Id: <1483435254-27955-1-git-send-email-narmstrong@baylibre.com> X-Mailer: git-send-email 1.9.1 Cc: linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, Neil Armstrong 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 no CRTC is associated with the plane, the meson_plane_atomic_check() call breaks the kernel with an Oops. Fixes: bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Neil Armstrong --- drivers/gpu/drm/meson/meson_plane.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/meson/meson_plane.c b/drivers/gpu/drm/meson/meson_plane.c index 4942ca0..7890e30 100644 --- a/drivers/gpu/drm/meson/meson_plane.c +++ b/drivers/gpu/drm/meson/meson_plane.c @@ -51,6 +51,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_crtc_state *crtc_state; struct drm_rect clip = { 0, }; + if (!state->crtc) + return 0; + crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc); if (IS_ERR(crtc_state)) return PTR_ERR(crtc_state);