From patchwork Tue Dec 16 16:53:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 5502041 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 805829F1D4 for ; Tue, 16 Dec 2014 16:53:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACD9720A23 for ; Tue, 16 Dec 2014 16:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D603520A1C for ; Tue, 16 Dec 2014 16:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751027AbaLPQxl (ORCPT ); Tue, 16 Dec 2014 11:53:41 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:42341 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbaLPQxk (ORCPT ); Tue, 16 Dec 2014 11:53:40 -0500 Received: by mail-pd0-f175.google.com with SMTP id g10so12279170pdj.34 for ; Tue, 16 Dec 2014 08:53:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JLxPH1yKcEJxsdOCmVJdrzcTzFvYbuBSdvhCY9zff4Y=; b=zaMc71ggzuHPR29Cm4rlcj5kzHrGeB1n5iH2NAMpXtjHSTGiRpdzYx3CV0ktYeqH/I Mr8tDIrn+I08KUnB+v2E0hrmFrpVHXlvF7+TYfB2Pm4nXjYn1g4uSwdMZKOK1sit8Bfs +u7w8URDc04oZLmj7HsZajrsaw6tZ+uvSORcIv9QqpnXWkJlTryYj+OiGWybBApc+Rhx fwxk3YKiHKTyy2VqurrFCsw7GqKY8bFcdcEOoyP3w1EhF+ruD4rdo7s9f9jxzpAnolJ/ OQ7pgfxEQ4Nyu01b5okJA7sA1FK8fvWeJIwK3+G797L0nN6X7xo61YetA5AMg9O+HAyd jodw== X-Received: by 10.67.6.233 with SMTP id cx9mr61921148pad.110.1418748820129; Tue, 16 Dec 2014 08:53:40 -0800 (PST) Received: from localhost ([216.228.120.20]) by mx.google.com with ESMTPSA id sx4sm1473670pbc.36.2014.12.16.08.53.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Dec 2014 08:53:39 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Cc: Daniel Vetter , Inki Dae , Philipp Zabel , Gerd Hoffmann , Mark Yao , Benjamin Gaignard , linux-samsung-soc@vger.kernel.org Subject: [PATCH 01/13] drm/irq: Remove negative CRTC index special-case Date: Tue, 16 Dec 2014 17:53:23 +0100 Message-Id: <1418748815-15434-1-git-send-email-thierry.reding@gmail.com> X-Mailer: git-send-email 2.1.3 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding The drm_send_vblank_event() function treats negative CRTC indices as meaning that a driver doesn't have proper VBLANK handling. This is the only place where DRM needs negative CRTC indices, so in order to enable subsequent cleanup, remove this special case and replace it by the more obvious check for whether or not VBLANK support was initialized. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 75647e7f012b..a24658162284 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c @@ -934,7 +934,7 @@ void drm_send_vblank_event(struct drm_device *dev, int crtc, struct timeval now; unsigned int seq; - if (crtc >= 0) { + if (dev->num_crtcs > 0) { seq = drm_vblank_count_and_time(dev, crtc, &now); } else { seq = 0;