mirror of
https://github.com/brl/mutter.git
synced 2024-12-27 13:22:15 +00: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,6 +405,8 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
|
|||||||
.height = round (cursor_rect.size.height),
|
.height = round (cursor_rect.size.height),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (meta_kms_plane_supports_cursor_hotspot (cursor_plane))
|
||||||
|
{
|
||||||
plane_assignment = meta_kms_update_assign_plane (update,
|
plane_assignment = meta_kms_update_assign_plane (update,
|
||||||
crtc, cursor_plane,
|
crtc, cursor_plane,
|
||||||
buffer,
|
buffer,
|
||||||
@ -414,6 +416,7 @@ maybe_update_cursor_plane (MetaKmsCursorManagerImpl *cursor_manager_impl,
|
|||||||
(int) roundf (hotspot->x),
|
(int) roundf (hotspot->x),
|
||||||
(int) roundf (hotspot->y));
|
(int) roundf (hotspot->y));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*old_buffer = g_steal_pointer (&crtc_state_impl->pending_buffer);
|
*old_buffer = g_steal_pointer (&crtc_state_impl->pending_buffer);
|
||||||
|
@ -40,6 +40,8 @@ typedef enum _MetaKmsPlaneProp
|
|||||||
META_KMS_PLANE_PROP_CRTC_ID,
|
META_KMS_PLANE_PROP_CRTC_ID,
|
||||||
META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID,
|
META_KMS_PLANE_PROP_FB_DAMAGE_CLIPS_ID,
|
||||||
META_KMS_PLANE_PROP_IN_FENCE_FD,
|
META_KMS_PLANE_PROP_IN_FENCE_FD,
|
||||||
|
META_KMS_PLANE_PROP_HOTSPOT_X,
|
||||||
|
META_KMS_PLANE_PROP_HOTSPOT_Y,
|
||||||
META_KMS_PLANE_N_PROPS
|
META_KMS_PLANE_N_PROPS
|
||||||
} MetaKmsPlaneProp;
|
} MetaKmsPlaneProp;
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include "backends/meta-monitor-transform.h"
|
#include "backends/meta-monitor-transform.h"
|
||||||
#include "backends/native/meta-kms-crtc.h"
|
#include "backends/native/meta-kms-crtc.h"
|
||||||
#include "backends/native/meta-kms-impl-device.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"
|
#include "backends/native/meta-kms-update-private.h"
|
||||||
|
|
||||||
typedef struct _MetaKmsPlanePropTable
|
typedef struct _MetaKmsPlanePropTable
|
||||||
@ -189,6 +191,23 @@ meta_kms_plane_is_transform_handled (MetaKmsPlane *plane,
|
|||||||
return FALSE;
|
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 *
|
GArray *
|
||||||
meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
||||||
uint32_t format)
|
uint32_t format)
|
||||||
@ -505,6 +524,16 @@ init_properties (MetaKmsPlane *plane,
|
|||||||
.name = "IN_FENCE_FD",
|
.name = "IN_FENCE_FD",
|
||||||
.type = DRM_MODE_PROP_SIGNED_RANGE,
|
.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 = {
|
.rotation_bitmask = {
|
||||||
[META_KMS_PLANE_ROTATION_BIT_ROTATE_0] =
|
[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,
|
gboolean meta_kms_plane_is_transform_handled (MetaKmsPlane *plane,
|
||||||
MetaMonitorTransform transform);
|
MetaMonitorTransform transform);
|
||||||
|
|
||||||
|
gboolean meta_kms_plane_supports_cursor_hotspot (MetaKmsPlane *plane);
|
||||||
|
|
||||||
GArray * meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
GArray * meta_kms_plane_get_modifiers_for_format (MetaKmsPlane *plane,
|
||||||
uint32_t format);
|
uint32_t format);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user