Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Low] drm/vkms: missing EXPORT_SYMBOL_IF_KUNIT for vkms_config_valid_plane_zpos() - [Low] drm/vkms: signed %d format used for unsigned int zpos in vkms_config_show() - [Low] drm/vkms: missing trailing newline in drm_info() in vkms_config_is_valid() --
commit 95ea58aa0af1d2c1724667a97c3ee561ebede801 Author: Louis Chauvet <[email protected]> drm/vkms: Introduce config for plane zpos property This commit adds configuration fields, accessors, validation, debugfs output, and KUnit tests for the plane zpos property in VKMS, and creates mutable or immutable zpos properties during plane initialization when enabled. > diff --git a/drivers/gpu/drm/vkms/vkms_config.c > b/drivers/gpu/drm/vkms/vkms_config.c > index 230346e56877f..342b844bfc6d4 100644 > --- a/drivers/gpu/drm/vkms/vkms_config.c > +++ b/drivers/gpu/drm/vkms/vkms_config.c [ ... ] > @@ -282,6 +285,33 @@ bool vkms_config_valid_plane_color_range(const struct > vkms_config *config, > } > EXPORT_SYMBOL_IF_KUNIT(vkms_config_valid_plane_color_range); > > +VISIBLE_IF_KUNIT > +bool vkms_config_valid_plane_zpos(const struct vkms_config *config, > + const struct vkms_config_plane *plane_cfg) > +{ > + struct drm_device *dev = config->dev ? &config->dev->drm : NULL; > + > + if (!vkms_config_plane_get_zpos_enabled(plane_cfg) || > + !vkms_config_plane_get_zpos_mutable(plane_cfg)) > + return true; > + > + if (vkms_config_plane_get_zpos_initial(plane_cfg) > > + vkms_config_plane_get_zpos_max(plane_cfg)) { > + drm_info(dev, "Configured initial zpos value bigger than zpos > max\n"); > + return false; > + } > + > + if (vkms_config_plane_get_zpos_max(plane_cfg) < > + vkms_config_plane_get_zpos_min(plane_cfg) || > + vkms_config_plane_get_zpos_initial(plane_cfg) < > + vkms_config_plane_get_zpos_min(plane_cfg)) { > + drm_info(dev, "Configured zpos value outside (zpos min; zpos > max)\n"); > + return false; > + } > + > + return true; > +} [Severity: Low] Should vkms_config_valid_plane_zpos() have an EXPORT_SYMBOL_IF_KUNIT(vkms_config_valid_plane_zpos) macro? It is marked VISIBLE_IF_KUNIT and declared in vkms_config.h under CONFIG_KUNIT, so calling it from vkms_config_test.c when CONFIG_DRM_VKMS and CONFIG_DRM_VKMS_KUNIT_TEST are built as separate modules will fail to link at modpost. Also, unlike the sibling rotation, color encoding, and color range tests, vkms_config_test_valid_plane_zpos() in vkms_config_test.c never calls vkms_config_valid_plane_zpos() directly, repeats the zpos_mutable=false test block with min=0 and max=0 instead of testing min > max while immutable, and does not test the multi-plane mixed zpos_enabled rejection path in vkms_config_is_valid(). > @@ -469,6 +502,19 @@ bool vkms_config_is_valid(const struct vkms_config > *config) > "Both supported color encodings and color > ranges must be set, or none\n"); > return false; > } > + > + if (!vkms_config_valid_plane_zpos(config, plane_cfg)) > + return false; > + > + if (vkms_config_plane_get_zpos_enabled(plane_cfg)) > + has_zpos_enabled = true; > + else > + has_zpos_disabled = true; > + } > + > + if (has_zpos_enabled && has_zpos_disabled) { > + drm_info(dev, "In the same device, all planes must have zpos > enabled or none of them"); > + return false; > + } [Severity: Low] This isn't a bug, but the drm_info() format string here is missing a trailing newline. > @@ -576,6 +622,16 @@ static int vkms_config_show(struct seq_file *m, void > *data) > show_formats(m, > vkms_config_plane_get_supported_formats(plane_cfg), > > vkms_config_plane_get_supported_formats_count(plane_cfg)); > seq_puts(m, "\n"); > + seq_printf(m, "\tzpos_enabled=%s\n", > + > str_true_false(vkms_config_plane_get_zpos_enabled(plane_cfg))); > + seq_printf(m, "\tzpos_mutable=%s\n", > + > str_true_false(vkms_config_plane_get_zpos_mutable(plane_cfg))); > + seq_printf(m, "\tzpos_min=%d\n", > + vkms_config_plane_get_zpos_min(plane_cfg)); > + seq_printf(m, "\tzpos_initial=%d\n", > + > vkms_config_plane_get_zpos_initial(plane_cfg)); > + seq_printf(m, "\tzpos_max=%d\n", > + vkms_config_plane_get_zpos_max(plane_cfg)); > } [Severity: Low] Should zpos_min, zpos_initial, and zpos_max be formatted with %u instead of %d? The underlying fields and getters use unsigned int, so values above INT_MAX are printed as negative numbers in debugfs. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=28
