https://bugs.kde.org/show_bug.cgi?id=502844

            Bug ID: 502844
           Summary: DMABUF format NV12 not advertised with NVIDIA card
    Classification: Plasma
           Product: kwin
           Version: 6.3.3
          Platform: Manjaro
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: kwin-bugs-n...@kde.org
          Reporter: kloz...@outlook.com
  Target Milestone: ---

by checking info center, there's only one NV12 format with LINEAR modifier,
which doesn't work for me.

i checked the EGL api  with GBM platform for DMABUF formats with NVIDIA
proprietary driver, some supported formats are shown as follows
```
format: NV12(3231564e), modifier: 3000000004fe010, external_only: true
format: NV12(3231564e), modifier: 3000000004fe011, external_only: true
format: NV12(3231564e), modifier: 3000000004fe012, external_only: true
format: NV12(3231564e), modifier: 3000000004fe013, external_only: true
format: NV12(3231564e), modifier: 3000000004fe014, external_only: true
format: NV12(3231564e), modifier: 3000000004fe015, external_only: true
format: NV12(3231564e), modifier: 0, external_only: true
format: R8  (20203852), modifier: 3000000004fe010, external_only: false
format: R8  (20203852), modifier: 3000000004fe011, external_only: false
format: R8  (20203852), modifier: 3000000004fe012, external_only: false
format: R8  (20203852), modifier: 3000000004fe013, external_only: false
format: R8  (20203852), modifier: 3000000004fe014, external_only: false
format: R8  (20203852), modifier: 3000000004fe015, external_only: false
format: R8  (20203852), modifier: 0, external_only: true
format: RG88(38384752), modifier: 3000000004fe010, external_only: false
format: RG88(38384752), modifier: 3000000004fe011, external_only: false
format: RG88(38384752), modifier: 3000000004fe012, external_only: false
format: RG88(38384752), modifier: 3000000004fe013, external_only: false
format: RG88(38384752), modifier: 3000000004fe014, external_only: false
format: RG88(38384752), modifier: 3000000004fe015, external_only: false
format: RG88(38384752), modifier: 0, external_only: true
 ```

kwin has special treatment for NV12, at src/utils/drm_format_helper.h:35, that
trying to convert NV12 to R8 and GR88, while the driver only support R8 and
RG88 on my setup.
```
static const QHash<uint32_t, YuvConversion> s_drmConversions = {
    {DRM_FORMAT_NV12, YuvConversion{
                          {YuvFormat{DRM_FORMAT_R8, 1, 1},
YuvFormat{DRM_FORMAT_GR88, 2, 2}},
                      }},
};
```

i believe kwin removes NV12 modifiers at
src/platformsupport/scenes/opengl/abstract_egl_backend.cpp:142, by removing all
modifiers that not present in R8 and GR88, so it removes all modifiers since
GR88 not exists at all.

related [merge
request](https://invent.kde.org/plasma/kwin/-/merge_requests/4581)

i compiled kwin with GR88 replaced by RG88, then NV12 shows at info center,
though i don't know if it's the proper solution.

i can confirm it works by using mpv with dmabuf-wayland, and a modified
nvidia-vaapi-driver.


SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.12.0
Qt Version: 6.8.2
Kernel Version: 6.14.0-1-MANJARO (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-7700HQ CPU @ 2.80GHz
Memory: 23.4 GiB of RAM
Graphics Processor 1: NVIDIA GeForce GTX 1050/PCIe/SSE2
Graphics Processor 2: NVIDIA GeForce GTX 1050/PCIe/SSE2

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to