'프로그램 사용/wayland'에 해당되는 글 38건

  1. 2024.03.11 weston evdev libinput
  2. 2024.02.26 weston 커서 숨기기
  3. 2023.09.08 wayland hdmi - touch 연결
  4. 2022.08.22 wayland atomic commit 패치?
  5. 2022.08.17 weston screen shooter 뜯어보기
  6. 2022.08.16 wayland glreadpixels 실패
  7. 2022.08.10 sway + wayvnc
  8. 2022.08.09 wayvnc 0.5 릴리즈
  9. 2022.08.08 capture drm screen
  10. 2022.07.07 weston redraw 취소하기
프로그램 사용/wayland2024. 3. 11. 18:01

디바이스 마다 인식 방법이 차이가 있을줄을 알았지만.. 어우..

struct evdev_device *
evdev_device_create(struct libinput_device *libinput_device,
    struct weston_seat *seat)
{
struct evdev_device *device;

device = zalloc(sizeof *device);
if (device == NULL)
return NULL;
weston_log("%s:%d\n",__func__,__LINE__);
device->seat = seat;
wl_list_init(&device->link);
device->device = libinput_device;

if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_KEYBOARD)) {
weston_seat_init_keyboard(seat, NULL);
device->seat_caps |= EVDEV_SEAT_KEYBOARD;
weston_log("%s:%d\n",__func__,__LINE__);
}
if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_POINTER)) {
weston_seat_init_pointer(seat);
device->seat_caps |= EVDEV_SEAT_POINTER;
weston_log("%s:%d\n",__func__,__LINE__);
}
if (libinput_device_has_capability(libinput_device,
   LIBINPUT_DEVICE_CAP_TOUCH)) {
weston_seat_init_touch(seat);
device->seat_caps |= EVDEV_SEAT_TOUCH;
device->touch_device = create_touch_device(device);
weston_log("%s:%d\n",__func__,__LINE__);
}

libinput_device_set_user_data(libinput_device, device);
libinput_device_ref(libinput_device);

return device;
}

 

LIBINPUT_EXPORT int
libinput_device_has_capability(struct libinput_device *device,
       enum libinput_device_capability capability)
{
return evdev_device_has_capability((struct evdev_device *) device,
   capability);
}

[링크 : https://github.com/jadahl/libinput/blob/master/src/libinput.c#L938]

 

int
evdev_device_has_capability(struct evdev_device *device,
    enum libinput_device_capability capability)
{
switch (capability) {
case LIBINPUT_DEVICE_CAP_POINTER:
return !!(device->seat_caps & EVDEV_DEVICE_POINTER);
case LIBINPUT_DEVICE_CAP_KEYBOARD:
return !!(device->seat_caps & EVDEV_DEVICE_KEYBOARD);
case LIBINPUT_DEVICE_CAP_TOUCH:
return !!(device->seat_caps & EVDEV_DEVICE_TOUCH);
default:
return 0;
}
}

[링크 : https://github.com/jadahl/libinput/blob/master/src/evdev.c#L699]

 

장치별로 인식되는 차이 확인! 커서가 안뜨던 녀석은 touch로 인식

[08:25:22.166] event2  - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200: is tagged by udev as: Touchscreen
[08:25:22.166] event2  - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200: device is a touch device
[08:25:22.176] event3  - FHD WebCam: FHD WebCam: is tagged by udev as: Keyboard
[08:25:22.176] event3  - FHD WebCam: FHD WebCam: device is a keyboard
[08:25:22.181] event1  - audio-hdmi HDMI Jack: is tagged by udev as: Switch
[08:25:22.181] event1  - not using input device '/dev/input/event1'
[08:25:22.181] evdev_device_create:856
[08:25:22.208] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:25:22.208] libinput: configuring device "30370000.snvs:snvs-powerkey".
[08:25:22.208] evdev_device_create:856
[08:25:22.208] Touchscreen - eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200 - /sys/devices/platform/soc@0/32f10108.usb/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3.2/1-1
[08:25:22.208] evdev_device_create:878 // LIBINPUT_DEVICE_CAP_TOUCH
[08:25:22.208] libinput: configuring device "eGalax Inc. eGalaxTouch P80H84 0900 v12 k4.18.200".
[08:25:22.208] input device event2 has no enabled output associated (none named), skipping calibration for now.
[08:25:22.208] evdev_device_create:856
[08:25:22.208] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:25:22.208] libinput: configuring device "FHD WebCam: FHD WebCam".
[08:25:22.209] DRM: head 'LVDS-1' found, connector 39 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[08:25:22.210] DRM: head 'HDMI-A-1' found, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'

 

