From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH] drm/i915: Use chipset-specific irq installers Date: Tue, 28 Jun 2011 19:01:07 +0100 Message-ID: <1309284064_35257@CP5-2952> References: <1309258131-19869-1-git-send-email-chris@chris-wilson.co.uk> <20110628174857.GA3022@snipes.kumite> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (server109-228-6-236.live-servers.net [109.228.6.236]) by gabe.freedesktop.org (Postfix) with ESMTP id 802F89EFFC for ; Tue, 28 Jun 2011 11:01:10 -0700 (PDT) In-Reply-To: <20110628174857.GA3022@snipes.kumite> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Tue, 28 Jun 2011 10:48:57 -0700, Ben Widawsky wrote: > I'm not totally thrilled with the name. It would make more sense to me > if you had something like: > if (!is_irq_enabled(ring)) { > DRM_ERROR(...); > dev->driver->irq_preinstall(ring->dev); > dev->driver->irq_postinstall(ring->dev); > } > > This allows allows for error checking at other points without changing > state. > > I'm very nitpicky when it comes to the work assert :p *g* I was just following the idiom Jesse started with his assert_plane_enabled() and friends. :) You're right that expressed as a predicate function with a separate fixup routine this would be more useful, but more so is idiomatic programming... Feel free to supplement the code with more error checking! :) -Chris -- Chris Wilson, Intel Open Source Technology Centre