We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 5231 - [KMSDRM][PATCH] Fix for hardware cursor: size and alpha-premultiplication.
Summary: [KMSDRM][PATCH] Fix for hardware cursor: size and alpha-premultiplication.
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: All Linux
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-13 21:05 UTC by Manuel Alfayate Corchete
Modified: 2020-07-19 20:13 UTC (History)
0 users

See Also:


Attachments
Fix for KMSDRM mouse cursor alpha and supported size. (12.27 KB, patch)
2020-07-13 21:05 UTC, Manuel Alfayate Corchete
Details | Diff
V2 Fix for KMSDRM mouse cursor alpha and supported size (12.35 KB, patch)
2020-07-15 00:46 UTC, Manuel Alfayate Corchete
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Alfayate Corchete 2020-07-13 21:05:54 UTC
Created attachment 4411 [details]
Fix for KMSDRM mouse cursor alpha and supported size.

Hi there,

I noticed pt2-clone had problems with it's optional hardware mouse on the KMSDRM backend: cursor had a transparent block around it.
So I was investigating and it seems that a GBM cursor needs it's pixels to be alpha-premultiplied instead of straight-alpha.
A
lso, I was previously relying on "manual testing" for the cursor size, but it's far better to use whatever the DRM driver recommends via drmGetCap(): any working driver should make a size recommendation via drmGetCap(), so that's what we use now. I took this decision because I found out that the AMDGPU driver reported working cursor sizes that would appear garbled on screen, and only the recommended cursor size works.

The included patch applies cleanly on current mercurial sources. Please merge.

Thanks!

Manuel
Comment 1 Manuel Alfayate Corchete 2020-07-15 00:46:23 UTC
Created attachment 4412 [details]
V2 Fix for KMSDRM mouse cursor alpha and supported size

V2 of the previous patch, fixing small variable types mismatch with drmGetCap() parameters.
Comment 2 Manuel Alfayate Corchete 2020-07-19 20:13:51 UTC
Merged by @slouken. Thanks!