You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Asymmetric overscan prevents mouse from reaching the desktop edge #4447
Is this the right place for my bug report?
Yes, either here or firmware. Jamesh suggested I try opening an issue here first.
Describe the bug
If left overscan and right overscan are not equal to one another, the mouse pointer will not be able to cover the entire desktop area.
changed the title [-]Asymmetric overscan prevents mouse from touching screen edge [/-][+]Asymmetric overscan prevents mouse from reaching the desktop edge[/+]on Jul 10, 2021
As a quick test can you try altering /boot/config.txt so that you have dtoverlay=vc4-kms-v3d instead of vc4-fkms-v3d, reboot, and see if that has the same issue? That'll allow us to narrow it down between fkms/firmware and kernel framework.
And vc4-kms-v3d behaves the same - it clips the X offset to too low a value.
X is still moving the mouse pointer off beyond the limit, as if there is something that changes when you hover over it, you see that happen even if it's in the bit the pointer can't get to. Also true in the Y direction if you set overscan_top.
That's wrong and I believe should be simply checking crtc_x against hdisplay without subtracting left. Same for the check on crtc_y a few lines later.
The only check that may be valid is to clip the bits of the image that then fall off the screen, but I think the display list generation does that anyway.
vc4_firmware_kms margins support was copied from vc4_planes, which explains why they both have the same issue.
Mentally running through the combinations, I think there is still an issue if we take the example of a 1280x720 display, overscan defined as 100 off the right or bottom, and the application tries to push the image off the right/bottom edge. The source rectangle isn't being cropped, therefore part of the image will be visible in the overscan border.
Reading that function it all seems a bit weird to me.
Margins in DRM are all a little icky in that they scale the image, but that's the way mainline chose to solve the problem :-/
Getting the maths right to clip every thing correctly is non-trivial, and mistakes are easy to make. This one has been in there since December 2018 and no one has noticed until now!
I've confirmed via modetest that I can display an image in the overscan region with FKMS (almost certainly applies to KMS too), so that ought to be fixed.
Activity
[-]Asymmetric overscan prevents mouse from touching screen edge [/-][+]Asymmetric overscan prevents mouse from reaching the desktop edge[/+]Botspot commentedon Jul 10, 2021
Curious onlookers can review my forum post as well.
6by9 commentedon Jul 12, 2021
As a quick test can you try altering /boot/config.txt so that you have
dtoverlay=vc4-kms-v3dinstead of vc4-fkms-v3d, reboot, and see if that has the same issue? That'll allow us to narrow it down between fkms/firmware and kernel framework.6by9 commentedon Jul 12, 2021
Can you also give us the output from
cat /proc/cmdline?6by9 commentedon Jul 12, 2021
To answer my own questions, /proc/cmdline is correct for me in having
And vc4-kms-v3d behaves the same - it clips the X offset to too low a value.
X is still moving the mouse pointer off beyond the limit, as if there is something that changes when you hover over it, you see that happen even if it's in the bit the pointer can't get to. Also true in the Y direction if you set overscan_top.
Looking at the code I do see the obvious error
https://github.com/raspberrypi/linux/blob/rpi-5.10.y/drivers/gpu/drm/vc4/vc4_plane.c#L313
That's wrong and I believe should be simply checking
crtc_xagainsthdisplaywithout subtractingleft. Same for the check on crtc_y a few lines later.The only check that may be valid is to clip the bits of the image that then fall off the screen, but I think the display list generation does that anyway.
vc4_firmware_kms margins support was copied from vc4_planes, which explains why they both have the same issue.
JamesH65 commentedon Jul 12, 2021
Same error on line 320 in the vertical coordinates.
6by9 commentedon Jul 12, 2021
I'll correct myself before someone else does it for me.
Mentally running through the combinations, I think there is still an issue if we take the example of a 1280x720 display, overscan defined as 100 off the right or bottom, and the application tries to push the image off the right/bottom edge. The source rectangle isn't being cropped, therefore part of the image will be visible in the overscan border.
JamesH65 commentedon Jul 12, 2021
Reading that function it all seems a bit weird to me.
6by9 commentedon Jul 12, 2021
Wasn't that covered by:
JamesH65 commentedon Jul 12, 2021
Yes, sorry, missed that bit.
6by9 commentedon Jul 12, 2021
Margins in DRM are all a little icky in that they scale the image, but that's the way mainline chose to solve the problem :-/
Getting the maths right to clip every thing correctly is non-trivial, and mistakes are easy to make. This one has been in there since December 2018 and no one has noticed until now!
6by9 commentedon Jul 12, 2021
I've confirmed via modetest that I can display an image in the overscan region with FKMS (almost certainly applies to KMS too), so that ought to be fixed.
drm/vc4: fkms: Fix margin calculations for the right/bottom edges
6by9 commentedon Jul 12, 2021
PR up for the basic issue in #4451
drm/vc4: fkms: Fix margin calculations for the right/bottom edges
288 remaining items
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode
drm/vc4: Add firmware-kms mode