swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.64k stars 1.11k forks source link

Corrupted mouse cursor #3851

Open lineaar opened 5 years ago

lineaar commented 5 years ago

This corresponds to commit c02d2a01

emersion commented 5 years ago

We need more info. The debug log is truncated, please send one with sway -d >sway.log 2>&1 (redirection order does matter).

How is it "corrupted"? Please share some screenshots.

What is your graphics card?

lineaar commented 5 years ago

Here is the log https://gist.github.com/lineaar/f9a4fa41ca067a5f87e3153c0753650f

lineaar commented 5 years ago

The graphics card used in that machine is an ATI Radeon HD 4770.

lineaar commented 5 years ago

Now, taking a screenshot with grim -c does not capture what is being observed.

image

Taking a picture of the screen does however.

image

IohannesArnold commented 5 years ago

Also having this problem with a Radeon HD 4850 graphics card.

emersion commented 5 years ago

I've seen this kind of issue with multi-GPU support too (Intel-AMD). It's probably a bug with DMA-BUFs.

Supded commented 5 years ago

+1 Only one card - 4850 hd. Driver - radeon with firmware.

Supded commented 5 years ago

sway.log

kamiyaa commented 5 years ago

Having the same issue but on intel iGPU

The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
> Internal error:   Could not resolve keysym XF86MonBrightnessCycle
karr0n commented 5 years ago

Radeon HD 4850 - same issue, initially changed the cursor theme but that didn't have any impact.

vobie commented 5 years ago

Same issue. Ancient GPU. Newbie, not sure what info to provide but posting lspci and sway.log using way -d >sway.log 2>&1 suggested above.

The screenshot issue is the same as poster above. Snapping a screenshot makes the pointer turn normal for a short while before reverting to the striped monstrosity from the picture (but way more deformed, hard to make out the pointer shape at all).

Additional information is that I'm using two screens and the pointer "square" looks different depending on what screen I'm on. One screen is portrait mode and on that one the stripes are vertical.

It seems the "pointer square" picks up on what was below the pointer the first time that particular pointer type showed up and stays there. Example: The standard pointer retains some color from my desktop background. The "hand" (hovering link in browser) retains some white from the website I was on. Cannot say for sure this happens 100% of the time but I am certain there is some "retention" from previous places the pointer has been.

sudo lspci -vnn | grep VGA -A 12 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G70 [GeForce 7800 GT] [10de:0092] (rev a1) (prog-if 00 [VGA controller]) Subsystem: CardExpert Technology G70 [GeForce 7800 GT] [10b0:0801] Flags: bus master, fast devsel, latency 0, IRQ 33 Memory at fa000000 (32-bit, non-prefetchable) [size=16M] Memory at c0000000 (64-bit, prefetchable) [size=512M] Memory at f9000000 (64-bit, non-prefetchable) [size=16M] I/O ports at e000 [size=128] Expansion ROM at 000c0000 [disabled] [size=128K] Capabilities: [60] Power Management version 2 Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [78] Express Endpoint, MSI 00 Capabilities: [100] Virtual Channel Capabilities: [128] Power Budgeting <?>

sway version 1.2-rc1-48-ga085e649 (Sep 12 2019, branch 'master')

sway.log

Happy to provide any kind of information if clear instructions are provided.

lindeMAX commented 5 years ago

I can confirm this error on an hd 4850 and hd 4350. It seems to not occur under x (tested i3 and gnome).

ascent12 commented 5 years ago

The image posted clearly indicates the incorrect stride used when trying to present the buffer with the hardware cursor. It's was a pretty common occurrence during development. But I don't know why old cards/drivers would recently be causing an issue with that now yet still be perfectly fine with recent drivers. The oldest card I can have in my possession is an HD 6950.

Anyway, the current workaround would be to start sway with WLR_NO_HARDWARE_CURSORS=1, which is actually the same reason it appears fine in screenshots.

I've been doing some cursor stuff lately, so I'll have to see if any of that accidentally fixes this.

vobie commented 5 years ago

@ascent12 thank you! mouse lags pretty bad when using WLR_NO_HARDWARE_CURSORS=1 but still much preferable to the squareish pointers.

cv1618 commented 5 years ago

I have a Radeon HD 4650 on dual monitors and the work around of adding WLR_NO_HARDWARE_CURSORS=1 to /etc/environment worked but now I have two cursors one that moves with the mouse and a second static one that's on the middle of the primary display. It's tolerable though until I get a newer better graphics card.

handicraftsman commented 4 years ago

Yeah, same issue. Radeon HD 4350 (due to some reasons cannot get a new pc)

pierolenzo commented 4 years ago

Same issue, sway version 1.4 on gentoo system 4.19.97-gentoo-x86_64, this is my card 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV710/M92 [Mobility Radeon HD 4530/4570/545v] [1002:9553] (prog-if 00 [VGA controller]) Subsystem: Dell Mobility Radeon HD 4570 / 545v [1028:02be] Flags: bus master, fast devsel, latency 0, IRQ 28 Memory at d0000000 (32-bit, prefetchable) [size=256M] I/O ports at 2000 [size=256] Memory at fc000000 (32-bit, non-prefetchable) [size=64K] [virtual] Expansion ROM at 000c0000 [disabled] [size=128K] Capabilities: [50] Power Management version 3 Capabilities: [58] Express Legacy Endpoint, MSI 00 Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> Kernel driver in use: radeon Kernel modules: radeon

bhepple commented 4 years ago

Same issue, sway version sway-1.4 on Fedora-31 Linux 5.7.9-100.fc31.x86_64

01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] RV710 [Radeon HD 4350/4550]

kernel driver is radeon:

radeon               1626112  22
i2c_algo_bit           16384  1 radeon
drm_kms_helper        241664  1 radeon
ttm                   122880  1 radeon
drm                   610304  18 drm_kms_helper,radeon,ttm

I'm happy to run tests, provide more logs etc

WLR_NO_HARDWARE_CURSORS=1 fixes the problem

emersion commented 4 years ago

Can you report a radeon bug at https://gitlab.freedesktop.org/drm/amd/-/issues?

bhepple commented 4 years ago

OK - done. https://gitlab.freedesktop.org/drm/amd/-/issues/1303

Happy to provide more details, do experiments etc

IohannesArnold commented 4 years ago

After having had this problem from 1.0, I just updated my system and it's gone! Void Linux, Sway version v1.5, x86_64 Linux 5.8.10; Radeon HD 4850.

bhepple commented 4 years ago

I'm still on Fedora-31 and sway-1.5 is not available there. IohannesArnold - can you recall if you had the problem at sway-1.4? or did you go frm sway-1.0 to -1.5?

IohannesArnold commented 4 years ago

No, I kept my system updated. 1.4 still had this behavior; when I upgraded to 1.5 the cursor finally appeared normal.

bhepple commented 4 years ago

Thanks for the info IohannesArnold - I'll remove the WLR_NO_HARDWARE_CURSORS=1 hack once I get to sway-1.5

emersion commented 4 years ago

See this wiki page to compile Sway from source: https://github.com/swaywm/sway/wiki/Development-Setup#compiling-as-a-subproject