nouveau/dispnv50: add cursor pitch check
authorSimon Ser <contact@emersion.fr>
Fri, 5 Feb 2021 22:41:40 +0000 (23:41 +0100)
committerSimon Ser <contact@emersion.fr>
Mon, 10 Jul 2023 07:45:47 +0000 (09:45 +0200)
commit815d091f90e170406bcef9aafc4ca434de206765
tree7bb26b3e04e572bddf37b74ab56fdaca265b29c4
parent70d1ace56db6c79d39dbe9c0d5244452b67e2fde
nouveau/dispnv50: add cursor pitch check

The hardware needs a FB which is packed. Add checks to make sure
this is the case.

While at it, add debug logs for the existing checks. This allows
user-space to more easily figure out why a configuration is
rejected.

v2:
- Use drm_format_info instead of hardcoding bytes-per-pixel (Ilia)
- Remove unnecessary size check (Ilia)

v3:
- Add missing newlines in debug messages (Lyude)
- Use NV_ATOMIC (Lyude)
- Add missing debug log for invalid format (Ilia)

v4: add plane name in debug messages (Ilia)

Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Ben Skeggs <bskeggs@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210205224140.28174-1-contact@emersion.fr
drivers/gpu/drm/nouveau/dispnv50/curs507a.c