얘는 특이하게도 MT protocol B를 쓰더니, 그래서 그런가 pointer와 touch 두 가지로 인식

[08:30:59.219] event5  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN: is tagged by udev as: Mouse
[08:30:59.220] event5  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN: device is a pointer
[08:30:59.221] evdev_device_create:856
[08:30:59.221] evdev_device_create:871 // LIBINPUT_DEVICE_CAP_POINTER
[08:30:59.221] libinput: configuring device "eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" UNKNOWN".
[08:30:59.221] input device event5 has no enabled output associated (none named), skipping calibration for now.
[08:30:59.221] associating input device event5 with output LVDS-1 (none by udev)
[08:30:59.312] event4  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19": is tagged by udev as: Touchscreen
[08:30:59.312] event4  - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19": device is a touch device
[08:30:59.313] evdev_device_create:856
[08:30:59.313] Touchscreen - eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19" - /sys/devices/platform/soc@0/32f10108.usb/38200000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.3/1-1.3.1/1-1.3.1:1.0/0003:0EEF:C000.0002/input/input5/event4
[08:30:59.313] evdev_device_create:878 // LIBINPUT_DEVICE_CAP_TOUCH
[08:30:59.313] libinput: configuring device "eGalax Inc. eGalaxTouch EXC3188-3374-08.00.00.00 19"".
[08:30:59.313] input device event4 has no enabled output associated (none named), skipping calibration for now.
[08:30:59.313] associating input device event4 with output LVDS-1 (none by udev)

 

내가 만든건.. 일단 ABS로 하긴 했지만 pointer 디바이스로 인식..

이제 어떻게 하면 touch로 하냐가 문제네

[08:40:03.449] event4  - vnc virtual keyboard driver: is tagged by udev as: Keyboard
[08:40:03.450] event4  - vnc virtual keyboard driver: device is a keyboard
[08:40:03.450] evdev_device_create:856
[08:40:03.450] evdev_device_create:865 // LIBINPUT_DEVICE_CAP_KEYBOARD
[08:40:03.450] libinput: configuring device "vnc virtual keyboard driver".
[08:40:03.450] associating input device event4 with output LVDS-1 (none by udev)
[08:40:03.453] event5  - TouchPad: is tagged by udev as: Mouse
[08:40:03.453] event5  - TouchPad: device is a pointer
[08:40:03.454] evdev_device_create:856
[08:40:03.454] evdev_device_create:871 // LIBINPUT_DEVICE_CAP_POINTER
[08:40:03.454] libinput: configuring device "TouchPad".
[08:40:03.454] input device event5 has no enabled output associated (none named), skipping calibration for now.
[08:40:03.454] associating input device event5 with output LVDS-1 (none by udev)

 

'프로그램 사용 > wayland' 카테고리의 다른 글

weston 커서 숨기기  (0) 2024.02.26
wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
Posted by 구차니
프로그램 사용/wayland2024. 2. 26. 16:48

weston.ini 에 추가해서 아예 커서를 그리지 않게 하는 방법

