From patchwork Thu Jul 26 18:49:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 1245171 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 83A063FC33 for ; Thu, 26 Jul 2012 20:39:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 493869E9D9 for ; Thu, 26 Jul 2012 13:39:26 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 4719F9ED88 for ; Thu, 26 Jul 2012 12:57:15 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id dr1so1724773wgb.12 for ; Thu, 26 Jul 2012 12:57:15 -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:x-mailer:in-reply-to:references; bh=QowzUoohHKlHgTRoKHivdA1x6D99QVFGkppZathZFvQ=; b=C70aiNEnBKKdjw0gKR1ZacR+eTkmiU7bn9a7rONj2ImJyOa/EaRwSM1QE5gPFfXb64 VlBndlw/D/Zs8AeR6mAl29FZvhIYQTvNdqoHuzTZ4eMLLeXIDZPYqXRAel7GHXrBuB8t lcc/XONuBkWJ7qVjfoyTjBt9K0T3oWhZP0VlY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=QowzUoohHKlHgTRoKHivdA1x6D99QVFGkppZathZFvQ=; b=acMYTJZKwV6xkcf4dU2s+MWkcAT8uDm5YWXjHDUoYz6D33ZPIU7US0Fht9RWTv20yS +Txt60lRgZjnfkFiUT608CWUG4LkZYH8kVpgs5QgMw77RYhIZwYmwUP6Km9a4dfjoGZ6 WuhDKVlTIYROygrWT2Y/R4wVIG6Blk9CceMA2tn5aRS45syAbAYQDFT2Pqsl5bwTy+7a hWyDC8cBn3ul9pJOxRHgzEPjBOQONBS7vra+gPQmuJobl+XK9CyH8ydD1JKSduvOIwAl x756egoUfl7d//46KZ6pErMlU2YgYJlHIiDubTemg5/ZrTCJ+nkpoBj04yLrrs0NeYVE JFXg== Received: by 10.216.134.169 with SMTP id s41mr14994546wei.183.1343332634814; Thu, 26 Jul 2012 12:57:14 -0700 (PDT) Received: from wespe.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id fr4sm391403wib.8.2012.07.26.12.57.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 Jul 2012 12:57:14 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Thu, 26 Jul 2012 20:49:14 +0200 Message-Id: <1343328581-2324-50-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> References: <1343328581-2324-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQk0S3uSjbp4vswPratqk/Gf/b9UVMoLEUfBc7i7KJ4TtPtx8HCfVoq2RTI5g87BeWBOENis Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 49/76] drm/i915: convert pointless error checks in set_config to BUGs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Because they all are, the ioctl command never calls us with any of these violated. Also drop a equally pointless empty debug message (and also in set_cursor, while we're at it). With all these changes, intel_crtc_set_config is neatly condensed down to it's essence, the actual modeset code (or fb update calling code) v2: The fb helper code is actually stretching ->set_config semantics a bit, it calls it with set->mode == NULL but set->fb != NULL. Signed-Off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 79748c9..b1a7633 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -5391,8 +5391,6 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, uint32_t addr; int ret; - DRM_DEBUG_KMS("\n"); - /* if we want to turn off the cursor ignore width and height */ if (!handle) { DRM_DEBUG_KMS("cursor off\n"); @@ -6846,16 +6844,9 @@ static int intel_crtc_set_config(struct drm_mode_set *set) int ret; int i; - DRM_DEBUG_KMS("\n"); - - if (!set) - return -EINVAL; - - if (!set->crtc) - return -EINVAL; - - if (!set->crtc->helper_private) - return -EINVAL; + BUG_ON(!set); + BUG_ON(!set->crtc); + BUG_ON(!set->crtc->helper_private); if (!set->mode) set->fb = NULL;