EAPI Eina_Bool ecore_drm_output_wait_vblank(Ecore_Drm_Output *output, int interval, Ecore_Drm_VBlank_Cb func, void *data);
EAPI int ecore_drm_output_dpms_get(Ecore_Drm_Output *output);
EAPI void *ecore_drm_output_hal_private_get(Ecore_Drm_Output *output);
+EAPI void ecore_drm_output_rotation_set(Ecore_Drm_Output *output, int rotation);
/* This is ugly, will remove after rebaseing on 1.14 */
EAPI unsigned int ecore_drm_output_crtc_id_get(Ecore_Drm_Output *output);
EAPI void ecore_drm_display_fb_hal_buffer_destroy(Ecore_Drm_Fb *fb);
EAPI Eina_Bool ecore_drm_device_pointer_rotation_set(Ecore_Drm_Device *dev, int rotation);
-EAPI Eina_Bool ecore_drm_evdev_device_rotate_set(Ecore_Drm_Device *dev, unsigned int rotation);
+EAPI void ecore_drm_device_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation);
EAPI Eina_Bool ecore_drm_device_touch_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation);
EAPI Eina_Bool ecore_drm_device_touch_transformation_set(Ecore_Drm_Device *dev, int offset_x, int offset_y, int w, int h);
return EINA_TRUE;
}
+EAPI void
+ecore_drm_device_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation)
+{
+ unsigned int rot = 0;
+ Ecore_Drm_Seat *seat = NULL;
+ Ecore_Drm_Evdev *edev = NULL;
+ Eina_List *l = NULL, *l2 = NULL;
+ int temp;
+
+ EINA_SAFETY_ON_NULL_RETURN(dev);
+ EINA_SAFETY_ON_NULL_RETURN(dev->seats);
+
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(ecore_drm_seat_evdev_list_get(seat), l2, edev)
+ {
+ if (libinput_device_has_capability(edev->device,
+ LIBINPUT_DEVICE_CAP_POINTER))
+ {
+ ecore_drm_outputs_geometry_get(edev->seat->input->dev,
+ &edev->mouse.minx, &edev->mouse.miny,
+ &edev->mouse.maxw, &edev->mouse.maxh);
+
+ if (rotation == 90 || rotation == 270)
+ {
+ temp = edev->mouse.minx;
+ edev->mouse.minx = edev->mouse.miny;
+ edev->mouse.miny = temp;
+
+ temp = edev->mouse.maxw;
+ edev->mouse.maxw = edev->mouse.maxh;
+ edev->mouse.maxh = temp;
+ }
+ }
+ }
+ }
+}
+
static void
_ecore_drm_device_touch_matrix_identify(float result[6])
{
Ecore_Drm_Input *input;
Ecore_Drm_Output *output = NULL;
const char *oname;
+ int temp;
if (!edev->seat) return;
if (!(input = edev->seat->input)) return;
edev->output = output;
- if (libinput_device_has_capability(edev->device,
+ if (libinput_device_has_capability(edev->device,
LIBINPUT_DEVICE_CAP_POINTER))
{
edev->seat->ptr.ix = edev->seat->ptr.dx = edev->output->current_mode->width / 2;
edev->seat->ptr.iy = edev->seat->ptr.dy = edev->output->current_mode->height / 2;
edev->mouse.dx = edev->seat->ptr.dx;
edev->mouse.dy = edev->seat->ptr.dy;
+
+ if (output->rotation == 90 || output->rotation == 270)
+ {
+ temp = edev->mouse.minx;
+ edev->mouse.minx = edev->mouse.miny;
+ edev->mouse.miny = temp;
+
+ temp = edev->mouse.maxw;
+ edev->mouse.maxw = edev->mouse.maxh;
+ edev->mouse.maxh = temp;
+ }
}
}
edev->seat->ptr.ix = edev->seat->ptr.dx;
edev->seat->ptr.iy = edev->seat->ptr.dy;
+
_device_pointer_motion(edev, event);
TRACE_INPUT_END();
return EINA_TRUE;
#endif
}
+
+EAPI void
+ecore_drm_output_rotation_set(Ecore_Drm_Output *output, int rotation)
+{
+ EINA_SAFETY_ON_NULL_RETURN(output);
+ output->rotation = rotation;
+}
int curr_fb_format;
void *hal_output;
+
+ int rotation;
};
struct _Ecore_Drm_Seat
_ecore_evas_drm_rotation_set(Ecore_Evas *ee, int rotation, int resize)
{
int rot_dif;
+ Ecore_Drm_Output *output;
if (ee->rotation == rotation) return;
/* rotate the input events in ecore_drm */
if (dev)
- ecore_drm_device_touch_rotation_set(dev, rotation);
+ {
+ output = ecore_drm_device_output_find(dev, ee->x, ee->y);
+ ecore_drm_output_rotation_set(output, rotation);
+ ecore_drm_device_touch_rotation_set(dev, rotation);
+ ecore_drm_device_rotation_set(dev, rotation);
+ }
/* calculate difference in rotation */
rot_dif = ee->rotation - rotation;