static void
pointer_set_cursor(struct wl_client *client, struct wl_resource *resource,
   uint32_t serial, struct wl_resource *surface_resource,
   int32_t x, int32_t y)
{
struct weston_pointer *pointer = wl_resource_get_user_data(resource);
struct weston_surface *surface = NULL;

if (!pointer)
return;

if (surface_resource)
surface = wl_resource_get_user_data(surface_resource);

if (pointer->focus == NULL)
return;
/* pointer->focus->surface->resource can be NULL. Surfaces like the
black_surface used in shell.c for fullscreen don't have
a resource, but can still have focus */
if (pointer->focus->surface->resource == NULL)
return;
if (wl_resource_get_client(pointer->focus->surface->resource) != client)
return;
if (pointer->focus_serial - serial > UINT32_MAX / 2)
return;

if (!surface) {
if (pointer->sprite)
pointer_unmap_sprite(pointer);
return;
}

if (pointer->sprite && pointer->sprite->surface == surface &&
    pointer->hotspot_x == x && pointer->hotspot_y == y)
return;

if (!pointer->sprite || pointer->sprite->surface != surface) {
if (pointer->seat->compositor->hide_cursor)
return;

if (weston_surface_set_role(surface, "wl_pointer-cursor",
    resource,
    WL_POINTER_ERROR_ROLE) < 0)
return;

if (pointer->sprite)
pointer_unmap_sprite(pointer);

wl_signal_add(&surface->destroy_signal,
      &pointer->sprite_destroy_listener);

surface->committed = pointer_cursor_surface_committed;
surface->committed_private = pointer;
weston_surface_set_label_func(surface,
    pointer_cursor_surface_get_label);
pointer->sprite = weston_view_create(surface);
}

pointer->hotspot_x = x;
pointer->hotspot_y = y;

if (surface->buffer_ref.buffer) {
pointer_cursor_surface_committed(surface, 0, 0);
weston_view_schedule_repaint(pointer->sprite);
}
}

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/345/diffs]

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/blob/f964b59c8af8505422cac79de2466e0a31702a0d/libweston/input.c]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston evdev libinput  (0) 2024.03.11
wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
Posted by 구차니

윈도우와는 다르게 리눅스에서는

HDMI + touch를 연결하면 자꾸 0번 디스플레이와 새로 연결된 터치가 연결된다.

 

윈도우에서 지금까진 안맞는적은 없었는데, 연결방법 글이 있는걸 보면 아주 없진 않나보다.

아무튼 윈도우는 어떤 시나리오로 되길래 외부 모니터와 touch를 잘 매칭해주는진 모르겠지만

