[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240917160208.2905-1-jose.exposito89@gmail.com>
Date: Tue, 17 Sep 2024 18:02:06 +0200
From: José Expósito <jose.exposito89@...il.com>
To: louis.chauvet@...tlin.com
Cc: airlied@...il.com,
daniel@...ll.ch,
dri-devel@...ts.freedesktop.org,
hamohammed.sa@...il.com,
linux-kernel@...r.kernel.org,
maarten.lankhorst@...ux.intel.com,
mairacanal@...eup.net,
melissa.srw@...il.com,
mripard@...nel.org,
rodrigosiqueiramelo@...il.com,
thomas.petazzoni@...tlin.com,
tzimmermann@...e.de,
José Expósito <jose.exposito89@...il.com>
Subject: [PATCH] drm/vkms: Add missing check for CRTC initialization
Hi Louis,
> CRTC initialization call drm_mode_crtc_set_gamma_size without the proper
> checks, introduce this check to avoid issues.
>
> Signed-off-by: Louis Chauvet <louis.chauvet@...tlin.com>
Reviewed-by: José Expósito <jose.exposito89@...il.com>
> ---
> drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>
> ---
> base-commit: a6bb1f77a94335de67dba12e7f52651c115b82d2
> change-id: 20240906-vkms-add-missing-check-e1b6ee8d1b39
>
> Best regards,
>
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 40b4d084e3ce..e4f93dfbd071 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -287,7 +287,12 @@ int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
>
> drm_crtc_helper_add(crtc, &vkms_crtc_helper_funcs);
>
> - drm_mode_crtc_set_gamma_size(crtc, VKMS_LUT_SIZE);
> + ret = drm_mode_crtc_set_gamma_size(crtc, VKMS_LUT_SIZE);
> + if (ret) {
> + DRM_ERROR("Failed to set gamma size\n");
This will conflit with "drm/vkms: Switch to dynamic allocation
for CRTC" [1], where you switched to DRM_DEV_ERROR.
No proferences about the log function, just a heads up so when
you rebase one of the patches we keep logging consistent.
[1] https://patchwork.kernel.org/project/dri-devel/patch/20240912-b4-vkms-allocated-v1-3-29abbaa14af9@bootlin.com/
> + return ret;
> + }
> +
> drm_crtc_enable_color_mgmt(crtc, 0, false, VKMS_LUT_SIZE);
>
> spin_lock_init(&vkms_out->lock);
>
Powered by blists - more mailing lists