[mutter] kms/plane: Find property IDs to be used for atomic modesetting
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] kms/plane: Find property IDs to be used for atomic modesetting
- Date: Fri, 22 Jan 2021 17:08:26 +0000 (UTC)
commit a9ae20232702b12ed4d5f255bdb753508fde3942
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Jul 13 23:27:30 2020 +0200
kms/plane: Find property IDs to be used for atomic modesetting
Currently undiscovered, as we haven't enabled the atomic modesetting
capability, but lets get the infrastructure to get the property IDs in
place.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
src/backends/native/meta-kms-plane-private.h | 22 +++++++
src/backends/native/meta-kms-plane.c | 98 ++++++++++++++++++++++++++++
2 files changed, 120 insertions(+)
---
diff --git a/src/backends/native/meta-kms-plane-private.h b/src/backends/native/meta-kms-plane-private.h
index 2a36d49173..7454cd2446 100644
--- a/src/backends/native/meta-kms-plane-private.h
+++ b/src/backends/native/meta-kms-plane-private.h
@@ -26,6 +26,22 @@
#include "backends/native/meta-kms-plane.h"
#include "backends/native/meta-kms-types.h"
+typedef enum _MetaKmsPlaneProp
+{
+ META_KMS_PLANE_PROP_TYPE = 0,
+ META_KMS_PLANE_PROP_SRC_X,
+ META_KMS_PLANE_PROP_SRC_Y,
+ META_KMS_PLANE_PROP_SRC_W,
+ META_KMS_PLANE_PROP_SRC_H,
+ META_KMS_PLANE_PROP_CRTC_X,
+ META_KMS_PLANE_PROP_CRTC_Y,
+ META_KMS_PLANE_PROP_CRTC_W,
+ META_KMS_PLANE_PROP_CRTC_H,
+ META_KMS_PLANE_PROP_FB_ID,
+ META_KMS_PLANE_PROP_CRTC_ID,
+ META_KMS_PLANE_N_PROPS
+} MetaKmsPlaneProp;
+
MetaKmsPlane * meta_kms_plane_new (MetaKmsPlaneType type,
MetaKmsImplDevice *impl_device,
drmModePlane *drm_plane,
@@ -34,4 +50,10 @@ MetaKmsPlane * meta_kms_plane_new (MetaKmsPlaneType type,
MetaKmsPlane * meta_kms_plane_new_fake (MetaKmsPlaneType type,
MetaKmsCrtc *crtc);
+uint32_t meta_kms_plane_get_prop_id (MetaKmsPlane *plane,
+ MetaKmsPlaneProp prop);
+
+const char * meta_kms_plane_get_prop_name (MetaKmsPlane *plane,
+ MetaKmsPlaneProp prop);
+
#endif /* META_KMS_PLANE_PRIVATE_H */
diff --git a/src/backends/native/meta-kms-plane.c b/src/backends/native/meta-kms-plane.c
index 1520770369..8348f37572 100644
--- a/src/backends/native/meta-kms-plane.c
+++ b/src/backends/native/meta-kms-plane.c
@@ -30,6 +30,11 @@
#include "backends/native/meta-kms-impl-device.h"
#include "backends/native/meta-kms-update-private.h"
+typedef struct _MetaKmsPlanePropTable
+{
+ MetaKmsProp props[META_KMS_PLANE_N_PROPS];
+} MetaKmsPlanePropTable;
+
struct _MetaKmsPlane
{
GObject parent;
@@ -52,6 +57,8 @@ struct _MetaKmsPlane
*/
GHashTable *formats_modifiers;
+ MetaKmsPlanePropTable prop_table;
+
MetaKmsDevice *device;
};
@@ -77,6 +84,20 @@ meta_kms_plane_get_plane_type (MetaKmsPlane *plane)
return plane->type;
}
+uint32_t
+meta_kms_plane_get_prop_id (MetaKmsPlane *plane,
+ MetaKmsPlaneProp prop)
+{
+ return plane->prop_table.props[prop].prop_id;
+}
+
+const char *
+meta_kms_plane_get_prop_name (MetaKmsPlane *plane,
+ MetaKmsPlaneProp prop)
+{
+ return plane->prop_table.props[prop].name;
+}
+
void
meta_kms_plane_update_set_rotation (MetaKmsPlane *plane,
MetaKmsPlaneAssignment *plane_assignment,
@@ -363,6 +384,81 @@ init_formats (MetaKmsPlane *plane,
}
}
+static void
+init_properties (MetaKmsPlane *plane,
+ MetaKmsImplDevice *impl_device,
+ drmModePlane *drm_plane,
+ drmModeObjectProperties *drm_plane_props)
+{
+ MetaKmsPlanePropTable *prop_table = &plane->prop_table;
+
+ *prop_table = (MetaKmsPlanePropTable) {
+ .props = {
+ [META_KMS_PLANE_PROP_TYPE] =
+ {
+ .name = "type",
+ .type = DRM_MODE_PROP_ENUM,
+ },
+ [META_KMS_PLANE_PROP_SRC_X] =
+ {
+ .name = "SRC_X",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_SRC_Y] =
+ {
+ .name = "SRC_Y",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_SRC_W] =
+ {
+ .name = "SRC_W",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_SRC_H] =
+ {
+ .name = "SRC_H",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_CRTC_X] =
+ {
+ .name = "CRTC_X",
+ .type = DRM_MODE_PROP_SIGNED_RANGE,
+ },
+ [META_KMS_PLANE_PROP_CRTC_Y] =
+ {
+ .name = "CRTC_Y",
+ .type = DRM_MODE_PROP_SIGNED_RANGE,
+ },
+ [META_KMS_PLANE_PROP_CRTC_W] =
+ {
+ .name = "CRTC_W",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_CRTC_H] =
+ {
+ .name = "CRTC_H",
+ .type = DRM_MODE_PROP_RANGE,
+ },
+ [META_KMS_PLANE_PROP_FB_ID] =
+ {
+ .name = "FB_ID",
+ .type = DRM_MODE_PROP_OBJECT,
+ },
+ [META_KMS_PLANE_PROP_CRTC_ID] =
+ {
+ .name = "CRTC_ID",
+ .type = DRM_MODE_PROP_OBJECT,
+ },
+ }
+ };
+
+ meta_kms_impl_device_init_prop_table (impl_device,
+ drm_plane_props->props,
+ drm_plane_props->count_props,
+ plane->prop_table.props,
+ META_KMS_PLANE_N_PROPS);
+}
+
MetaKmsPlane *
meta_kms_plane_new (MetaKmsPlaneType type,
MetaKmsImplDevice *impl_device,
@@ -380,6 +476,8 @@ meta_kms_plane_new (MetaKmsPlaneType type,
init_rotations (plane, impl_device, drm_plane_props);
init_formats (plane, impl_device, drm_plane, drm_plane_props);
+ init_properties (plane, impl_device, drm_plane, drm_plane_props);
+
return plane;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]