[링크 : https://comterman.tistory.com/2738]

 

wayland 나 x.org 에서는 영~ 매칭이 잘 안된다.

화면 찢어짐 때문에 wayland로 해놨는데 그 여파로 따라해봐도 스크린에 터치가 옮겨가진 않는다.

[링크 : https://askubuntu.com/questions/71768/touchscreen-and-additional-external-monitor]

[링크 : https://unix.stackexchange.com/questions/473721/calibrating-a-touch-screen-on-dual-monitors-one-touch-one-not]

 

libinput-device.c를 보면 아래 함수 두개에 associated 용어를 표현하며

입력 장치를 evdev의 이벤트를 통해 연결하는데, 회사에서 시험해볼때는

touch 장치 쪽에서 연결할 스크린 명칭을 넣어주지 않아서인지 제대로 연결되는걸 못 본 듯.

void
evdev_device_set_calibration(struct evdev_device *device)
{
struct udev *udev;
struct udev_device *udev_device = NULL;
const char *sysname = libinput_device_get_sysname(device->device);
const char *calibration_values;
uint32_t width, height;
struct weston_touch_device_matrix calibration;

if (!libinput_device_config_calibration_has_matrix(device->device))
return;

/* If LIBINPUT_CALIBRATION_MATRIX was set to non-identity, we will not
* override it with WL_CALIBRATION. It also means we don't need an
* output to load a calibration. */
if (libinput_device_config_calibration_get_default_matrix(
device->device,
calibration.m) != 0)
return;

/* touch_set_calibration() has updated the values, do not load old
* values from WL_CALIBRATION.
*/
if (device->override_wl_calibration)
return;

if (!device->output) {
weston_log("input device %s has no enabled output associated "
"(%s named), skipping calibration for now.\n",
sysname, device->output_name ?: "none");
return;
}

void
evdev_device_set_output(struct evdev_device *device,
struct weston_output *output)
{
if (device->output == output)
return;

if (device->output_destroy_listener.notify) {
wl_list_remove(&device->output_destroy_listener.link);
device->output_destroy_listener.notify = NULL;
}

if (!output) {
weston_log("output for input device %s removed\n",
libinput_device_get_sysname(device->device));

device->output = NULL;
return;
}

weston_log("associating input device %s with output %s "
"(%s by udev)\n",
libinput_device_get_sysname(device->device),
output->name,
device->output_name ?: "none");

device->output = output;
device->output_destroy_listener.notify = notify_output_destroy;
wl_signal_add(&output->destroy_signal,
&device->output_destroy_listener);
evdev_device_set_calibration(device);
}

'프로그램 사용 > wayland' 카테고리의 다른 글

weston evdev libinput  (0) 2024.03.11
weston 커서 숨기기  (0) 2024.02.26
wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
Posted by 구차니
프로그램 사용/wayland2022. 8. 22. 18:04

오랫만에 생각난김에 검색했는데 8월 2일 커밋된 따끈한 녀석 발견!

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/commits/main?search=atomic]

 

음.. 잘 해결되면 좋겠네..

backend-drm: improve atomic commit failure handling


When an atomic commit fails then the output will be stuck in
REPAINT_AWAITING_COMPLETION state. It is waiting for a vblank event that was
never scheduled.
If the error is EBUSY then it can be expected to be a transient error. So
propagate the error and schedule a new repaint in the core compositor.

This is necessary because there are some circumstances when the commit can fail
unexpectedly:
- With 'state_invalid == true' one commit will disable all planes. If another
  commit for a different output is triggered immediately afterwards, then this
  commit can temporarily fail with EBUSY because it tries to use the same
  planes.
- At least with i915, if one commit enables an output then a second commit for a
  different output immediately afterwards can temporarily fail with EBUSY. This
  is probably caused by some hardware interdependency.
Signed-off-by: Michael Olbrich's avatarMichael Olbrich <m.olbrich@pengutronix.de>

 

libweston/backend-drm/drm.c의 drm_repaint_flush()와

libweston/compositor.c의 output_repaint_timer_hander() 쪽에 수정이 가해진다.

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/commit/3b3fdc52c31f828ff0fb71d2c6ce7bdcc64f20a1]

[링크 : https://gitlab.freedesktop.org/wayland/weston/-/blob/3b3fdc52c31f828ff0fb71d2c6ce7bdcc64f20a1/libweston/backend-drm/drm.c]

'프로그램 사용 > wayland' 카테고리의 다른 글

weston 커서 숨기기  (0) 2024.02.26
wayland hdmi - touch 연결  (0) 2023.09.08
weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
Posted by 구차니
프로그램 사용/wayland2022. 8. 17. 16:49

weston_screenshooter_shoot()을 따라오는데 영 어딜 파야 나올지 감이 안온다.

아무튼.. libweston의 screenshooter.c가 실제적으로 수행되는 부분 같은데

//git\include\libweston\libweston.h
int
weston_screenshooter_shoot(struct weston_output *output, struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data);

//git\libweston\screenshooter.c
WL_EXPORT int
weston_screenshooter_shoot(struct weston_output *output,
   struct weston_buffer *buffer,
   weston_screenshooter_done_func_t done, void *data)
{
struct screenshooter_frame_listener *l;

if (!wl_shm_buffer_get(buffer->resource)) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

buffer->shm_buffer = wl_shm_buffer_get(buffer->resource);
buffer->width = wl_shm_buffer_get_width(buffer->shm_buffer);
buffer->height = wl_shm_buffer_get_height(buffer->shm_buffer);

if (buffer->width < output->current_mode->width ||
    buffer->height < output->current_mode->height) {
done(data, WESTON_SCREENSHOOTER_BAD_BUFFER);
return -1;
}

l = malloc(sizeof *l);
if (l == NULL) {
done(data, WESTON_SCREENSHOOTER_NO_MEMORY);
return -1;
}

l->buffer = buffer;
l->output = output;
l->done = done;
l->data = data;
l->listener.notify = screenshooter_frame_notify;
wl_signal_add(&output->frame_signal, &l->listener);
weston_output_disable_planes_incr(output);
weston_output_damage(output);

return 0;
}

 

아무튼 추적을 계속해보면 아래와 같이 event_loop에 wl_event_loop_add_idle() 실행해서 추가해주고 끝.

//git\libweston\compositor.c
static void
weston_schedule_surface_protection_update(struct weston_compositor *compositor)
{
struct content_protection *cp = compositor->content_protection;
struct wl_event_loop *loop;

if (!cp || cp->surface_protection_update)
return;
loop = wl_display_get_event_loop(compositor->wl_display);
cp->surface_protection_update = wl_event_loop_add_idle(loop,
       notify_surface_protection_change,
       compositor);
}

WL_EXPORT void
weston_output_disable_planes_incr(struct weston_output *output)
{
output->disable_planes++;
/*
 * If disable_planes changes from 0 to non-zero, it means some type of
 * recording of content has started, and therefore protection level of
 * the protected surfaces must be updated to avoid the recording of
 * the protected content.
 */
if (output->disable_planes == 1)
weston_schedule_surface_protection_update(output->compositor);
}

 

struct content_protection은 누가 만드나 하면서 따라가보니

weston_compositor_enable_content_protection() 함수에서 만들어 주고 해당 함수는

//git\libweston\content-protection.c
WL_EXPORT int
weston_compositor_enable_content_protection(struct weston_compositor *compositor)
{
struct content_protection *cp;

cp = zalloc(sizeof(*cp));
if (cp == NULL)
return -1;
cp->compositor = compositor;

compositor->content_protection = cp;
wl_list_init(&cp->protected_list);
if (wl_global_create(compositor->wl_display,
     &weston_content_protection_interface, 1, cp,
     bind_weston_content_protection) == NULL)
return -1;

cp->destroy_listener.notify = cp_destroy_listener;
wl_signal_add(&compositor->destroy_signal, &cp->destroy_listener);
cp->debug = weston_compositor_add_log_scope(compositor, "content-protection-debug",
    "debug-logs for content-protection",
    NULL, NULL, NULL);
return 0;
}

 

drm_backend_create() 시에 b->atomic_modeset 조건에 의해서 생성된다.

//git\libweston\backend-drm\drm.c
static struct drm_backend *
drm_backend_create(struct weston_compositor *compositor,
   struct weston_drm_backend_config *config)
{
if (b->atomic_modeset)
if (weston_compositor_enable_content_protection(compositor) < 0)
weston_log("Error: initializing content-protection "
   "support failed.\n");
}

 

 

이름이 비슷한건지 걸려나오는 다른 녀석.

//protocol\weston-screenshooter-client-protocol.h
#define WESTON_SCREENSHOOTER_SHOOT 0

static inline void
weston_screenshooter_shoot(struct weston_screenshooter *weston_screenshooter, struct wl_output *output, struct wl_buffer *buffer)
{
wl_proxy_marshal((struct wl_proxy *) weston_screenshooter,
 WESTON_SCREENSHOOTER_SHOOT, output, buffer);
}

 

 wl_proxy_marshall()은 또 멀까해서 따라가 보지만.. 답이 안나온다 -_ㅠ

//wayland-main\src\wayland-client.c
WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor_versioned(struct wl_proxy *proxy,
     uint32_t opcode,
     union wl_argument *args,
     const struct wl_interface *interface,
     uint32_t version)
{
return wl_proxy_marshal_array_flags(proxy, opcode, interface, version, 0, args);
}

WL_EXPORT struct wl_proxy *
wl_proxy_marshal_array_constructor(struct wl_proxy *proxy,
   uint32_t opcode, union wl_argument *args,
   const struct wl_interface *interface)
{
return wl_proxy_marshal_array_constructor_versioned(proxy, opcode,
    args, interface,
    proxy->version);
}


WL_EXPORT void
wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
{
union wl_argument args[WL_CLOSURE_MAX_ARGS];
va_list ap;

va_start(ap, opcode);
wl_argument_from_va_list(proxy->object.interface->methods[opcode].signature,
 args, WL_CLOSURE_MAX_ARGS, ap);
va_end(ap);

wl_proxy_marshal_array_constructor(proxy, opcode, args, NULL);
}

 

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland hdmi - touch 연결  (0) 2023.09.08
wayland atomic commit 패치?  (0) 2022.08.22
wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
Posted by 구차니
프로그램 사용/wayland2022. 8. 16. 17:47

 

C Specification
void glReadPixels( GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLenum format,
GLenum type,
GLvoid * data);
Parameters
x, y
Specify the window coordinates of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.

width, height
Specify the dimensions of the pixel rectangle. width and height of one correspond to a single pixel.

[링크 : https://docs.gl/es3/glReadPixels]

 

static void
screenshooter_shoot(struct wl_client *client,
    struct wl_resource *resource,
    struct wl_resource *output_resource,
    struct wl_resource *buffer_resource)
{
struct wlsc_output *output = output_resource->data;
struct wl_buffer *buffer = buffer_resource->data;
if (!wl_buffer_is_shm(buffer))
return;
if (buffer->width < output->current->width ||
    buffer->height < output->current->height)
return;
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glReadPixels(0, 0, output->current->width, output->current->height,
     GL_RGBA, GL_UNSIGNED_BYTE,
     wl_shm_buffer_get_data(buffer));
}

[링크 : https://chromium.googlesource.com/chromiumos/third_party/wayland-demos/+/refs/heads/stabilize/compositor/screenshooter.c]

 

You can't take screenshots with glReadPixels!

[링크 : https://stackoverflow.com/questions/37149068/glreadpixels-function-returning-error-1282-gl-invalid-operation]

[링크 : https://stackoverflow.com/questions/44634621/glreadpixels-with-screen-pixels]

 

대충 짰는데 안되는 듯..

$ cat gl_cap.c
#include <stdio.h>
#include <GLES2/gl2.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>

void main()
{
                GLubyte color[1024*768*4];
                glReadPixels(0,0, 1024, 768, GL_RGBA, GL_UNSIGNED_BYTE, &color);
//              printf("R:%d G:%d B:%d A:%d", color[0], color[1], color[2], color[3]);
for(int y =0 ; y<768;y++)
for(int x =0 ; x < 1024; x++)
                printf("%4d,%3d R:%d G:%d B:%d A:%d\n", x,y
                        ,color[y*1024+x+0]
                        ,color[y*1024+x+1]
                        ,color[y*1024+x+2]
                        ,color[y*1024+x+3]
                );
}

 

링크는 아래와 같이 해주면 되긴 한데...

 -lwayland-egl -lGLESv2

 

흐으으으음...

# head dump
   0,  0 R:0 G:0 B:0 A:0
   1,  0 R:0 G:0 B:0 A:0
   2,  0 R:0 G:0 B:0 A:0
   3,  0 R:0 G:0 B:0 A:0
   4,  0 R:0 G:0 B:0 A:0
   5,  0 R:0 G:0 B:0 A:0
   6,  0 R:0 G:0 B:0 A:0
   7,  0 R:0 G:0 B:0 A:0
   8,  0 R:0 G:0 B:0 A:0
   9,  0 R:0 G:0 B:0 A:0
# tail dump
1014,767 R:0 G:0 B:0 A:0
1015,767 R:0 G:0 B:0 A:0
1016,767 R:0 G:0 B:0 A:0
1017,767 R:0 G:0 B:0 A:0
1018,767 R:0 G:0 B:0 A:0
1019,767 R:0 G:0 B:0 A:0
1020,767 R:0 G:0 B:0 A:0
1021,767 R:0 G:0 B:0 A:0
1022,767 R:0 G:0 B:0 A:0
1023,767 R:0 G:0 B:0 A:0

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland atomic commit 패치?  (0) 2022.08.22
weston screen shooter 뜯어보기  (0) 2022.08.17
sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
Posted by 구차니
프로그램 사용/wayland2022. 8. 10. 16:41

 

sway와 wayfire 라는 녀석이 wlroot 기반의 compositor 인 듯.

 

일단~~은 sway 패키지를 설치하고

$ sudo apt install sway

[링크 : https://installati.one/ubuntu/21.04/sway/]


wayvnc 설치(ubuntu 22.04 LTS/x86)

$ sudo apt install wayvnc

 

로그아웃 후에 세션을 sway로 변경

[링크 : https://llandy3d.github.io/sway-on-ubuntu/]

[링크 : https://www.slant.co/topics/11023/versus/~sway_vs_wayfire_vs_weston]

 

"윈 + D" 누르고 terminal 친 후 방향키로 gnome-terminal 선택 + enter

혹은 "윈 + enter"

 

요건 심심해서 htop 실행. i7-3635QM 이긴 한데

sway와 wayvnc가 동일하게 1.3% 씩 먹는 상황. 이걸 낮다고 봐야하나 높다고 봐야하나..

[링크 : https://swaywm.org/]

[링크 : https://wiki.archlinux.org/title/Sway]

 

터미널에서 wayvnc 접속가능하도록 실행

$ wayvnc 0.0.0.0

 

 

+

sway 단축키

super - shift - space (타일/창 전환)
super - e (가로 / 세로 타일 배치 전환)
super - h (창 전환)
super - enter (터미널 열기)
super - d (프로그램 실행?)

 

+

로그아웃

방법을 못 찾아서, sway 프로세스 kill 하고 다시 로그인 함 -_-

'프로그램 사용 > wayland' 카테고리의 다른 글

weston screen shooter 뜯어보기  (0) 2022.08.17
wayland glreadpixels 실패  (0) 2022.08.16
wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
weston redraw 취소하기  (0) 2022.07.07
Posted by 구차니

22.07.10 에 릴리즈 되었는데 H.264 인코딩이 특징인 듯.

wayland도 힘을 못써서 조용히 사라질줄 알았는데, 조용히 부활하고 있었던 건가.. -_-

[링크 : https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/wayland-display-server/1333848-wayvnc-0-5-vnc-server-for-wlroots-based-wayland-compositors-released]

[링크 : https://github.com/any1/wayvnc/releases/tag/v0.5.0]

[링크 : https://github.com/any1/wayvnc]

 

 

그나저나 s390x는 먼가 해서 찾아봤더니 (s로 시작해서 스냅드래곤인가 싶었지만)

[링크 : https://packages.ubuntu.com/jammy/wayvnc]

 

1998년 단종된 IBM System/390 시리즈 인 것 같은데.. 이걸 아직도(?) 지원해주다니..

[링크 : https://en.wikipedia.org/wiki/IBM_System/390]

[링크 : https://en.wikipedia.org/wiki/Linux_on_IBM_Z#Hardware]

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland glreadpixels 실패  (0) 2022.08.16
sway + wayvnc  (0) 2022.08.10
capture drm screen  (0) 2022.08.08
weston redraw 취소하기  (0) 2022.07.07
weston drm debug  (0) 2022.06.29
Posted by 구차니

openGL 컨텍스트를 이용해서 빼내거나

mmap 으로 빼내라고 하는데 어떤 주소값을 복사해야 하는지 이야기가 없네.

 

[링크 : https://stackoverflow.com/questions/47428631/get-screenshot-of-egl-drm-kms-application]

 

+

22.08.09

void glReadPixels( GLint x,
  GLint y,
  GLsizei width,
  GLsizei height,
  GLenum format,
  GLenum type,
  void * data);
 
void glReadnPixels( GLint x,
  GLint y,
  GLsizei width,
  GLsizei height,
  GLenum format,
  GLenum type,
  GLsizei bufSize,
  void * data);

[링크 : https://registry.khronos.org/OpenGL-Refpages/es3/html/glReadPixels.xhtml]

 

[링크 : https://community.nxp.com/t5/i-MX-Processors/Rendering-with-OpenGL-ES-2-x-3-x-to-a-DMA-buffer-physical-memory/m-p/1229007]
  [링크 : https://community.nxp.com/t5/i-MX-Processors/Zero-copy-between-GPU-and-VPU/m-p/1044158]

[링크 : https://stackoverflow.com/questions/3191978/how-to-use-glut-opengl-to-render-to-a-file]

'프로그램 사용 > wayland' 카테고리의 다른 글

sway + wayvnc  (0) 2022.08.10
wayvnc 0.5 릴리즈  (0) 2022.08.09
weston redraw 취소하기  (0) 2022.07.07
weston drm debug  (0) 2022.06.29
libwayland debug 메시지  (0) 2022.06.27
Posted by 구차니

코드 분석하다 보니 아래와 같은 함수를 compositor.c에서 발견함.

weston 에서 호출되는 곳은 3 곳.

 

/** State of the repaint loop */
enum {
REPAINT_NOT_SCHEDULED = 0, /**< idle; no repaint will occur */
REPAINT_BEGIN_FROM_IDLE, /**< start_repaint_loop scheduled */
REPAINT_SCHEDULED, /**< repaint is scheduled to occur */
REPAINT_AWAITING_COMPLETION, /**< last repaint not yet finished */
} repaint_status;

static void
weston_output_schedule_repaint_reset(struct weston_output *output)
{
output->repaint_status = REPAINT_NOT_SCHEDULED;
TL_POINT(output->compositor, "core_repaint_exit_loop",
 TLP_OUTPUT(output), TLP_END);
}

'프로그램 사용 > wayland' 카테고리의 다른 글

wayvnc 0.5 릴리즈  (0) 2022.08.09
capture drm screen  (0) 2022.08.08
weston drm debug  (0) 2022.06.29
libwayland debug 메시지  (0) 2022.06.27
libwayland  (0) 2022.06.27
Posted by 구차니