From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Rob Clark <robdclark@gmail.com>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/2] drm/bridge-connector: reset the HDMI connector state
Date: Mon, 24 Jun 2024 15:28:38 -0700 [thread overview]
Message-ID: <45c25e4b-d64d-549f-6711-7b753d24e2f9@quicinc.com> (raw)
In-Reply-To: <20240623-drm-bridge-connector-fix-hdmi-reset-v2-1-8590d44912ce@linaro.org>
On 6/22/2024 10:40 PM, Dmitry Baryshkov wrote:
> On HDMI connectors which use drm_bridge_connector and DRM_BRIDGE_OP_HDMI
> IGT chokes on the max_bpc property in several kms_properties tests due
> to the the drm_bridge_connector failing to reset HDMI-related
> properties.
>
> Call __drm_atomic_helper_connector_hdmi_reset() if there is a
> the drm_bridge_connector has bridge_hdmi.
>
> Note, the __drm_atomic_helper_connector_hdmi_reset() is moved to
> drm_atomic_state_helper.c because drm_bridge_connector.c can not depend
> on DRM_DISPLAY_HDMI_STATE_HELPER. At the same time it is impossible to
> call this function from HDMI bridges, there is is no function that
> corresponds to the drm_connector_funcs::reset().
>
> Fixes: 6b4468b0c6ba ("drm/bridge-connector: implement glue code for HDMI connector")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/display/drm_hdmi_state_helper.c | 21 ---------------------
> drivers/gpu/drm/drm_atomic_state_helper.c | 21 +++++++++++++++++++++
> drivers/gpu/drm/drm_bridge_connector.c | 13 ++++++++++++-
> include/drm/display/drm_hdmi_state_helper.h | 3 ---
> include/drm/drm_atomic_state_helper.h | 2 ++
> 5 files changed, 35 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> index 2dab3ad8ce64..67f39857b0b4 100644
> --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c
> @@ -8,27 +8,6 @@
> #include <drm/display/drm_hdmi_helper.h>
> #include <drm/display/drm_hdmi_state_helper.h>
>
> -/**
> - * __drm_atomic_helper_connector_hdmi_reset() - Initializes all HDMI @drm_connector_state resources
> - * @connector: DRM connector
> - * @new_conn_state: connector state to reset
> - *
> - * Initializes all HDMI resources from a @drm_connector_state without
> - * actually allocating it. This is useful for HDMI drivers, in
> - * combination with __drm_atomic_helper_connector_reset() or
> - * drm_atomic_helper_connector_reset().
> - */
> -void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
> - struct drm_connector_state *new_conn_state)
> -{
> - unsigned int max_bpc = connector->max_bpc;
> -
> - new_conn_state->max_bpc = max_bpc;
> - new_conn_state->max_requested_bpc = max_bpc;
> - new_conn_state->hdmi.broadcast_rgb = DRM_HDMI_BROADCAST_RGB_AUTO;
> -}
> -EXPORT_SYMBOL(__drm_atomic_helper_connector_hdmi_reset);
> -
> static const struct drm_display_mode *
> connector_state_get_mode(const struct drm_connector_state *conn_state)
> {
> diff --git a/drivers/gpu/drm/drm_atomic_state_helper.c b/drivers/gpu/drm/drm_atomic_state_helper.c
> index 519228eb1095..1518ada81b45 100644
> --- a/drivers/gpu/drm/drm_atomic_state_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_state_helper.c
> @@ -478,6 +478,27 @@ void drm_atomic_helper_connector_reset(struct drm_connector *connector)
> }
> EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
>
> +/**
> + * __drm_atomic_helper_connector_hdmi_reset() - Initializes all HDMI @drm_connector_state resources
> + * @connector: DRM connector
> + * @new_conn_state: connector state to reset
> + *
> + * Initializes all HDMI resources from a @drm_connector_state without
> + * actually allocating it. This is useful for HDMI drivers, in
> + * combination with __drm_atomic_helper_connector_reset() or
> + * drm_atomic_helper_connector_reset().
> + */
> +void __drm_atomic_helper_connector_hdmi_reset(struct drm_connector *connector,
> + struct drm_connector_state *new_conn_state)
> +{
> + unsigned int max_bpc = connector->max_bpc;
> +
> + new_conn_state->max_bpc = max_bpc;
> + new_conn_state->max_requested_bpc = max_bpc;
I understand this is just code propagation but do we need a max_bpc
local variable?
We can just do
new_conn_state->max_bpc = connector->max_bpc;
new_conn_state->max_requested_bpc = connector->max_bpc;
But apart from that nit, this LGTM.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
next prev parent reply other threads:[~2024-06-24 22:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-23 5:40 [PATCH v2 0/2] drm: fix two issues related to HDMI Connector implementation Dmitry Baryshkov
2024-06-23 5:40 ` [PATCH v2 1/2] drm/bridge-connector: reset the HDMI connector state Dmitry Baryshkov
2024-06-24 22:28 ` Abhinav Kumar [this message]
2024-06-24 22:31 ` Dmitry Baryshkov
2024-06-25 15:02 ` Maxime Ripard
2024-06-25 15:05 ` Dmitry Baryshkov
2024-06-25 15:49 ` Maxime Ripard
2024-06-25 16:38 ` Dmitry Baryshkov
2024-07-01 12:49 ` Maxime Ripard
2024-06-23 5:40 ` [PATCH v2 2/2] drm/connector: automatically set immutable flag for max_bpc property Dmitry Baryshkov
2024-06-24 22:39 ` Abhinav Kumar
2024-06-24 22:46 ` Dmitry Baryshkov
2024-06-24 22:55 ` Abhinav Kumar
2024-06-25 6:21 ` Dmitry Baryshkov
2024-06-25 7:19 ` Maxime Ripard
2024-06-25 7:23 ` Dmitry Baryshkov
2024-06-25 13:58 ` Maxime Ripard
2024-06-25 14:31 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45c25e4b-d64d-549f-6711-7b753d24e2f9@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dave.stevenson@raspberrypi.com \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=robdclark@gmail.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®