diff options
| author | Icenowy Zheng <zhengxingda@iscas.ac.cn> | 2026-03-31 09:01:23 +0300 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2026-05-04 14:30:59 +0300 |
| commit | 2c23455d5aaa10eff69aa75200d5177e84640189 (patch) | |
| tree | 6143f657ce60ef361fbf35709c9a554530c8f2b8 /drivers/gpu | |
| parent | 9a56caf49525e8a0ee349fb69db101d018a95a66 (diff) | |
| download | linux-2c23455d5aaa10eff69aa75200d5177e84640189.tar.xz | |
drm: verisilicon: make vs_format conversion function return int
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
Diffstat (limited to 'drivers/gpu')
| -rw-r--r-- | drivers/gpu/drm/verisilicon/vs_plane.c | 6 | ||||
| -rw-r--r-- | drivers/gpu/drm/verisilicon/vs_plane.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/verisilicon/vs_plane.c b/drivers/gpu/drm/verisilicon/vs_plane.c index 2f3953e588a3..fa88ed14e41d 100644 --- a/drivers/gpu/drm/verisilicon/vs_plane.c +++ b/drivers/gpu/drm/verisilicon/vs_plane.c @@ -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, diff --git a/drivers/gpu/drm/verisilicon/vs_plane.h b/drivers/gpu/drm/verisilicon/vs_plane.h index 41875ea3d66a..a88cc19f2202 100644 --- a/drivers/gpu/drm/verisilicon/vs_plane.h +++ b/drivers/gpu/drm/verisilicon/vs_plane.h @@ -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); |
