mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 13:34:10 +08:00
drm/fourcc: fix Amlogic format modifier masks
The comment says the layout and options use 8 bits, and the shift
uses 8 bits. However the mask is 0xf, ie. 0b00001111 (4 bits).
This could be surprising when introducing new layouts or options
that take more than 4 bits, as this would silently drop the high
bits.
Make the masks consistent with the comment and the shift.
Found when writing a drm_info patch [1].
[1]: https://github.com/ascent12/drm_info/pull/67
Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: d6528ec883
("drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression")
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210110125103.15447-1-contact@emersion.fr
This commit is contained in:
parent
dc25e3776e
commit
cc3283f8f4
@ -1036,9 +1036,9 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
|
||||
* Not all combinations are valid, and different SoCs may support different
|
||||
* combinations of layout and options.
|
||||
*/
|
||||
#define __fourcc_mod_amlogic_layout_mask 0xf
|
||||
#define __fourcc_mod_amlogic_layout_mask 0xff
|
||||
#define __fourcc_mod_amlogic_options_shift 8
|
||||
#define __fourcc_mod_amlogic_options_mask 0xf
|
||||
#define __fourcc_mod_amlogic_options_mask 0xff
|
||||
|
||||
#define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \
|
||||
fourcc_mod_code(AMLOGIC, \
|
||||
|
Loading…
Reference in New Issue
Block a user