From patchwork Tue Mar 17 11:05:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 45879 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E46B021547 for ; Tue, 17 Mar 2015 11:05:45 +0000 (UTC) Received: by widex7 with SMTP id ex7sf1515434wid.2 for ; Tue, 17 Mar 2015 04:05:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:subject:date :message-id:cc:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=49Zifbo1vCNOp9jaqxZhiNESymU6SkhmJbs283datJA=; b=Od8bAAhDtxxPHoirzpB1GmFUf+YSkfyJ+Q+XVIKxi1Wv5XdtBK/htpLgxAR9KVUTJg GyDZ9fSmbl3LUpUEbS882XkbGB88nj1xvRGzK/wQH2HBQ3lvvXNOylb5vCGQVizd1PjK 3qJKjzDfvMQCQ/dpQaijtni40lJefNx7GVVi6M0NlrlhZW2bbDfntID4PQ8qfZCGH4F7 DzuzdN3hJ+nHi4IQ3QFJ8tgun/Uq73ex7LKokh7P9lVrmG3+d9qQVky73a9cygj1eBTw X7Qp56CNI9fpUi0jB/8usfEZ+ECYHQrRs1ag4Mm2Dzd3dfbtHHK12K91QrwKOMDs21i8 zd0g== X-Gm-Message-State: ALoCoQk8MmHAho2xKb4cyaPbiqsTaPMDf7OkrDm1fT6zg+rh73OcHRqwqYkN49sCExb+L/xYX3yR X-Received: by 10.180.90.169 with SMTP id bx9mr7190517wib.6.1426590345253; Tue, 17 Mar 2015 04:05:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.27.103 with SMTP id s7ls17732lag.105.gmail; Tue, 17 Mar 2015 04:05:44 -0700 (PDT) X-Received: by 10.112.41.236 with SMTP id i12mr31149671lbl.14.1426590344830; Tue, 17 Mar 2015 04:05:44 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id ds4si10268311lac.34.2015.03.17.04.05.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Mar 2015 04:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbzq9 with SMTP id zq9so4247237lbb.0 for ; Tue, 17 Mar 2015 04:05:44 -0700 (PDT) X-Received: by 10.152.43.51 with SMTP id t19mr58536582lal.73.1426590344577; Tue, 17 Mar 2015 04:05:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp428146lbj; Tue, 17 Mar 2015 04:05:43 -0700 (PDT) X-Received: by 10.70.125.162 with SMTP id mr2mr137801629pdb.21.1426590342891; Tue, 17 Mar 2015 04:05:42 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id dm9si28662774pdb.103.2015.03.17.04.05.42; Tue, 17 Mar 2015 04:05:42 -0700 (PDT) Received-SPF: none (google.com: dri-devel-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F34376E1E7; Tue, 17 Mar 2015 04:05:40 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C8C96E1E7 for ; Tue, 17 Mar 2015 04:05:39 -0700 (PDT) Received: by wixw10 with SMTP id w10so44930972wix.0 for ; Tue, 17 Mar 2015 04:05:38 -0700 (PDT) X-Received: by 10.180.95.97 with SMTP id dj1mr129510205wib.43.1426590338421; Tue, 17 Mar 2015 04:05:38 -0700 (PDT) Received: from LMENX321.lme.st.com (LPuteaux-656-1-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id lx10sm19445788wjb.17.2015.03.17.04.05.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2015 04:05:37 -0700 (PDT) From: Benjamin Gaignard To: daniel.vetter@ffwll.ch Subject: [PATCH] drm: check that planes types are correct while initializing CRTC Date: Tue, 17 Mar 2015 12:05:29 +0100 Message-Id: <1426590329-27983-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: linaro-mm-sig@lists.linaro.org, Benjamin Gaignard , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: benjamin.gaignard@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Be warned if primary or cursor planes haven't the correct type Signed-off-by: Benjamin Gaignard --- drivers/gpu/drm/drm_crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 5785336..111849c4 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -659,6 +659,9 @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_mode_config *config = &dev->mode_config; int ret; + WARN_ON(primary && primary->type != DRM_PLANE_TYPE_PRIMARY); + WARN_ON(cursor && cursor->type != DRM_PLANE_TYPE_CURSOR); + crtc->dev = dev; crtc->funcs = funcs; crtc->invert_dimensions = false;