isjerryxiao / kmsvnc

A VNC server for DRM/KMS capable GNU/Linux devices
GNU General Public License v3.0
50 stars 6 forks source link

[amdgpu] No usable cursor plane found, cursor capture currently unavailable #6

Closed ctrlcctrlv closed 1 year ago

ctrlcctrlv commented 1 year ago

I tried all combinations of plane/crtc but could not get a movable cursor.

drm driver is amdgpu
Plane 40 CRTC 0 FB 0 Type primary
Plane 46 CRTC 0 FB 0 Type primary
Plane 52 CRTC 0 FB 0 Type primary
Plane 58 CRTC 0 FB 0 Type primary
Plane 64 CRTC 95 FB 154 Type primary
Plane 70 CRTC 91 FB 154 Type primary
Plane 76 CRTC 0 FB 0 Type overlay
Plane 82 CRTC 0 FB 0 Type overlay
Plane 88 CRTC 0 FB 0 Type cursor
Plane 92 CRTC 0 FB 0 Type cursor
Plane 96 CRTC 0 FB 0 Type cursor
Plane 100 CRTC 0 FB 0 Type cursor
Plane 104 CRTC 0 FB 0 Type cursor
Plane 108 CRTC 0 FB 0 Type cursor
ctrlcctrlv commented 1 year ago

Closing my own issue, works with KRDC for some reason but not TigerVNC or RealVNC.

ctrlcctrlv commented 1 year ago

Apologies for the spam. No it doesn't. I forgot I had Barrier open :blush:

isjerryxiao commented 1 year ago

Maybe your cursor is hidden by some application. kmsvnc will keep retrying until a usable cursor plane is found. Hence "currently" the word is used here.

ctrlcctrlv commented 1 year ago

it's plasma-wayland. hmm. also happens on cinnamon x11. i think closed prematurly

isjerryxiao commented 1 year ago

If there's a cursor plane available kmsvnc would have used it. Please check if you have a cursor on screen (some applications may hide the cursor). If that is the case and there's still no cursor in kmsvnc, try running the server with --debug and watch the output for "Cursor framebuffer missing", "Cursor plane modifier is not linear", "Cursor plane pixel format unsupported" or "Failed to mmap cursor".

ctrlcctrlv commented 1 year ago

[fred@大.狸.agency ~]$ sudo kmsvnc --debug -c No keyboard layout set from environment variables, use US layout by default See https://xkbcommon.org/doc/current/structxkb__rule__names.html drm driver is amdgpu Plane 45 CRTC 0 FB 0 Type primary Plane 50 CRTC 0 FB 0 Type primary Plane 55 CRTC 0 FB 0 Type primary Plane 60 CRTC 0 FB 0 Type primary Plane 65 CRTC 90 FB 152 Type primary Plane 70 CRTC 87 FB 152 Type primary Plane 75 CRTC 0 FB 0 Type overlay Plane 80 CRTC 0 FB 0 Type overlay Plane 85 CRTC 0 FB 0 Type cursor Plane 88 CRTC 0 FB 0 Type cursor Plane 91 CRTC 0 FB 0 Type cursor Plane 94 CRTC 0 FB 0 Type cursor Plane 97 CRTC 0 FB 0 Type cursor Plane 100 CRTC 0 FB 0 Type cursor No usable cursor plane found, cursor capture currently unavailable Using plane 65 to locate framebuffers Template framebuffer is 152: 4864x2160 fourcc:875713112 mod:144115188622392067 flags:2 handles 1 1 1 0 offsets 0 42336256 42541056 0 pitches 19456 5120 5120 0 format XR24, modifier AMD:GFX10_RBPLUS,GFX9_64K_R_X,DCC,DCC_RETILE,DCC_INDEPENDENT_64B,DCC_INDEPENDENT_128B,DCC_MAX_COMPRESSED_BLOCK=64B,DCC_CONSTANT_ENCODE,PIPE_XOR_BITS=4,PACKERS=4 va msg: VA-API version 1.20.0 va msg: Trying to open /usr/lib/dri/radeonsi_drv_video.so va msg: Found init function __vaDriverInit_1_20 va msg: va_openDriver() returns 0 vaapi vendor Mesa Gallium driver 23.3.0-devel for AMD Radeon RX 6900 XT (navi21, LLVM 16.0.6, DRM 3.52, 6.0.0-1-hdr-git-02753-gff57328e5784) selected rt_format 131072, alpha 0 image fmt: fourcc 842094158, NV12, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808530000, P010, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 909193296, P016, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808596553, I420, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 842094169, YV12, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1448695129, YUYV, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 844715353, YUY2, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1498831189, UYVY, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808466521, Y800, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1345598516, 444P, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1346520914, RGBP, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1095911234, BGRA, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 image fmt: fourcc 1094862674, RGBA, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 image fmt: fourcc 1111970369, ARGB, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 image fmt: fourcc 1481787202, BGRX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 image fmt: fourcc 1480738642, RGBX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 va operation error 0x1 operation failed on line 338 got vaapi image: image fmt: fourcc 1481787202, BGRX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 18/09/2023 14:46:47 Listening for VNC connections on TCP port 5900 18/09/2023 14:46:47 Listening for VNC connections on TCP6 port 5900

ctrlcctrlv commented 1 year ago

HMM. why using /usr/lib/dri/radeonsi_drv_video.so ? i'll look into

[fred@大.狸.agency ~]$ ls /usr/lib/dri | grep -P '(amd|radeon)'
amdgpu_dri.so
radeonsi_dri.so
radeonsi_drv_video.so
isjerryxiao commented 1 year ago

