From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH v2 07/16] drm/i915: Add vblank based delayed watermark update mechanism Date: Wed, 4 Jun 2014 18:10:44 +0200 Message-ID: <20140604161044.GN7416@phenom.ffwll.local> References: <1400770101-14277-1-git-send-email-ville.syrjala@linux.intel.com> <1400770101-14277-8-git-send-email-ville.syrjala@linux.intel.com> <20140603193229.GY27580@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com [209.85.212.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 779D16E067 for ; Wed, 4 Jun 2014 09:10:52 -0700 (PDT) Received: by mail-wi0-f177.google.com with SMTP id f8so1760698wiw.16 for ; Wed, 04 Jun 2014 09:10:49 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Paulo Zanoni Cc: Intel Graphics Development List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 04, 2014 at 11:01:01AM -0300, Paulo Zanoni wrote: > > This function is only called at init/resume. It populates the software > > state with something that matches the current hardware state. I guess > > a comment explaning the purpose of the function is the best we can do > > here, or do you have a better idea? > > The problem is that we can use the get_hw_state functions not only to > check driver state a init/resume, but also to do state tracking > assertions at certain points of the code. Since most (all?) the other > HW state readout functions don't have side-effects, there's a > possibility that someone may add code to do HW state assertion at some > points, and just call these things without realizing the potential > side effects. A comment would help, but moving the assignment to > another place would also solve the problem for me. You choose. We already do that in other places, e.g. the edp bit depth hacks we have. But a comment might be justified. I haven't looked at the details here, just a high-level comment that we do play such ugly tricks already. And I agree that it's unexpected. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch