From: Louis Chauvet <louis.chauvet@bootlin.com>
To: "Maíra Canal" <mairacanal@riseup.net>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Melissa Wen" <melissa.srw@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>
Cc: arthurgrillo@riseup.net, jeremie.dautheribes@bootlin.com,
miquel.raynal@bootlin.com, thomas.petazzoni@bootlin.com,
seanpaul@google.com, nicolejadeyee@google.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Louis Chauvet <louis.chauvet@bootlin.com>
Subject: [PATCH v3 06/16] drm/vkms: Introduce config for plane rotation
Date: Tue, 21 Jan 2025 11:55:30 +0100 [thread overview]
Message-ID: <20250121-google-remove-crtc-index-from-parameter-v3-6-cac00a3c3544@bootlin.com> (raw)
In-Reply-To: <20250121-google-remove-crtc-index-from-parameter-v3-0-cac00a3c3544@bootlin.com>
VKMS driver supports all the rotation on planes, but for testing it can be
useful to only advertise few of them. This new configuration interface
will allow configuring the rotation per planes.
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
---
drivers/gpu/drm/vkms/vkms_config.c | 9 +++++++++
drivers/gpu/drm/vkms/vkms_config.h | 4 ++++
drivers/gpu/drm/vkms/vkms_plane.c | 5 +++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vkms/vkms_config.c b/drivers/gpu/drm/vkms/vkms_config.c
index 0caa6bfccb5e409efa37ea48a52299e0dc132728..c7a39cde8cfbcd0ff4f5ae137cfb709b7a2240e2 100644
--- a/drivers/gpu/drm/vkms/vkms_config.c
+++ b/drivers/gpu/drm/vkms/vkms_config.c
@@ -82,6 +82,8 @@ struct vkms_config_plane *vkms_config_create_plane(struct vkms_config *vkms_conf
return NULL;
vkms_config_overlay->type = DRM_PLANE_TYPE_OVERLAY;
+ vkms_config_overlay->supported_rotations = DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK;
+ vkms_config_overlay->default_rotation = DRM_MODE_ROTATE_0;
list_add(&vkms_config_overlay->link, &vkms_config->planes);
@@ -118,6 +120,11 @@ bool vkms_config_is_valid(struct vkms_config *config)
bool has_primary = false;
list_for_each_entry(config_plane, &config->planes, link) {
+ // Default rotation not in supported rotations
+ if ((config_plane->default_rotation & config_plane->supported_rotations) !=
+ config_plane->default_rotation)
+ return false;
+
if (config_plane->type == DRM_PLANE_TYPE_PRIMARY) {
// Multiple primary planes for only one CRTC
if (has_primary)
@@ -151,6 +158,8 @@ static int vkms_config_show(struct seq_file *m, void *data)
seq_puts(m, "plane:\n");
seq_printf(m, "\tname: %s\n", config_plane->name);
seq_printf(m, "\ttype: %d\n", config_plane->type);
+ seq_printf(m, "\tsupported rotations: 0x%x\n", config_plane->supported_rotations);
+ seq_printf(m, "\tdefault rotation: 0x%x\n", config_plane->default_rotation);
}
return 0;
diff --git a/drivers/gpu/drm/vkms/vkms_config.h b/drivers/gpu/drm/vkms/vkms_config.h
index 3e70bce8d4f7b06f44ec79b3a3d8e6897f9a44c7..fd5e0df11647f145d53e71a1b6a244951af3ec0d 100644
--- a/drivers/gpu/drm/vkms/vkms_config.h
+++ b/drivers/gpu/drm/vkms/vkms_config.h
@@ -30,6 +30,8 @@ struct vkms_config {
* @name: Name of the plane
* @type: Type of the plane. The creator of configuration needs to ensures that at least one
* plane is primary.
+ * @default_rotation: Default rotation that should be used by this plane
+ * @supported_rotation: Rotation that this plane will support
* @plane: Internal usage. This pointer should never be considered as valid. It can be used to
* store a temporary reference to a vkms plane during device creation. This pointer is
* not managed by the configuration and must be managed by other means.
@@ -39,6 +41,8 @@ struct vkms_config_plane {
char *name;
enum drm_plane_type type;
+ unsigned int default_rotation;
+ unsigned int supported_rotations;
/* Internal usage */
struct vkms_plane *plane;
diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index b3a9a42476ef340986c8961f076236d76a7c73e3..c23ac8687dedaa956cfd6622321f1026521ff13f 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -202,8 +202,9 @@ struct vkms_plane *vkms_plane_init(struct vkms_device *vkmsdev,
drm_plane_helper_add(&plane->base, &vkms_plane_helper_funcs);
- drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0,
- DRM_MODE_ROTATE_MASK | DRM_MODE_REFLECT_MASK);
+ drm_plane_create_rotation_property(&plane->base,
+ config->default_rotation,
+ config->supported_rotations);
return plane;
}
--
2.47.1
next prev parent reply other threads:[~2025-01-21 10:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-21 10:55 [PATCH v3 00/16] drm/vkms: Introduce detailed configuration Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 01/16] drm/vkms: Extract vkms_config header Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 02/16] drm/vkms: Add a validation function for vkms configuration Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 03/16] drm/vkms: Move default_config creation to its own function Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 04/16] drm/vkms: Introduce config for plane Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 05/16] drm/vkms: Introduce config for plane name Louis Chauvet
2025-01-21 10:55 ` Louis Chauvet [this message]
2025-01-21 10:55 ` [PATCH v3 07/16] drm/vkms: Introduce config for CRTCs and encoders Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 08/16] drm/vkms: Introduce config for encoder name Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 09/16] drm/vkms: Introduce config for CRTC name Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 10/16] drm/vkms: Add test for config structure Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 11/16] drm/vkms: Introduce config for connector Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 12/16] drm/vkms: Introduce config for connector type Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 13/16] drm/vkms: Introduce config for plane format Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 14/16] drm/vkms: Introduce config for connector status Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 15/16] drm/vkms: Introduce config for connector EDID Louis Chauvet
2025-01-21 10:55 ` [PATCH v3 16/16] drm/vkms: Introduce config for encoder type Louis Chauvet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250121-google-remove-crtc-index-from-parameter-v3-6-cac00a3c3544@bootlin.com \
--to=louis.chauvet@bootlin.com \
--cc=airlied@gmail.com \
--cc=arthurgrillo@riseup.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=jeremie.dautheribes@bootlin.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mairacanal@riseup.net \
--cc=melissa.srw@gmail.com \
--cc=miquel.raynal@bootlin.com \
--cc=mripard@kernel.org \
--cc=nicolejadeyee@google.com \
--cc=seanpaul@google.com \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®