From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3C83D530 for ; Fri, 17 Jan 2025 15:32:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737127955; cv=none; b=SHjzCeCP63DuPDNsjII5eMnWUuHgdZhsLrH25C8fWgs6XaPK/lZdsVP/eGsDWE7nJP5Hq44JYtvNSgtNEhC0ZqN15DMxFVI3R80B8dkQ3Phweeu3o86vTzAsOn7lVEB/ZHFhoKEl8b/wPliV4TdSJfxZYk80LZw8TQE3zXaJl8U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737127955; c=relaxed/simple; bh=lSs4ECQ3KnGvHn8dDK/4/csi2okW02I8/eyqwqw3o7A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F8Z4/lZwWMP7GrYVEv4DKf0HD//1/Y5txwWGhCrIrup3rN3trPAMuS3O8CLj7r4iYtYjoHJcA5R2DllYvfHy+5CFBx6i5e2iLpymunTeyonRtkcJkeaaEPkDDT1OktQyyEDXvWRN34XMaUzdG0LfCi4YUocoiZNgP1kaPtkB1X8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=dAVhiVFD; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="dAVhiVFD" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-43622267b2eso21656515e9.0 for ; Fri, 17 Jan 2025 07:32:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1737127952; x=1737732752; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=CLtid1KPVrGYwJ7kfvjV+78wV9BUg8gs9TwIXAHLQc8=; b=dAVhiVFDusKR10bSUDex7Ii7tFJ16Z5h/Lu4M7b93nYvoSNlK1mt7jtf+fCMATI5c4 FBD1xcxWhkUGWsEHgZcqkod2yFjwne3teKOFCCo/D8UOqA5GFMAYdhN6PYEFcV47cQgy hv1OcXL2gnd5/RL9ssM407GXHv7uAcoD39eZs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737127952; x=1737732752; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CLtid1KPVrGYwJ7kfvjV+78wV9BUg8gs9TwIXAHLQc8=; b=j2/UXNRnrOffzPpKSvICtwUPaRD5wj+41zAo7//jnS8EdPn9iQESV0c03ttYxs/Sue 5cVZuKKvw7M9B0fNwXzE6Pl/h1zXh3e7/3SK149DIWsiDoAhUEfdYpsc01GbLA34AorI ScEBOaIpKDG5oB06HH2s9B+I0sOvD6E5MK0vrakUxq3RTpfP1Wet5MiFNLF7rrGt0Du1 E6WFhHdrj5lj9gPMmmmuWLOuYLzHPJVPkHfBCcOwZNerhFDxF0n+MtLtXHDRFNRagmjs b1KoZeFZubVWWJ3TjQdSxqczqwRh6KZmIiLsJ3aisGoTxg/klG+Fmfx2wuRFCrnbbzga lE6A== X-Forwarded-Encrypted: i=1; AJvYcCUGCaaiXtazTp2gd5UhixEZ4lndO+Qvb1Yfvubi2brO6x3Dr4tBR129D+xCxNS/bAu1ZFESMJe/xpjzA7o=@vger.kernel.org X-Gm-Message-State: AOJu0YzFjys/hJghIf/vmLY8nTA51d28aMtEq7rVOCdz6CWw8dJ2M5pv sgxlJjR2fsZldco8h/ZFjbKM+Sl3Ng0Li2q9gC107jfmJIoWcEC/SRab3+wvZ14= X-Gm-Gg: ASbGncsGcnJNJHovDMmA8+Uj2df/7D9whbebHtW5HeCgkxAAbrCXnlmKJuYMIWde4I0 RwpBSJoVMv6i+CcC8HV4FD7VkFC+USNfkMisk4cpABb+axQjLQuXq7QrzvBeMjf+im3FDx9HFQT T9UTlAAB9tVW+QvL4YiwTd9vuTvPQoFyTDftfSzDDfMggeFMlQ0rAOGiK7ag2s2sTqbccVhFI2T nguB0yFWwjnMelwo+M8QDUw6YQmE6yTpyOkmLLRiqJXE4I9wzj4kdbENQBKlV6/XAdO X-Google-Smtp-Source: AGHT+IFFCya1TW4qLTsQ1TT0n6Roc+hx7woOI2zQH26F+AVFUypMOSS9PWHiwyzXMtCfuJfVXwTDEg== X-Received: by 2002:a05:600c:c84:b0:434:a684:9b1 with SMTP id 5b1f17b1804b1-438913c0207mr32798295e9.4.1737127952009; Fri, 17 Jan 2025 07:32:32 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:5485:d4b2:c087:b497]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf327ded8sm2731464f8f.89.2025.01.17.07.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 07:32:31 -0800 (PST) Date: Fri, 17 Jan 2025 16:32:29 +0100 From: Simona Vetter To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 22/29] drm/bridge: Rename atomic hooks parameters to drop old prefix Message-ID: Mail-Followup-To: Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Douglas Anderson , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20250115-bridge-connector-v1-0-9a2fecd886a6@kernel.org> <20250115-bridge-connector-v1-22-9a2fecd886a6@kernel.org> <20250117-magpie-of-unreal-pride-efb244@houat> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250117-magpie-of-unreal-pride-efb244@houat> X-Operating-System: Linux phenom 6.12.3-amd64 On Fri, Jan 17, 2025 at 03:50:09PM +0100, Maxime Ripard wrote: > On Thu, Jan 16, 2025 at 12:34:12PM +0100, Simona Vetter wrote: > > On Wed, Jan 15, 2025 at 10:05:29PM +0100, Maxime Ripard wrote: > > > All the bridge atomic hooks were using the old_bridge_state name for > > > their drm_bridge_state parameter. However, this state is the current > > > state being committed for all of them, which ends up being confusing. > > > > > > Let's rename it to bridge_state for all of them. > > > > > > Signed-off-by: Maxime Ripard > > > --- > > > include/drm/drm_bridge.h | 8 ++++---- > > > 1 file changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h > > > index 4b84faf14e368310dd20aa964e8178ec80aa6fa7..8e18130be8bb85fc2463917dde9bf1d281934184 100644 > > > --- a/include/drm/drm_bridge.h > > > +++ b/include/drm/drm_bridge.h > > > @@ -303,11 +303,11 @@ struct drm_bridge_funcs { > > > * there is one) when this callback is called. > > > * > > > * The @atomic_pre_enable callback is optional. > > > */ > > > void (*atomic_pre_enable)(struct drm_bridge *bridge, > > > - struct drm_bridge_state *old_bridge_state); > > > + struct drm_bridge_state *bridge_state); > > > > > > /** > > > * @atomic_enable: > > > * > > > * This callback should enable the bridge. It is called right after > > > @@ -323,11 +323,11 @@ struct drm_bridge_funcs { > > > * chain if there is one. > > > * > > > * The @atomic_enable callback is optional. > > > */ > > > void (*atomic_enable)(struct drm_bridge *bridge, > > > - struct drm_bridge_state *old_bridge_state); > > > + struct drm_bridge_state *bridge_state); > > > > Checked this one, and it very clearly passes the old state. > > Urgh, you're right > > > Because the new state you can get by looking at bridge->state. > > Bridge->state doesn't exist though. Yeah it's defacto your helper to go find the private object, deref the ->state pointer in there and then cast to the right type. But that again has a bit the locking issue since sometimes you must hold the modeset lock, sometimes not. If we instead always go through the drm_atomic_state lookup then we can require the modeset lock in the other helper for the bridge -> bridge_state lookup, and things become much harder for drivers to get wrong. > > So this looks very wrong. > > > > If you want to fully update the pattern, pass the drm_atomic_state > > instead, and let callbacks lookup any additional states they use as > > needed. > > Yeah, that's probably the best option. I think I still have the > coccinelle scripts I used for the others somewhere. Yeah cocci would help here. -Sima -- Simona Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch