]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm: verisilicon: make vs_format conversion function return int
authorIcenowy Zheng <zhengxingda@iscas.ac.cn>
Tue, 31 Mar 2026 06:01:23 +0000 (14:01 +0800)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 4 May 2026 11:30:59 +0000 (13:30 +0200)
This is for further proper invalid drm_format handling before committing
the plane state change.

The return value is not yet checked yet, and will be checked in
atomic_check in the future.

Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260331060126.1291966-2-zhengxingda@iscas.ac.cn
drivers/gpu/drm/verisilicon/vs_plane.c
drivers/gpu/drm/verisilicon/vs_plane.h

index 2f3953e588a3420231d457aa3bc2079ac012b433..fa88ed14e41d7c7d70b0c7ef0cc967504993b2eb 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "vs_plane.h"
 
-void drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
+int drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
 {
        switch (drm_format) {
        case DRM_FORMAT_XRGB4444:
@@ -62,7 +62,7 @@ void drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
                vs_format->color = VSDC_COLOR_FORMAT_A2R10G10B10;
                break;
        default:
-               pr_warn("Unexpected drm format!\n");
+               return -EINVAL;
        }
 
        switch (drm_format) {
@@ -101,6 +101,8 @@ void drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
 
        /* N/A for non-YUV formats */
        vs_format->uv_swizzle = false;
+
+       return 0;
 }
 
 dma_addr_t vs_fb_get_dma_addr(struct drm_framebuffer *fb,
index 41875ea3d66a5aeb87c07f702286ea40c2489af0..a88cc19f2202e1aeaec6a41c2a2340a971f1f14c 100644 (file)
@@ -63,7 +63,7 @@ struct vs_format {
        bool uv_swizzle;
 };
 
-void drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format);
+int drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format);
 dma_addr_t vs_fb_get_dma_addr(struct drm_framebuffer *fb,
                              const struct drm_rect *src_rect);