[PATCH 03/17] drm/amd/display: use drm_err in create_validate_stream_for_sink()
Kees Bakker
kees at ijzerbout.nl
Wed Apr 9 17:50:47 UTC 2025
Op 26-03-2025 om 20:49 schreef Fangzhi Zuo:
> From: Aurabindo Pillai <aurabindo.pillai at amd.com>
>
> make the drm device available in create_validate_stream_for_sink()
> so that drm_err() can be used
>
> Reviewed-by: Alex Hung <alex.hung at amd.com>
> Signed-off-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
> Signed-off-by: Fangzhi Zuo <jerry.zuo at amd.com>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 16e2823f83b1..639b1c01cbf9 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> [...]
> @@ -6872,6 +6872,7 @@ create_stream_for_sink(struct drm_connector *connector,
> const struct dc_stream_state *old_stream,
> int requested_bpc)
> {
> + struct drm_device *dev = connector->dev;
Here `connector` is used before checking for a NULL pointer.
> struct amdgpu_dm_connector *aconnector = NULL;
> struct drm_display_mode *preferred_mode = NULL;
> const struct drm_connector_state *con_state = &dm_state->base;
> @@ -6895,7 +6896,7 @@ create_stream_for_sink(struct drm_connector *connector,
> memset(&saved_mode, 0, sizeof(saved_mode));
>
> if (connector == NULL) {
> - DRM_ERROR("connector is NULL!\n");
> + drm_err(dev, "connector is NULL!\n");
> return stream;
> }
>
This if statement a little later makes me think that it *is* possible that
`connector` can be NULL. (If not then the whole if can be removed.)
--
Kees
More information about the amd-gfx
mailing list