mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
backends/native: Split hw supported CRTC rotation modes
Those will need a separate treatment from the modes that we eventually support through "software", so split those into a separate enum so we can can do the right thing when applying the configuration. Also, add a helper function that returns the transform that the software fallbacks should perform, which should be "normal" if the rotation is already handled via hw. The function applying the configuration has been modified to always set a HW rotation mode (even if normal), when we come to support SW rotation modes, we'll be relying on a normal transformation, so it will be necessary to have mixed HW/SW managed transforms. https://bugzilla.gnome.org/show_bug.cgi?id=745079
This commit is contained in:
parent
a53ca0d8cf
commit
92c03e8625
@ -77,6 +77,7 @@ typedef struct {
|
||||
uint32_t primary_plane_id;
|
||||
uint32_t rotation_prop_id;
|
||||
uint32_t rotation_map[ALL_TRANSFORMS];
|
||||
uint32_t all_hw_transforms;
|
||||
} MetaCRTCKms;
|
||||
|
||||
typedef struct
|
||||
@ -530,7 +531,7 @@ parse_transforms (MetaMonitorManager *manager,
|
||||
|
||||
if (cur != -1)
|
||||
{
|
||||
crtc->all_transforms |= 1 << cur;
|
||||
crtc_kms->all_hw_transforms |= 1 << cur;
|
||||
crtc_kms->rotation_map[cur] = 1 << prop->enums[i].value;
|
||||
}
|
||||
}
|
||||
@ -606,6 +607,8 @@ init_crtc_rotations (MetaMonitorManager *manager,
|
||||
drmModeFreePlane (drm_plane);
|
||||
}
|
||||
|
||||
crtc->all_transforms |= crtc_kms->all_hw_transforms;
|
||||
|
||||
drmModeFreePlaneResources (planes);
|
||||
}
|
||||
|
||||
@ -1184,6 +1187,7 @@ meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager,
|
||||
MetaCRTCInfo *crtc_info = crtcs[i];
|
||||
MetaCRTC *crtc = crtc_info->crtc;
|
||||
MetaCRTCKms *crtc_kms = crtc->driver_private;
|
||||
MetaMonitorTransform hw_transform;
|
||||
|
||||
crtc->is_dirty = TRUE;
|
||||
|
||||
@ -1234,14 +1238,17 @@ meta_monitor_manager_kms_apply_configuration (MetaMonitorManager *manager,
|
||||
}
|
||||
}
|
||||
|
||||
if (crtc->all_transforms & (1 << crtc->transform))
|
||||
drmModeObjectSetProperty (manager_kms->fd,
|
||||
crtc_kms->primary_plane_id,
|
||||
DRM_MODE_OBJECT_PLANE,
|
||||
crtc_kms->rotation_prop_id,
|
||||
crtc_kms->rotation_map[crtc->transform]);
|
||||
}
|
||||
if (crtc_kms->all_hw_transforms & (1 << crtc->transform))
|
||||
hw_transform = crtc->transform;
|
||||
else
|
||||
hw_transform = META_MONITOR_TRANSFORM_NORMAL;
|
||||
|
||||
drmModeObjectSetProperty (manager_kms->fd,
|
||||
crtc_kms->primary_plane_id,
|
||||
DRM_MODE_OBJECT_PLANE,
|
||||
crtc_kms->rotation_prop_id,
|
||||
crtc_kms->rotation_map[hw_transform]);
|
||||
}
|
||||
/* Disable CRTCs not mentioned in the list (they have is_dirty == FALSE,
|
||||
because they weren't seen in the first loop) */
|
||||
for (i = 0; i < manager->n_crtcs; i++)
|
||||
@ -1617,3 +1624,18 @@ meta_monitor_manager_kms_class_init (MetaMonitorManagerKmsClass *klass)
|
||||
manager_class->set_crtc_gamma = meta_monitor_manager_kms_set_crtc_gamma;
|
||||
}
|
||||
|
||||
MetaMonitorTransform
|
||||
meta_monitor_manager_kms_get_view_transform (MetaMonitorManagerKms *manager,
|
||||
MetaCRTC *crtc)
|
||||
{
|
||||
MetaCRTCKms *crtc_kms;
|
||||
|
||||
crtc_kms = crtc->driver_private;
|
||||
if ((1 << crtc->transform) & crtc_kms->all_hw_transforms)
|
||||
{
|
||||
/* Transform is managed by the hardware, the view is untransformed */
|
||||
return META_MONITOR_TRANSFORM_NORMAL;
|
||||
}
|
||||
|
||||
return crtc->transform;
|
||||
}
|
||||
|
@ -57,4 +57,9 @@ gboolean meta_monitor_manager_kms_flip_crtc (MetaMonitorManagerKms *manager_kms,
|
||||
|
||||
void meta_monitor_manager_kms_wait_for_flip (MetaMonitorManagerKms *manager_kms);
|
||||
|
||||
MetaMonitorTransform
|
||||
meta_monitor_manager_kms_get_view_transform (MetaMonitorManagerKms *manager,
|
||||
MetaCRTC *crtc);
|
||||
|
||||
|
||||
#endif /* META_MONITOR_MANAGER_KMS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user