From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 1/2] drm/i915: make CRTC enable/disable asynchronous v2 Date: Fri, 30 May 2014 12:06:47 -0700 Message-ID: <20140530120647.0640b411@jbarnes-desktop> References: <1401473122-3451-1-git-send-email-jbarnes@virtuousgeek.org> <20140530185622.GE10916@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 128196EB31 for ; Fri, 30 May 2014 12:06:28 -0700 (PDT) Received: by mail-pd0-f171.google.com with SMTP id y13so1248511pdi.2 for ; Fri, 30 May 2014 12:06:28 -0700 (PDT) In-Reply-To: <20140530185622.GE10916@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, 30 May 2014 19:56:22 +0100 Chris Wilson wrote: > On Fri, May 30, 2014 at 11:05:21AM -0700, Jesse Barnes wrote: > > +static void intel_queue_crtc_enable(struct drm_crtc *crtc) > > +{ > > + struct drm_device *dev = crtc->dev; > > + struct drm_i915_private *dev_priv = dev->dev_private; > > + struct intel_crtc *intel_crtc = to_intel_crtc(crtc); > > + struct intel_crtc_work *work; > > + > > + WARN(!mutex_is_locked(&dev->mode_config.mutex), > > + "need mode_config mutex\n"); > > + > > + work = kmalloc(sizeof(*work), GFP_KERNEL); > > + if (!work) { > > + dev_priv->display._crtc_disable(&intel_crtc->base); > > + return; > > + } > > + > > + work->enable = true; > > + work->intel_crtc = intel_crtc; > > + INIT_LIST_HEAD(&work->head); > (redundant, list_add doesn't care) Will fix. > > + > > + list_add_tail(&dev_priv->crtc_work_queue, &work->head); > > + schedule_work(&dev_priv->crtc_work); > > +} > > If we tracked one queued item per crtc, we could avoid the allocation > and allow for elision of pending operations. Yeah I thought about that too, might make for a good optimization, but I figured this was simplest to start with. -- Jesse Barnes, Intel Open Source Technology Center