From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/i915: make backlight functions take a connector v3 Date: Fri, 11 Oct 2013 23:31:10 +0200 Message-ID: <20131011213110.GJ8303@phenom.ffwll.local> References: <1381516314-6007-1-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ee0-f45.google.com (mail-ee0-f45.google.com [74.125.83.45]) by gabe.freedesktop.org (Postfix) with ESMTP id CB211E6E01 for ; Fri, 11 Oct 2013 14:30:50 -0700 (PDT) Received: by mail-ee0-f45.google.com with SMTP id c50so2175281eek.18 for ; Fri, 11 Oct 2013 14:30:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1381516314-6007-1-git-send-email-jbarnes@virtuousgeek.org> 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: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Oct 11, 2013 at 11:31:53AM -0700, Jesse Barnes wrote: [snip] > static int intel_panel_get_brightness(struct backlight_device *bd) > { > - struct drm_device *dev = bl_get_data(bd); > - return intel_panel_get_backlight(dev); > + struct intel_connector *connector = bl_get_data(bd); > + struct drm_device *dev = connector->base.dev; > + enum pipe pipe; > + int ret = 0; > + > + mutex_lock(&dev->mode_config.mutex); > + pipe = intel_get_pipe_from_connector(connector); > + mutex_unlock(&dev->mode_config.mutex); > + if (pipe == INVALID_PIPE) { > + ret = 0; > + goto out_unlock; > + } > + > + ret = intel_panel_get_backlight(connector->base.dev, pipe); > +out_unlock: > + mutex_unlock(&dev->mode_config.mutex); I see mutex_unlock(&dev->mode_config.mutex) twice here. I think you've just volunteered yourselve for some testcases ;-) Ideas: - Make sure all lvds/edp connectors are enabled and bash on all backlight interfaces (with igt_fork it's easy to do that concurrently). - Race the above with output changes: dpms on/off and changing the crtc around. - Race the above with system suspend for bonus points (can be completely stitched together from igt helpers). Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch