drm/vkms: Add missing check for CRTC initialization
Louis Chauvet
maintainerPATCH 1/1 drm/vkms: Add missing check for CRTC initialization
CRTC initialization call drm_mode_crtc_set_gamma_size without the proper checks, introduce this check to avoid issues.
--- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/vkms/vkms_crtc.c +6 -1
@@ -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" ); +return ret; + } +drm_crtc_enable_color_mgmt (crtc,0 , false,VKMS_LUT_SIZE );spin_lock_init (&vkms_out->lock);
---
base-commit: a6bb1f77a94335de67dba12e7f52651c115b82d2
change-id: 20240906-vkms-add-missing-check-e1b6ee8d1b39
Best regards,
Signature · 1 line
Louis Chauvet <[email protected]>
PATCH 1/1 drm/vkms: Add missing check for CRTC initialization
Hi Louis,
Quoted 4 lines
CRTC initialization call
drm_mode_crtc_set_gamma_sizewithout the proper checks, introduce this check to avoid issues.Signed-off-by Louis Chauvet <[email protected]>
Quoted 16 lines
--- 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-e1b6ee8d1b39Best regards,
drivers/gpu/drm/vkms/vkms_crtc.c +0
-0
drivers/gpu/drm/vkms/vkms_crtc.c int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, · line 292
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_crtc.c +3
-1@@ -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/[email protected]/
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_crtc.c +3
-0+return ret; + } +drm_crtc_enable_color_mgmt (crtc,0 , false,VKMS_LUT_SIZE );spin_lock_init (&vkms_out->lock);
Louis Chauvet
maintainerQuoted 28 lines · José Expósito
Hi Louis,
Quoted 4 lines
CRTC initialization call
drm_mode_crtc_set_gamma_sizewithout the proper checks, introduce this check to avoid issues.Signed-off-by Louis Chauvet <[email protected]>Reviewed-by José Expósito <[email protected]>Quoted 19 lines
--- 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-e1b6ee8d1b39Best regards,
drivers/gpu/drm/vkms/vkms_crtc.c +0
-0@@ -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);
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_crtc.c int vkms_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, · line 292
Quoted 4 lines
drivers/gpu/drm/vkms/vkms_crtc.c +3
-1-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.
I did not check if my series had conflict between them, so I'm not surprised. I will change it to the DEV variant and send a v2, espicially since Leo [1] wants to work to clean the logging in VKMS :-)
[1]:https://lore.kernel.org/all/CAHhBtNqB=jQTnY1eu8or=toczr93ehUeuBkAZ7axFPr4ZHPjCQ@mail.gmail.com/
Quoted 12 lines
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/[email protected]/
Quoted 7 lines
drivers/gpu/drm/vkms/vkms_crtc.c +3
-0+return ret; + } +drm_crtc_enable_color_mgmt (crtc,0 , false,VKMS_LUT_SIZE );spin_lock_init (&vkms_out->lock);
Maíra Canal
AppliedHi Louis,
Quoted 4 lines · Louis Chauvet
CRTC initialization call
drm_mode_crtc_set_gamma_sizewithout the proper checks, introduce this check to avoid issues.Signed-off-by Louis Chauvet <[email protected]>
Applied to misc/kernel.git (drm-misc-next).
Best Regards,
- Maíra
Quoted 28 lines
--- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/vkms/vkms_crtc.c +6
-2@@ -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" ); +return ret; + } +drm_crtc_enable_color_mgmt (crtc,0 , false,VKMS_LUT_SIZE );spin_lock_init (&vkms_out->lock); ---base-commit:
a6bb1f77a94335de67dba12e7f52651c115b82d2
change-id: 20240906-vkms-add-missing-check-e1b6ee8d1b39Best regards,