Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp623862yba; Thu, 16 May 2019 06:31:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr/1PNGJGsGH0/3+bOX0kuboSqMKesOvVwX/L3AwTQFlvF8QRyqdqX8nLzCMxMFrZdOdqv X-Received: by 2002:a62:6341:: with SMTP id x62mr53199771pfb.63.1558013465423; Thu, 16 May 2019 06:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558013465; cv=none; d=google.com; s=arc-20160816; b=0wMawWdHOZT1eM1R+ED/DzSKmJHq60bPdqn0G6VQbP29P1pWQbaBlXB3ly54KEspMU ZEPkAg258DpUmRInUj5SsaDMGNnzstUn2M/GW/BpTBIzlzobaMDWbAiX95iIuecKmtEf z+WoMSftYMy/OqQEK3zxfxylT2yQ1lujXJJ7n7OD1YyzUHgzPlU2sXKS+qllJeUqh7fT /A334XXQJjBWpPji54rDfFySims03OmNab8fCQa6z5Xoi0tdW/Zn4QVDNbCnRAkuzdy9 zbWNMpSBrl6942CILT7Y81tIjLugYghdAgkzkqr+i7odGpQ80+sTq8YsjD7W7QV0VGFh Oanw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=NVow9TeoP0LnylXROsRkPRgOyFjzSwceMZOs0zGIKDo=; b=CJ2DF+rTJT/+wMkg7zIVuIRYxLYvG8zqsrXLIHwbCr68rS0wTEitOPvx5OKRTyfzEQ 9aEe8heuSTxY2mdms7VJT4isdm/0aPn1IDYIni/YbzK/evK+mnVx5YT0OgPC5lOHj8qo 2HxJZZwtYdCOkwPzVJEnJXjkVN2e5YMVkPT5ybfa9C+pvOn7qog0Bj+qDg63+l6G3jnV vLf6cN8dqkzRTDJD8DGXhZ18DLrqqq+q4rJ9uc6COcPRp5+ZeA3wLFsr7ZrItOJCKBTO oTcjsIgn1ytVk2a1b6sii8KsZcAcIGmiUyW65k83TVlWs08p2LpTH12loqkqkjbazvjS 5VRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si4804673pgw.133.2019.05.16.06.30.49; Thu, 16 May 2019 06:31:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727631AbfEPN2N (ORCPT + 99 others); Thu, 16 May 2019 09:28:13 -0400 Received: from mga04.intel.com ([192.55.52.120]:12658 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727584AbfEPN2K (ORCPT ); Thu, 16 May 2019 09:28:10 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 May 2019 06:28:09 -0700 X-ExtLoop1: 1 Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga007.fm.intel.com with SMTP; 16 May 2019 06:28:04 -0700 Received: by stinkbox (sSMTP sendmail emulation); Thu, 16 May 2019 16:28:03 +0300 Date: Thu, 16 May 2019 16:28:03 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Daniel Vetter Cc: Laurent Pinchart , Sean Paul , dri-devel , Sean Paul , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Ben Skeggs , Kieran Bingham , Eric Anholt , Maarten Lankhorst , Maxime Ripard , David Airlie , Linux Kernel Mailing List , intel-gfx , Nouveau Dev , "open list:DRM DRIVERS FOR RENESAS" Subject: Re: [PATCH v3 04/10] drm: Convert connector_helper_funcs->atomic_check to accept drm_atomic_state Message-ID: <20190516132803.GM24299@intel.com> References: <20190502194956.218441-1-sean@poorly.run> <20190502194956.218441-5-sean@poorly.run> <20190511191202.GL13043@pendragon.ideasonboard.com> <20190513144747.GR17751@phenom.ffwll.local> <20190516120221.GI14820@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 16, 2019 at 02:07:34PM +0200, Daniel Vetter wrote: > On Thu, May 16, 2019 at 2:02 PM Laurent Pinchart > wrote: > > > > Hi Daniel, > > > > On Mon, May 13, 2019 at 04:47:47PM +0200, Daniel Vetter wrote: > > > On Sat, May 11, 2019 at 10:12:02PM +0300, Laurent Pinchart wrote: > > > > On Thu, May 02, 2019 at 03:49:46PM -0400, Sean Paul wrote: > > > >> From: Sean Paul > > > >> > > > >> Everyone who implements connector_helper_funcs->atomic_check reaches > > > >> into the connector state to get the atomic state. Instead of continuing > > > >> this pattern, change the callback signature to just give atomic state > > > >> and let the driver determine what it does and does not need from it. > > > >> > > > >> Eventually all atomic functions should do this, but that's just too much > > > >> busy work for me. > > > > > > > > Given that drivers also access the connector state, isn't this slightly > > > > more inefficient ? > > > > > > It's atomic code, we're trying to optimize for clean code at the expense > > > of a bit of runtime overhead due to more pointer chasing. And I agree with > > > the general push, the pile of old/new_state pointers of various objects > > > we're passing around is confusing. Passing the overall drm_atomic_state > > > seems much more reasonable, and with that we can get everything else. Plus > > > it's much more obvious whether you have the old/new state (since that's > > > explicit when you look it up from the drm_atomic_state). > > > > Yes, I agree it's cleaner. I just hope the atomic state tracking cost > > can be kept under control :-) > > > > By the way, this is likely not going to happen as it would be way too > > intrusive, but it would be nice to rename drm_atomic_state to > > drm_atomic_transaction (or something similar). It doesn't model a state, > > but a change between an old state to a new state. This confused me in > > the past, and I'm sure it can still be confusing to newcomers. > > Why are you the first to suggest this, this is awesome! Can't quite tell if that's irony or not. Anyways, this has been suggested before but no volunteers stepped forward. > drm_atomic_state is indeed not a state, but a transaction representing > how we go from the old to the new state. On a semi-related topic, I've occasionally pondered about moving mode_changed & co. from the obj states to the top level state/transaction (maybe stored as a bitmask). But that would definitely not be a trivial sed job. -- Ville Syrj?l? Intel