From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87174C33CAA for ; Thu, 23 Jan 2020 07:37:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BF9624125 for ; Thu, 23 Jan 2020 07:37:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725785AbgAWHhX (ORCPT ); Thu, 23 Jan 2020 02:37:23 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:42160 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbgAWHhX (ORCPT ); Thu, 23 Jan 2020 02:37:23 -0500 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 74F1A28CE86; Thu, 23 Jan 2020 07:37:20 +0000 (GMT) Date: Thu, 23 Jan 2020 08:37:17 +0100 From: Boris Brezillon To: dri-devel@lists.freedesktop.org Cc: Lucas Stach , Chris Healy , Andrey Smirnov , Nikita Yushchenko , kernel@collabora.com, Daniel Vetter , Thierry Reding , Sam Ravnborg , Philipp Zabel , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Rob Herring , Mark Rutland , devicetree@vger.kernel.org Subject: Re: [PATCH v7 01/12] drm/bridge: Add a drm_bridge_state object Message-ID: <20200123083717.1264d9b4@collabora.com> In-Reply-To: <20200122111700.1924960-2-boris.brezillon@collabora.com> References: <20200122111700.1924960-1-boris.brezillon@collabora.com> <20200122111700.1924960-2-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, 22 Jan 2020 12:16:49 +0100 Boris Brezillon wrote: > + > +/** > + * drm_atomic_get_bridge_state - get bridge state > + * @state: global atomic state object > + * @bridge: bridge to get state object for > + * > + * This function returns the bridge state for the given bridge, allocating it > + * if needed. It will also grab the relevant bridge lock to make sure that the > + * state is consistent. > + * > + * Returns: > + * > + * Either the allocated state or the error code encoded into the pointer. When > + * the error is EDEADLK then the w/w mutex code has detected a deadlock and the > + * entire atomic sequence must be restarted. > + */ > +struct drm_bridge_state * > +drm_atomic_get_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_private_obj_state(state, &bridge->base); > + if (IS_ERR(obj_state)) > + return ERR_CAST(obj_state); > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_bridge_state); > + > +/** > + * drm_atomic_get_old_bridge_state - get old bridge state, if it exists > + * @state: global atomic state object > + * @bridge: bridge to grab > + * > + * This function returns the old bridge state for the given bridge, or NULL if > + * the bridge is not part of the global atomic state. > + */ > +struct drm_bridge_state * > +drm_atomic_get_old_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_old_private_obj_state(state, &bridge->base); > + if (!obj_state) > + return NULL; > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_old_bridge_state); > + > +/** > + * drm_atomic_get_new_bridge_state - get new bridge state, if it exists > + * @state: global atomic state object > + * @bridge: bridge to grab > + * > + * This function returns the new bridge state for the given bridge, or NULL if > + * the bridge is not part of the global atomic state. > + */ > +struct drm_bridge_state * > +drm_atomic_get_new_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_new_private_obj_state(state, &bridge->base); > + if (!obj_state) > + return NULL; > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_new_bridge_state); > + Oops, I placed those helpers in the #ifdef CONFIG_DEBUG_FS section. > #endif From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D16E4C33CB6 for ; Thu, 23 Jan 2020 07:37:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B034224125 for ; Thu, 23 Jan 2020 07:37:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B034224125 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B78256F9B8; Thu, 23 Jan 2020 07:37:23 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3548A6F9B8 for ; Thu, 23 Jan 2020 07:37:22 +0000 (UTC) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 74F1A28CE86; Thu, 23 Jan 2020 07:37:20 +0000 (GMT) Date: Thu, 23 Jan 2020 08:37:17 +0100 From: Boris Brezillon To: dri-devel@lists.freedesktop.org Subject: Re: [PATCH v7 01/12] drm/bridge: Add a drm_bridge_state object Message-ID: <20200123083717.1264d9b4@collabora.com> In-Reply-To: <20200122111700.1924960-2-boris.brezillon@collabora.com> References: <20200122111700.1924960-1-boris.brezillon@collabora.com> <20200122111700.1924960-2-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nikita Yushchenko , Mark Rutland , Jernej Skrabec , Neil Armstrong , Andrey Smirnov , Jonas Karlman , Rob Herring , Andrzej Hajda , devicetree@vger.kernel.org, Thierry Reding , Laurent Pinchart , kernel@collabora.com, Sam Ravnborg , Chris Healy Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Wed, 22 Jan 2020 12:16:49 +0100 Boris Brezillon wrote: > + > +/** > + * drm_atomic_get_bridge_state - get bridge state > + * @state: global atomic state object > + * @bridge: bridge to get state object for > + * > + * This function returns the bridge state for the given bridge, allocating it > + * if needed. It will also grab the relevant bridge lock to make sure that the > + * state is consistent. > + * > + * Returns: > + * > + * Either the allocated state or the error code encoded into the pointer. When > + * the error is EDEADLK then the w/w mutex code has detected a deadlock and the > + * entire atomic sequence must be restarted. > + */ > +struct drm_bridge_state * > +drm_atomic_get_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_private_obj_state(state, &bridge->base); > + if (IS_ERR(obj_state)) > + return ERR_CAST(obj_state); > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_bridge_state); > + > +/** > + * drm_atomic_get_old_bridge_state - get old bridge state, if it exists > + * @state: global atomic state object > + * @bridge: bridge to grab > + * > + * This function returns the old bridge state for the given bridge, or NULL if > + * the bridge is not part of the global atomic state. > + */ > +struct drm_bridge_state * > +drm_atomic_get_old_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_old_private_obj_state(state, &bridge->base); > + if (!obj_state) > + return NULL; > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_old_bridge_state); > + > +/** > + * drm_atomic_get_new_bridge_state - get new bridge state, if it exists > + * @state: global atomic state object > + * @bridge: bridge to grab > + * > + * This function returns the new bridge state for the given bridge, or NULL if > + * the bridge is not part of the global atomic state. > + */ > +struct drm_bridge_state * > +drm_atomic_get_new_bridge_state(struct drm_atomic_state *state, > + struct drm_bridge *bridge) > +{ > + struct drm_private_state *obj_state; > + > + obj_state = drm_atomic_get_new_private_obj_state(state, &bridge->base); > + if (!obj_state) > + return NULL; > + > + return drm_priv_to_bridge_state(obj_state); > +} > +EXPORT_SYMBOL(drm_atomic_get_new_bridge_state); > + Oops, I placed those helpers in the #ifdef CONFIG_DEBUG_FS section. > #endif _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel