mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
backends/native: Add PLANE_PROP_HOTSPOT_[X,Y]
Add META_KMS_PLANE_PROP_HOTSPOT_[X,Y] properties to the MetaKmsPlaneProp enumeration, and properly initialise them. Also, add a convenience method in meta-kms-plane (i.e., `meta_kms_plane_supports_cursor_hotspot`) to check whether a plane supports hotspot property setting. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3337>
This commit is contained in:
parent
8252f71447
commit
4b9d1271a0
@ -405,14 +405,17 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
|
||||
.height = round (cursor_rect.size.height),
|
||||
};
|
||||
|
||||
plane_assignment = meta_kms_update_assign_plane (update,
|
||||
crtc, cursor_plane,
|
||||
buffer,
|
||||
src_rect, dst_rect,
|
||||
assign_plane_flags);
|
||||
meta_kms_plane_assignment_set_cursor_hotspot (plane_assignment,
|
||||
(int) roundf (hotspot->x),
|
||||
(int) roundf (hotspot->y));
|
||||
if (meta_kms_plane_supports_cursor_hotspot (cursor_plane))
|
||||
{
|
||||
plane_assignment = meta_kms_update_assign_plane (update,
|
||||
crtc, cursor_plane,
|
||||
buffer,
|
||||
src_rect, dst_rect,
|
||||
assign_plane_flags);
|
||||
meta_kms_plane_assignment_set_cursor_hotspot (plane_assignment,
|
||||
(int) roundf (hotspot->x),
|
||||
(int) roundf (hotspot->y));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -40,6 +40,8 @@ typedef enum _MetaKmsPlaneProp
|
||||
META_KMS_PLANE_PROP_CRTC_ID,
|
||||
META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID,
|
||||
META_KMS_PLANE_PROP_IN_FENCE_FD,
|
||||
META_KMS_PLANE_PROP_HOTSPOT_X,
|
||||
META_KMS_PLANE_PROP_HOTSPOT_Y,
|
||||
META_KMS_PLANE_N_PROPS
|
||||
} MetaKmsPlaneProp;
|
||||
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include "backends/meta-monitor-transform.h"
|
||||
#include "backends/native/meta-kms-crtc.h"
|
||||
#include "backends/native/meta-kms-impl-device.h"
|
||||
#include "backends/native/meta-kms-impl-device-atomic.h"
|
||||
#include "backends/native/meta-kms-device-private.h"
|
||||
#include "backends/native/meta-kms-update-private.h"
|
||||
|
||||
typedef struct _MetaKmsPlanePropTable
|
||||
@ -189,6 +191,23 @@ meta_kms_plane_is_transform_handled (MetaKmsPlane *plane,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_kms_plane_supports_cursor_hotspot (MetaKmsPlane *plane)
|
||||
{
|
||||
MetaKmsImplDevice *impl_device =
|
||||
meta_kms_device_get_impl_device (plane->device);
|
||||
|
||||
if (META_IS_KMS_IMPL_DEVICE_ATOMIC (impl_device))
|
||||
{
|
||||
return (meta_kms_plane_get_prop_id (plane, META_KMS_PLANE_PROP_HOTSPOT_X) &&
|
||||
meta_kms_plane_get_prop_id (plane, META_KMS_PLANE_PROP_HOTSPOT_Y));
|
||||
}
|
||||
else
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
GArray *
|
||||
meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
||||
uint32_t format)
|
||||
@ -505,6 +524,16 @@ init_properties (MetaKmsPlane *plane,
|
||||
.name = "IN_FENCE_FD",
|
||||
.type = DRM_MODE_PROP_SIGNED_RANGE,
|
||||
},
|
||||
[META_KMS_PLANE_PROP_HOTSPOT_X] =
|
||||
{
|
||||
.name = "HOTSPOT_X",
|
||||
.type = DRM_MODE_PROP_SIGNED_RANGE,
|
||||
},
|
||||
[META_KMS_PLANE_PROP_HOTSPOT_Y] =
|
||||
{
|
||||
.name = "HOTSPOT_Y",
|
||||
.type = DRM_MODE_PROP_SIGNED_RANGE,
|
||||
},
|
||||
},
|
||||
.rotation_bitmask = {
|
||||
[META_KMS_PLANE_ROTATION_BIT_ROTATE_0] =
|
||||
|
@ -47,6 +47,8 @@ MetaKmsPlaneType meta_kms_plane_get_plane_type (MetaKmsPlane *plane);
|
||||
gboolean meta_kms_plane_is_transform_handled (MetaKmsPlane *plane,
|
||||
MetaMonitorTransform transform);
|
||||
|
||||
gboolean meta_kms_plane_supports_cursor_hotspot (MetaKmsPlane *plane);
|
||||
|
||||
GArray * meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
||||
uint32_t format);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user