Commit 08b651ca authored by Louis Chauvet's avatar Louis Chauvet Committed by Simon Ser
Browse files

drm/vkms: Pass plane_cfg to plane initialization



As plane can have many parameters, directly pass the plane
configuration to the init function.

Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarLouis Chauvet <louis.chauvet@bootlin.com>
Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Link: https://patch.msgid.link/20251115000237.3561250-15-alex.hung@amd.com
parent 9cf87f86
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -225,6 +225,7 @@ struct vkms_output {
};

struct vkms_config;
struct vkms_config_plane;

/**
 * struct vkms_device - Description of a VKMS device
@@ -298,10 +299,10 @@ int vkms_output_init(struct vkms_device *vkmsdev);
 * vkms_plane_init() - Initialize a plane
 *
 * @vkmsdev: VKMS device containing the plane
 * @type: type of plane to initialize
 * @plane_cfg: plane configuration
 */
struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
				   enum drm_plane_type type);
				   struct vkms_config_plane *plane_cfg);

/* CRC Support */
const char *const *vkms_get_crc_sources(struct drm_crtc *crtc,
+1 −5
Original line number Diff line number Diff line
@@ -20,11 +20,7 @@ int vkms_output_init(struct vkms_device *vkmsdev)
		return -EINVAL;

	vkms_config_for_each_plane(vkmsdev->config, plane_cfg) {
		enum drm_plane_type type;

		type = vkms_config_plane_get_type(plane_cfg);

		plane_cfg->plane = vkms_plane_init(vkmsdev, type);
		plane_cfg->plane = vkms_plane_init(vkmsdev, plane_cfg);
		if (IS_ERR(plane_cfg->plane)) {
			DRM_DEV_ERROR(dev->dev, "Failed to init vkms plane\n");
			return PTR_ERR(plane_cfg->plane);
+4 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0+

#include "vkms_config.h"
#include <linux/iosys-map.h>

#include <drm/drm_atomic.h>
@@ -218,7 +219,7 @@ static const struct drm_plane_helper_funcs vkms_plane_helper_funcs = {
};

struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
				   enum drm_plane_type type)
				   struct vkms_config_plane *plane_cfg)
{
	struct drm_device *dev = &vkmsdev->drm;
	struct vkms_plane *plane;
@@ -226,7 +227,8 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
	plane = drmm_universal_plane_alloc(dev, struct vkms_plane, base, 0,
					   &vkms_plane_funcs,
					   vkms_formats, ARRAY_SIZE(vkms_formats),
					   NULL, type, NULL);
					   NULL, vkms_config_plane_get_type(plane_cfg),
					   NULL);
	if (IS_ERR(plane))
		return plane;