[fred@大.狸.agency ~]$ sudo kmsvnc --debug -c No keyboard layout set from environment variables, use US layout by default See https://xkbcommon.org/doc/current/structxkb__rule__names.html drm driver is amdgpu Plane 45 CRTC 0 FB 0 Type primary Plane 50 CRTC 0 FB 0 Type primary Plane 55 CRTC 0 FB 0 Type primary Plane 60 CRTC 0 FB 0 Type primary Plane 65 CRTC 90 FB 152 Type primary Plane 70 CRTC 87 FB 152 Type primary Plane 75 CRTC 0 FB 0 Type overlay Plane 80 CRTC 0 FB 0 Type overlay Plane 85 CRTC 0 FB 0 Type cursor Plane 88 CRTC 0 FB 0 Type cursor Plane 91 CRTC 0 FB 0 Type cursor Plane 94 CRTC 0 FB 0 Type cursor Plane 97 CRTC 0 FB 0 Type cursor Plane 100 CRTC 0 FB 0 Type cursor No usable cursor plane found, cursor capture currently unavailable Using plane 65 to locate framebuffers Template framebuffer is 152: 4864x2160 fourcc:875713112 mod:144115188622392067 flags:2 handles 1 1 1 0 offsets 0 42336256 42541056 0 pitches 19456 5120 5120 0 format XR24, modifier AMD:GFX10_RBPLUS,GFX9_64K_R_X,DCC,DCC_RETILE,DCC_INDEPENDENT_64B,DCC_INDEPENDENT_128B,DCC_MAX_COMPRESSED_BLOCK=64B,DCC_CONSTANT_ENCODE,PIPE_XOR_BITS=4,PACKERS=4 va msg: VA-API version 1.20.0 va msg: Trying to open /usr/lib/dri/radeonsi_drv_video.so va msg: Found init function __vaDriverInit_1_20 va msg: va_openDriver() returns 0 vaapi vendor Mesa Gallium driver 23.3.0-devel for AMD Radeon RX 6900 XT (navi21, LLVM 16.0.6, DRM 3.52, 6.0.0-1-hdr-git-02753-gff57328e5784) selected rt_format 131072, alpha 0 image fmt: fourcc 842094158, NV12, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808530000, P010, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 909193296, P016, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808596553, I420, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 842094169, YV12, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1448695129, YUYV, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 844715353, YUY2, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1498831189, UYVY, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 808466521, Y800, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1345598516, 444P, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1346520914, RGBP, byte_order VA_MSB_FIRST, bpp 0, depth 0, blue_mask 0, green_mask 0, red_mask 0, reserved 0 0 0 0 image fmt: fourcc 1095911234, BGRA, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 image fmt: fourcc 1094862674, RGBA, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 image fmt: fourcc 1111970369, ARGB, byte_order VA_LSB_FIRST, bpp 32, depth 32, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 image fmt: fourcc 1481787202, BGRX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 image fmt: fourcc 1480738642, RGBX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff0000, green_mask 0xff00, red_mask 0xff, reserved 0 0 0 0 va operation error 0x1 operation failed on line 338 got vaapi image: image fmt: fourcc 1481787202, BGRX, byte_order VA_LSB_FIRST, bpp 32, depth 24, blue_mask 0xff, green_mask 0xff00, red_mask 0xff0000, reserved 0 0 0 0 18/09/2023 14:46:47 Listening for VNC connections on TCP port 5900 18/09/2023 14:46:47 Listening for VNC connections on TCP6 port 5900

Keep using the vnc server, try moving the cursor to a new window, switch windows, record the output accordingly. Again "No usable cursor plane found, cursor capture currently unavailable" just mean cursor plane is not present when kmsvnc was first started, the cursor plane can be discovered at any time. (Although a client must be connected first, the cursor plane refresh routine is tied to frame updates)

ctrlcctrlv commented 1 year ago

I have the monitor right next to me and can move cursor with barrier? thats what i normally do but was trialing this as i want to just control it from laptop

ctrlcctrlv commented 1 year ago

i can scroll with barrier off but still not move the cursor (perhaps scrolling is considered a "keypress")

isjerryxiao commented 1 year ago

What you have said is not understandable. Please rephrase your words.

isjerryxiao commented 1 year ago

From your output

Plane 45 CRTC 0 FB 0 Type primary
Plane 50 CRTC 0 FB 0 Type primary
Plane 55 CRTC 0 FB 0 Type primary
Plane 60 CRTC 0 FB 0 Type primary
Plane 65 CRTC 90 FB 152 Type primary
Plane 70 CRTC 87 FB 152 Type primary
Plane 75 CRTC 0 FB 0 Type overlay
Plane 80 CRTC 0 FB 0 Type overlay
Plane 85 CRTC 0 FB 0 Type cursor
Plane 88 CRTC 0 FB 0 Type cursor
Plane 91 CRTC 0 FB 0 Type cursor
Plane 94 CRTC 0 FB 0 Type cursor
Plane 97 CRTC 0 FB 0 Type cursor
Plane 100 CRTC 0 FB 0 Type cursor
No usable cursor plane found, cursor capture currently unavailable

I can see two primary planes, which is an indicator that multiple monitors are present on the system.
Cursor capture is there to capture the bitmap graphics of your hardware cursor, instead of showing a black "X" as the vnc cursor. Apparently you are having some mouse input issues which is completely unrelated to this feature.
To properly use multiple monitors with kmsvnc, you should specify the following parameters:

      --input-height=0       Explicitly set input height
      --input-offx=0         Set input offset of x axis on a multi display
                             system
      --input-offy=0         Set input offset of y axis on a multi display
                             system
      --input-width=0        Explicitly set input width, normally this is
                             inferred from screen width on a single display
                             system

image

ctrlcctrlv commented 1 year ago

i think some magic is being done by the gpu , as i don't have multiple monitors ! :-D