From: Jesse Barnes Subject: New async patch for resume Date: Thu, 5 Jun 2014 08:48:37 -0700 Message-ID: <1401983318-6347-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 gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by gabe.freedesktop.org (Postfix) with SMTP id DC86A6E976 for ; Thu, 5 Jun 2014 09:05:53 -0700 (PDT) Received: from [67.161.37.189] (port=55107 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.82) (envelope-from ) id 1WsZuI-0002jU-95 for intel-gfx@lists.freedesktop.org; Thu, 05 Jun 2014 09:48:46 -0600 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org In digging into the async crtc stuff, I found it was going to be really difficult to prevent other functions from getting clobbered by a delayed crtc enable or disable. Daniel's work to remove a bunch of the ->mode_set callbacks is a good start, but we still end up doing some reg reads and writes in the mode set path today. Until those are cleared up and we somehow enforce a rule that all hw changes go through the crtc enable/disable paths with everything else staged in multithread safe structs, I don't think the async crtc approach will be solid. So, since resume is the biggest issue here anyway, I've tried making just the resume mode set asynchronous. Even this is a bit tricky, since we need to apply any pending mode set at certain points, then check whether the crtc we're operating on in any given path is still active. I think I've caught those cases here, but if we have more we can use the intel_sync_mode_set() call with appropriate post-call checks (after we re-acquire the corresponding crtc mutex). Feedback welcome. This has seen light testing on my BYT and really reduces the time spend in the i915 _thaw function, letting userspace start running much sooner than before. Thanks, Jesse